diff options
author | 2011-01-14 20:07:20 -0800 | |
---|---|---|
committer | 2011-01-14 20:07:20 -0800 | |
commit | 1bd1bad0b4a75e633c5edbe802bf6fb4dd765161 (patch) | |
tree | ec6c62135677673e47741385c63ba082d1326fca /libs/hwui/OpenGLRenderer.cpp | |
parent | 739e34a362518020b4aed3f2dc54be2154c41406 (diff) |
Preapre region tracking in layers
Change-Id: Ied1fa0d36c99ef4e33cb8fde7e3106a793db3a4c
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
-rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index f00557386bce..b9332327df99 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 |