Loading core/java/android/view/View.java +2 −2 Original line number Diff line number Diff line Loading @@ -8125,11 +8125,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility // TODO: We should pass the dirty rect canvas.onPreDraw(null); final int restoreCount = canvas.save(); computeScroll(); canvas.translate(-mScrollX, -mScrollY); final int restoreCount = canvas.save(); mPrivateFlags |= DRAWN | DRAWING_CACHE_VALID; // Fast path for layouts with no backgrounds Loading libs/hwui/LayerRenderer.cpp +13 −9 Original line number Diff line number Diff line Loading @@ -99,11 +99,13 @@ void LayerRenderer::generateMesh() { mLayer->meshIndices = NULL; } bool rebuildIndices = false; if (!mLayer->mesh) { mLayer->mesh = new TextureVertex[count * 4]; mLayer->meshIndices = new uint16_t[elementCount]; mLayer->meshElementCount = elementCount; rebuildIndices = true; } mLayer->meshElementCount = elementCount; const float texX = 1.0f / float(mLayer->width); const float texY = 1.0f / float(mLayer->height); Loading @@ -125,6 +127,7 @@ void LayerRenderer::generateMesh() { TextureVertex::set(mesh++, r->left, r->bottom, u1, v2); TextureVertex::set(mesh++, r->right, r->bottom, u2, v2); if (rebuildIndices) { uint16_t quad = i * 4; int index = i * 6; indices[index ] = quad; // top-left Loading @@ -134,6 +137,7 @@ void LayerRenderer::generateMesh() { indices[index + 4] = quad + 1; // top-right indices[index + 5] = quad + 3; // bottom-right } } #endif } Loading libs/hwui/OpenGLRenderer.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -1613,10 +1613,12 @@ void OpenGLRenderer::drawLayer(Layer* layer, float x, float y, SkPaint* paint) { setupDrawColorFilter(); setupDrawBlending(layer->blend || layer->alpha < 255, layer->mode, false); setupDrawProgram(); setupDrawDirtyRegionsDisabled(); setupDrawPureColorUniforms(); setupDrawColorFilterUniforms(); setupDrawTexture(layer->texture); // TODO: The current layer, if any, will be dirtied with the bounding box // of the layer we are drawing. Since the layer we are drawing has // a mesh, we know the dirty region, we should use it instead setupDrawModelViewTranslate(rect.left, rect.top, rect.right, rect.bottom); setupDrawMesh(&layer->mesh[0].position[0], &layer->mesh[0].texture[0]); Loading Loading
core/java/android/view/View.java +2 −2 Original line number Diff line number Diff line Loading @@ -8125,11 +8125,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback, Accessibility // TODO: We should pass the dirty rect canvas.onPreDraw(null); final int restoreCount = canvas.save(); computeScroll(); canvas.translate(-mScrollX, -mScrollY); final int restoreCount = canvas.save(); mPrivateFlags |= DRAWN | DRAWING_CACHE_VALID; // Fast path for layouts with no backgrounds Loading
libs/hwui/LayerRenderer.cpp +13 −9 Original line number Diff line number Diff line Loading @@ -99,11 +99,13 @@ void LayerRenderer::generateMesh() { mLayer->meshIndices = NULL; } bool rebuildIndices = false; if (!mLayer->mesh) { mLayer->mesh = new TextureVertex[count * 4]; mLayer->meshIndices = new uint16_t[elementCount]; mLayer->meshElementCount = elementCount; rebuildIndices = true; } mLayer->meshElementCount = elementCount; const float texX = 1.0f / float(mLayer->width); const float texY = 1.0f / float(mLayer->height); Loading @@ -125,6 +127,7 @@ void LayerRenderer::generateMesh() { TextureVertex::set(mesh++, r->left, r->bottom, u1, v2); TextureVertex::set(mesh++, r->right, r->bottom, u2, v2); if (rebuildIndices) { uint16_t quad = i * 4; int index = i * 6; indices[index ] = quad; // top-left Loading @@ -134,6 +137,7 @@ void LayerRenderer::generateMesh() { indices[index + 4] = quad + 1; // top-right indices[index + 5] = quad + 3; // bottom-right } } #endif } Loading
libs/hwui/OpenGLRenderer.cpp +3 −1 Original line number Diff line number Diff line Loading @@ -1613,10 +1613,12 @@ void OpenGLRenderer::drawLayer(Layer* layer, float x, float y, SkPaint* paint) { setupDrawColorFilter(); setupDrawBlending(layer->blend || layer->alpha < 255, layer->mode, false); setupDrawProgram(); setupDrawDirtyRegionsDisabled(); setupDrawPureColorUniforms(); setupDrawColorFilterUniforms(); setupDrawTexture(layer->texture); // TODO: The current layer, if any, will be dirtied with the bounding box // of the layer we are drawing. Since the layer we are drawing has // a mesh, we know the dirty region, we should use it instead setupDrawModelViewTranslate(rect.left, rect.top, rect.right, rect.bottom); setupDrawMesh(&layer->mesh[0].position[0], &layer->mesh[0].texture[0]); Loading