diff options
-rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 26 | ||||
-rw-r--r-- | libs/hwui/OpenGLRenderer.h | 2 |
2 files changed, 15 insertions, 13 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index f005573..b933232 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -697,13 +697,7 @@ void OpenGLRenderer::dirtyLayer(const float left, const float top, if ((mSnapshot->flags & Snapshot::kFlagFboTarget) && mSnapshot->region) { Rect bounds(left, top, right, bottom); transform.mapRect(bounds); - if (bounds.intersect(*mSnapshot->clipRect)) { - bounds.snapToPixelBoundaries(); - android::Rect dirty(bounds.left, bounds.top, bounds.right, bounds.bottom); - if (!dirty.isEmpty()) { - mSnapshot->region->orSelf(dirty); - } - } + dirtyLayerUnchecked(bounds, mSnapshot->region); } #endif } @@ -713,12 +707,18 @@ void OpenGLRenderer::dirtyLayer(const float left, const float top, #if RENDER_LAYERS_AS_REGIONS if ((mSnapshot->flags & Snapshot::kFlagFboTarget) && mSnapshot->region) { Rect bounds(left, top, right, bottom); - if (bounds.intersect(*mSnapshot->clipRect)) { - bounds.snapToPixelBoundaries(); - android::Rect dirty(bounds.left, bounds.top, bounds.right, bounds.bottom); - if (!dirty.isEmpty()) { - mSnapshot->region->orSelf(dirty); - } + dirtyLayerUnchecked(bounds, mSnapshot->region); + } +#endif +} + +void OpenGLRenderer::dirtyLayerUnchecked(Rect& bounds, Region* region) { +#if RENDER_LAYERS_AS_REGIONS + if (bounds.intersect(*mSnapshot->clipRect)) { + bounds.snapToPixelBoundaries(); + android::Rect dirty(bounds.left, bounds.top, bounds.right, bounds.bottom); + if (!dirty.isEmpty()) { + region->orSelf(dirty); } } #endif diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h index 8cec8f1..56be134 100644 --- a/libs/hwui/OpenGLRenderer.h +++ b/libs/hwui/OpenGLRenderer.h @@ -145,6 +145,8 @@ protected: virtual void dirtyLayer(const float left, const float top, const float right, const float bottom); + void dirtyLayerUnchecked(Rect& bounds, Region* region); + private: /** * Saves the current state of the renderer as a new snapshot. |