author | Robert O'Callahan <robert@ocallahan.org> |
Thu, 30 Oct 2014 15:32:41 +1300 | |
changeset 213372 | 36a17c5ca3dbd8c7c461af9eb884e360eeb7ec9a |
parent 213371 | a0c83883d8afda760bd02e534e77696dd905e1ba |
child 213373 | 572ad1e7875268ec045cf0545a1733669785e9c6 |
push id | 27748 |
push user | ryanvm@gmail.com |
push date | Fri, 31 Oct 2014 20:14:33 +0000 |
treeherder | mozilla-central@12ac66e2c016 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | sotaro |
bugs | 1073252 |
milestone | 36.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/widget/gonk/HwcComposer2D.cpp +++ b/widget/gonk/HwcComposer2D.cpp @@ -391,36 +391,40 @@ HwcComposer2D::PrepareLayerList(Layer* a return false; } } return true; } LayerRenderState state = aLayer->GetRenderState(); nsIntSize surfaceSize; + nsIntRect visibleRect = visibleRegion.GetBounds(); if (state.mSurface.get()) { surfaceSize = state.mSize; + // In some cases the visible rect assigned to the layer can be larger + // than the layer's surface, e.g., an ImageLayer with a small Image + // in it. + visibleRect.IntersectRect(visibleRect, + nsIntRect(nsIntPoint(0, 0), surfaceSize)); } else { if (aLayer->AsColorLayer() && mColorFill) { fillColor = true; } else { LOGD("%s Layer doesn't have a gralloc buffer", aLayer->Name()); return false; } } // Buffer rotation is not to be confused with the angled rotation done by a transform matrix // It's a fancy PaintedLayer feature used for scrolling if (state.BufferRotated()) { LOGD("%s Layer has a rotated buffer", aLayer->Name()); return false; } - nsIntRect visibleRect = visibleRegion.GetBounds(); - nsIntRect bufferRect; if (fillColor) { bufferRect = nsIntRect(visibleRect); } else { if(state.mHasOwnOffset) { bufferRect = nsIntRect(state.mOffset.x, state.mOffset.y, state.mSize.width, state.mSize.height); } else { @@ -442,20 +446,21 @@ HwcComposer2D::PrepareLayerList(Layer* a return true; } // 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); + bool isOpaque = opacity == 0xFF && + (state.mFlags & LayerRenderStateFlags::OPAQUE); // Currently we perform opacity calculation using the *bounds* of the layer. // We can only make this assumption if we're not dealing with a complex visible region. - bool isSimpleVisibleRegion = visibleRegion.GetNumRects() == 1; + bool isSimpleVisibleRegion = visibleRegion.Contains(visibleRect); if (current && isOpaque && isSimpleVisibleRegion) { 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 // the current layer. We can ignore them now. mList->numHwLayers = current = 0; mHwcLayerMap.Clear();