diff options
author | Romain Guy <romainguy@google.com> | 2011-01-14 20:04:42 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-01-14 20:04:42 -0800 |
commit | 2e7fbd97e6f3682b20631d4f5262321dba6e2c6f (patch) | |
tree | a2b97c84bcc3a80499188fafda9e657256448e64 /libs/hwui/OpenGLRenderer.cpp | |
parent | fd7a411aef7e1c7722456de09b3f3234bbb914d4 (diff) | |
parent | 1bd1bad0b4a75e633c5edbe802bf6fb4dd765161 (diff) | |
download | frameworks_base-2e7fbd97e6f3682b20631d4f5262321dba6e2c6f.zip frameworks_base-2e7fbd97e6f3682b20631d4f5262321dba6e2c6f.tar.gz frameworks_base-2e7fbd97e6f3682b20631d4f5262321dba6e2c6f.tar.bz2 |
Merge "Preapre region tracking in layers" into honeycomb
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 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 |