diff options
-rw-r--r-- | libs/hwui/DisplayList.cpp | 6 | ||||
-rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 12 | ||||
-rw-r--r-- | libs/hwui/OpenGLRenderer.h | 2 | ||||
-rw-r--r-- | libs/hwui/Snapshot.cpp | 11 | ||||
-rw-r--r-- | libs/hwui/Snapshot.h | 2 |
5 files changed, 23 insertions, 10 deletions
diff --git a/libs/hwui/DisplayList.cpp b/libs/hwui/DisplayList.cpp index 55ddd17..d985ad0 100644 --- a/libs/hwui/DisplayList.cpp +++ b/libs/hwui/DisplayList.cpp @@ -351,9 +351,9 @@ void DisplayList::outputViewProperties(const int level) { level * 2, "", mTransformMatrix, MATRIX_ARGS(mTransformMatrix)); } } - if (mAlpha < 1 && !mCaching) { - if (!mHasOverlappingRendering) { - ALOGD("%*sSetAlpha %.2f", level * 2, "", mAlpha); + if (mAlpha < 1) { + if (mCaching || !mHasOverlappingRendering) { + ALOGD("%*sScaleAlpha %.2f", level * 2, "", mAlpha); } else { int flags = SkCanvas::kHasAlphaLayer_SaveFlag; if (mClipChildren) { diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index bc28d65..2cf7183 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -193,6 +193,7 @@ status_t OpenGLRenderer::prepareDirty(float left, float top, mSaveCount = 1; mSnapshot->setClip(left, top, right, bottom); + mTilingClip.set(left, top, right, bottom); mDirtyClip = true; updateLayers(); @@ -206,8 +207,7 @@ status_t OpenGLRenderer::prepareDirty(float left, float top, // invoked during the frame mSuppressTiling = mCaches.hasRegisteredFunctors(); - mTilingSnapshot = mSnapshot; - startTiling(mTilingSnapshot, true); + startTiling(mSnapshot, true); debugOverdraw(true, true); @@ -252,9 +252,9 @@ void OpenGLRenderer::syncState() { void OpenGLRenderer::startTiling(const sp<Snapshot>& s, bool opaque) { if (!mSuppressTiling) { - Rect* clip = mTilingSnapshot->clipRect; + Rect* clip = &mTilingClip; if (s->flags & Snapshot::kFlagFboTarget) { - clip = &s->layer->clipRect; + clip = &(s->layer->clipRect); } startTiling(*clip, s->height, opaque); @@ -480,10 +480,10 @@ void OpenGLRenderer::debugOverdraw(bool enable, bool clear) { void OpenGLRenderer::renderOverdraw() { if (mCaches.debugOverdraw && getTargetFbo() == 0) { - const Rect* clip = mTilingSnapshot->clipRect; + const Rect* clip = &mTilingClip; mCaches.enableScissor(); - mCaches.setScissor(clip->left, mTilingSnapshot->height - clip->bottom, + mCaches.setScissor(clip->left, mFirstSnapshot->height - clip->bottom, clip->right - clip->left, clip->bottom - clip->top); mCaches.stencil.enableDebugTest(2); diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h index 71bd6bb..7bb9395 100644 --- a/libs/hwui/OpenGLRenderer.h +++ b/libs/hwui/OpenGLRenderer.h @@ -947,7 +947,7 @@ private: // Current state sp<Snapshot> mSnapshot; // State used to define the clipping region - sp<Snapshot> mTilingSnapshot; + Rect mTilingClip; // Used to draw textured quads TextureVertex mMeshVertices[4]; diff --git a/libs/hwui/Snapshot.cpp b/libs/hwui/Snapshot.cpp index 923913e..d26ee38 100644 --- a/libs/hwui/Snapshot.cpp +++ b/libs/hwui/Snapshot.cpp @@ -14,6 +14,8 @@ * limitations under the License. */ +#define LOG_TAG "OpenGLRenderer" + #include "Snapshot.h" #include <SkCanvas.h> @@ -199,5 +201,14 @@ bool Snapshot::isIgnored() const { return invisible || empty; } +void Snapshot::dump() const { + ALOGD("Snapshot %p, flags %x, prev %p, height %d, ignored %d, hasComplexClip %d", + this, flags, previous.get(), height, isIgnored(), clipRegion && !clipRegion->isEmpty()); + ALOGD(" ClipRect (at %p) %.1f %.1f %.1f %.1f", + clipRect, clipRect->left, clipRect->top, clipRect->right, clipRect->bottom); + ALOGD(" Transform (at %p):", transform); + transform->dump(); +} + }; // namespace uirenderer }; // namespace android diff --git a/libs/hwui/Snapshot.h b/libs/hwui/Snapshot.h index ffd4729..cc6d0cd 100644 --- a/libs/hwui/Snapshot.h +++ b/libs/hwui/Snapshot.h @@ -228,6 +228,8 @@ public: */ float alpha; + void dump() const; + private: void ensureClipRegion(); void copyClipRectFromRegion(); |