mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-13 15:34:01 +00:00
Bug 952878 - Eliminate shadow layer. r=kats
This commit is contained in:
parent
2f127293ba
commit
2a4246c9e1
@ -55,7 +55,6 @@ public class LayerRenderer implements Tabs.OnTabsChangedListener {
|
||||
private static final int NANOS_PER_SECOND = 1000000000;
|
||||
|
||||
private final LayerView mView;
|
||||
private final NinePatchTileLayer mShadowLayer;
|
||||
private TextLayer mFrameRateLayer;
|
||||
private final ScrollbarLayer mHorizScrollLayer;
|
||||
private final ScrollbarLayer mVertScrollLayer;
|
||||
@ -65,7 +64,6 @@ public class LayerRenderer implements Tabs.OnTabsChangedListener {
|
||||
private RenderContext mLastPageContext;
|
||||
private int mMaxTextureSize;
|
||||
private int mBackgroundColor;
|
||||
private int mOverscrollColor;
|
||||
|
||||
private long mLastFrameTime;
|
||||
private final CopyOnWriteArrayList<RenderTask> mTasks;
|
||||
@ -136,10 +134,6 @@ public class LayerRenderer implements Tabs.OnTabsChangedListener {
|
||||
|
||||
public LayerRenderer(LayerView view) {
|
||||
mView = view;
|
||||
mOverscrollColor = view.getContext().getResources().getColor(R.color.background_normal);
|
||||
|
||||
CairoImage shadowImage = new BufferedCairoImage(view.getShadowPattern());
|
||||
mShadowLayer = new NinePatchTileLayer(shadowImage);
|
||||
|
||||
Bitmap scrollbarImage = view.getScrollbarImage();
|
||||
IntSize size = new IntSize(scrollbarImage.getWidth(), scrollbarImage.getHeight());
|
||||
@ -186,7 +180,6 @@ public class LayerRenderer implements Tabs.OnTabsChangedListener {
|
||||
DirectBufferAllocator.free(mCoordByteBuffer);
|
||||
mCoordByteBuffer = null;
|
||||
mCoordBuffer = null;
|
||||
mShadowLayer.destroy();
|
||||
mHorizScrollLayer.destroy();
|
||||
mVertScrollLayer.destroy();
|
||||
if (mFrameRateLayer != null) {
|
||||
@ -518,14 +511,22 @@ public class LayerRenderer implements Tabs.OnTabsChangedListener {
|
||||
mLastPageContext = mPageContext;
|
||||
|
||||
/* Update layers. */
|
||||
if (rootLayer != null) mUpdated &= rootLayer.update(mPageContext); // called on compositor thread
|
||||
mUpdated &= mShadowLayer.update(mPageContext); // called on compositor thread
|
||||
if (mFrameRateLayer != null) mUpdated &= mFrameRateLayer.update(mScreenContext); // called on compositor thread
|
||||
if (rootLayer != null) {
|
||||
// Called on compositor thread.
|
||||
mUpdated &= rootLayer.update(mPageContext);
|
||||
}
|
||||
|
||||
if (mFrameRateLayer != null) {
|
||||
// Called on compositor thread.
|
||||
mUpdated &= mFrameRateLayer.update(mScreenContext);
|
||||
}
|
||||
|
||||
mUpdated &= mVertScrollLayer.update(mPageContext); // called on compositor thread
|
||||
mUpdated &= mHorizScrollLayer.update(mPageContext); // called on compositor thread
|
||||
|
||||
for (Layer layer : mExtraLayers)
|
||||
for (Layer layer : mExtraLayers) {
|
||||
mUpdated &= layer.update(mPageContext); // called on compositor thread
|
||||
}
|
||||
}
|
||||
|
||||
/** Retrieves the bounds for the layer, rounded in such a way that it
|
||||
@ -586,9 +587,6 @@ public class LayerRenderer implements Tabs.OnTabsChangedListener {
|
||||
|
||||
GLES20.glDisable(GLES20.GL_SCISSOR_TEST);
|
||||
|
||||
// Draw the overscroll background area as a solid color
|
||||
clear(mOverscrollColor);
|
||||
|
||||
// Update background color.
|
||||
mBackgroundColor = mView.getBackgroundColor();
|
||||
|
||||
@ -596,12 +594,6 @@ public class LayerRenderer implements Tabs.OnTabsChangedListener {
|
||||
setScissorRect();
|
||||
clear(mBackgroundColor);
|
||||
GLES20.glDisable(GLES20.GL_SCISSOR_TEST);
|
||||
|
||||
// Draw the drop shadow, if we need to.
|
||||
RectF offsetAbsPageRect = new RectF(mAbsolutePageRect);
|
||||
offsetAbsPageRect.offset(mRenderOffset.x, mRenderOffset.y);
|
||||
if (!offsetAbsPageRect.contains(mFrameMetrics.getViewport()))
|
||||
mShadowLayer.draw(mPageContext);
|
||||
}
|
||||
|
||||
// Draws the layer the client added to us.
|
||||
|
@ -500,10 +500,6 @@ public class LayerView extends FrameLayout implements Tabs.OnTabsChangedListener
|
||||
return BitmapUtils.decodeResource(context, resId, options);
|
||||
}
|
||||
|
||||
Bitmap getShadowPattern() {
|
||||
return getDrawable("shadow");
|
||||
}
|
||||
|
||||
Bitmap getScrollbarImage() {
|
||||
return getDrawable("scrollbar");
|
||||
}
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 881 B |
Loading…
x
Reference in New Issue
Block a user