Commit 462659b2 authored by Sushil Chauhan's avatar Sushil Chauhan
Browse files

Bug 1078189 - Back out bug 1059023 for causing regression. r=dwilson, a=bajaj

parent ac2c253a
Loading
Loading
Loading
Loading
+6 −10
Changes for widget/gonk/HwcComposer2D.cpp: 6 added lines, 10 removed lines.
Original line number Diff line number Diff line
@@ -427,21 +427,17 @@ HwcComposer2D::PrepareLayerList(Layer* aLayer,
    // OK!  We can compose this layer with hwc.
    int current = mList ? mList->numHwLayers : 0;

    // Do not compose any layer below full-screen Opaque layer
    // Note: It can be generalized to non-fullscreen Opaque layers.
    bool isOpaque = (opacity == 0xFF) && (aLayer->GetContentFlags() & Layer::CONTENT_OPAQUE);
    if (current && isOpaque) {
        nsIntRect displayRect = HwcUtils::HwcToIntRect(displayFrame);
        nsIntRect displayRect = nsIntRect(displayFrame.left, displayFrame.top,
            displayFrame.right - displayFrame.left, displayFrame.bottom - displayFrame.top);
        if (displayRect.Contains(mScreenRect)) {
            // In z-order, all previous layers are below current layer
            // Do not compose any layer below full-screen opaque layer
            // In z-order, all previous layers are below
            // the current layer. We can ignore them now.
            mList->numHwLayers = current = 0;
            mHwcLayerMap.Clear();
        } else {
            nsIntRect rect = HwcUtils::HwcToIntRect(mList->hwLayers[current-1].displayFrame);
            if (displayRect.Contains(rect)) {
                // Do not compose layer hidden under the opaque layer
                mHwcLayerMap.RemoveElementAt(current-1);
                current = --mList->numHwLayers;
            }
        }
    }

+0 −6
Changes for widget/gonk/HwcUtils.cpp: 0 added lines, 6 removed lines.
Original line number Diff line number Diff line
@@ -146,10 +146,4 @@ HwcUtils::CalculateClipRect(const gfx::Matrix& transform,
    return true;
}

nsIntRect
HwcUtils::HwcToIntRect(hwc_rect_t aRect) {
    return nsIntRect(aRect.left, aRect.top, aRect.right - aRect.left,
                aRect.bottom - aRect.top);
}

} // namespace mozilla
+0 −3
Changes for widget/gonk/HwcUtils.h: 0 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -118,9 +118,6 @@ static bool PrepareLayerRects(nsIntRect aVisible, const gfx::Matrix& aTransform,
                              hwc_rect_t* aSourceCrop,
                              hwc_rect_t* aVisibleRegionScreen);

/* Converts hwc_rect_t to nsIntRect */
static nsIntRect HwcToIntRect(hwc_rect_t aRect);

};

} // namespace mozilla