Loading libs/hwui/DisplayListRenderer.cpp +2 −1 Original line number Original line Diff line number Diff line Loading @@ -296,7 +296,8 @@ void DisplayList::output(OpenGLRenderer& renderer, uint32_t level) { indent[i] = ' '; indent[i] = ' '; } } indent[count] = '\0'; indent[count] = '\0'; ALOGD("%sStart display list (%p, %s)", (char*) indent + 2, this, mName.string()); ALOGD("%sStart display list (%p, %s, render=%d)", (char*) indent + 2, this, mName.string(), isRenderable()); ALOGD("%s%s %d", indent, "Save", SkCanvas::kMatrix_SaveFlag | SkCanvas::kClip_SaveFlag); ALOGD("%s%s %d", indent, "Save", SkCanvas::kMatrix_SaveFlag | SkCanvas::kClip_SaveFlag); int saveCount = renderer.getSaveCount() - 1; int saveCount = renderer.getSaveCount() - 1; Loading libs/hwui/OpenGLRenderer.cpp +16 −9 Original line number Original line Diff line number Diff line Loading @@ -176,14 +176,26 @@ void OpenGLRenderer::prepareDirty(float left, float top, float right, float bott mSnapshot->fbo = getTargetFbo(); mSnapshot->fbo = getTargetFbo(); mSaveCount = 1; mSaveCount = 1; glViewport(0, 0, mWidth, mHeight); mCaches.setScissor(left, mSnapshot->height - bottom, right - left, bottom - top); mSnapshot->setClip(left, top, right, bottom); mSnapshot->setClip(left, top, right, bottom); mDirtyClip = false; mDirtyClip = opaque; syncState(); if (!opaque) { if (!opaque) { mCaches.setScissor(left, mSnapshot->height - bottom, right - left, bottom - top); glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT); } else { mCaches.resetScissor(); } } void OpenGLRenderer::syncState() { glViewport(0, 0, mWidth, mHeight); if (mCaches.blend) { glEnable(GL_BLEND); } else { glDisable(GL_BLEND); } } } } Loading Loading @@ -290,11 +302,6 @@ status_t OpenGLRenderer::invokeFunctors(Rect& dirty) { } } } } // Restore state possibly changed by the functors in process mode GLboolean value; glGetBooleanv(GL_BLEND, &value); mCaches.blend = value; mCaches.activeTexture(0); mCaches.activeTexture(0); return result; return result; Loading libs/hwui/OpenGLRenderer.h +6 −0 Original line number Original line Diff line number Diff line Loading @@ -214,6 +214,12 @@ protected: void drawTextureLayer(Layer* layer, const Rect& rect); void drawTextureLayer(Layer* layer, const Rect& rect); private: private: /** * Ensures the state of the renderer is the same as the state of * the GL context. */ void syncState(); /** /** * Saves the current state of the renderer as a new snapshot. * Saves the current state of the renderer as a new snapshot. * The new snapshot is saved in mSnapshot and the previous snapshot * The new snapshot is saved in mSnapshot and the previous snapshot Loading Loading
libs/hwui/DisplayListRenderer.cpp +2 −1 Original line number Original line Diff line number Diff line Loading @@ -296,7 +296,8 @@ void DisplayList::output(OpenGLRenderer& renderer, uint32_t level) { indent[i] = ' '; indent[i] = ' '; } } indent[count] = '\0'; indent[count] = '\0'; ALOGD("%sStart display list (%p, %s)", (char*) indent + 2, this, mName.string()); ALOGD("%sStart display list (%p, %s, render=%d)", (char*) indent + 2, this, mName.string(), isRenderable()); ALOGD("%s%s %d", indent, "Save", SkCanvas::kMatrix_SaveFlag | SkCanvas::kClip_SaveFlag); ALOGD("%s%s %d", indent, "Save", SkCanvas::kMatrix_SaveFlag | SkCanvas::kClip_SaveFlag); int saveCount = renderer.getSaveCount() - 1; int saveCount = renderer.getSaveCount() - 1; Loading
libs/hwui/OpenGLRenderer.cpp +16 −9 Original line number Original line Diff line number Diff line Loading @@ -176,14 +176,26 @@ void OpenGLRenderer::prepareDirty(float left, float top, float right, float bott mSnapshot->fbo = getTargetFbo(); mSnapshot->fbo = getTargetFbo(); mSaveCount = 1; mSaveCount = 1; glViewport(0, 0, mWidth, mHeight); mCaches.setScissor(left, mSnapshot->height - bottom, right - left, bottom - top); mSnapshot->setClip(left, top, right, bottom); mSnapshot->setClip(left, top, right, bottom); mDirtyClip = false; mDirtyClip = opaque; syncState(); if (!opaque) { if (!opaque) { mCaches.setScissor(left, mSnapshot->height - bottom, right - left, bottom - top); glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT); } else { mCaches.resetScissor(); } } void OpenGLRenderer::syncState() { glViewport(0, 0, mWidth, mHeight); if (mCaches.blend) { glEnable(GL_BLEND); } else { glDisable(GL_BLEND); } } } } Loading Loading @@ -290,11 +302,6 @@ status_t OpenGLRenderer::invokeFunctors(Rect& dirty) { } } } } // Restore state possibly changed by the functors in process mode GLboolean value; glGetBooleanv(GL_BLEND, &value); mCaches.blend = value; mCaches.activeTexture(0); mCaches.activeTexture(0); return result; return result; Loading
libs/hwui/OpenGLRenderer.h +6 −0 Original line number Original line Diff line number Diff line Loading @@ -214,6 +214,12 @@ protected: void drawTextureLayer(Layer* layer, const Rect& rect); void drawTextureLayer(Layer* layer, const Rect& rect); private: private: /** * Ensures the state of the renderer is the same as the state of * the GL context. */ void syncState(); /** /** * Saves the current state of the renderer as a new snapshot. * Saves the current state of the renderer as a new snapshot. * The new snapshot is saved in mSnapshot and the previous snapshot * The new snapshot is saved in mSnapshot and the previous snapshot Loading