Bug 952878 - LayerRenderer.drawBackground can be expensive during a pageload r=wesj

This commit is contained in:
Mark Finkle 2014-01-13 09:03:24 -05:00
parent 28be2ce286
commit 3fa62c5435

View File

@ -64,6 +64,7 @@ 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;
@ -134,6 +135,7 @@ public class LayerRenderer implements Tabs.OnTabsChangedListener {
public LayerRenderer(LayerView view) {
mView = view;
mOverscrollColor = view.getContext().getResources().getColor(R.color.background_normal);
Bitmap scrollbarImage = view.getScrollbarImage();
IntSize size = new IntSize(scrollbarImage.getWidth(), scrollbarImage.getHeight());
@ -587,6 +589,9 @@ 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();