diff options
author | Chris Craik <ccraik@google.com> | 2013-07-30 19:05:20 -0700 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2013-08-02 11:29:22 -0700 |
commit | 5e49b307eb99269db2db257760508b8efd7bb97d (patch) | |
tree | 18c9f02b947e99fe8aa5b27074725b11fc6df2ba /libs/hwui/OpenGLRenderer.h | |
parent | cb9accefb19ba6ae6fd449dc9ab62e972b51335c (diff) | |
download | frameworks_base-5e49b307eb99269db2db257760508b8efd7bb97d.zip frameworks_base-5e49b307eb99269db2db257760508b8efd7bb97d.tar.gz frameworks_base-5e49b307eb99269db2db257760508b8efd7bb97d.tar.bz2 |
Fix quickReject's handling of AA ramp geometry
By having quickReject round out the window-space geometry bounds, we
prevent the AA perimeter (which falls outside the local bounds passed
in) from drawing outside the clip.
Change-Id: I8ee36be9039a9c47906815ee2f0dbaa5eb910b82
Diffstat (limited to 'libs/hwui/OpenGLRenderer.h')
-rw-r--r-- | libs/hwui/OpenGLRenderer.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/libs/hwui/OpenGLRenderer.h b/libs/hwui/OpenGLRenderer.h index eb42540..2f8a2f0 100644 --- a/libs/hwui/OpenGLRenderer.h +++ b/libs/hwui/OpenGLRenderer.h @@ -256,14 +256,15 @@ public: ANDROID_API const Rect& getClipBounds(); /** - * Performs a quick reject but adjust the bounds to account for stroke width if necessary + * Performs a quick reject but adjust the bounds to account for stroke width if necessary, + * and handling snapOut for AA geometry. */ bool quickRejectPreStroke(float left, float top, float right, float bottom, SkPaint* paint); /** * Returns false and sets scissor based upon bounds if drawing won't be clipped out */ - bool quickReject(float left, float top, float right, float bottom); + bool quickReject(float left, float top, float right, float bottom, bool snapOut = false); bool quickReject(const Rect& bounds) { return quickReject(bounds.left, bounds.top, bounds.right, bounds.bottom); } @@ -273,7 +274,7 @@ public: * clipRequired will be only set if not rejected */ ANDROID_API bool quickRejectNoScissor(float left, float top, float right, float bottom, - bool* clipRequired = NULL); + bool snapOut = false, bool* clipRequired = NULL); bool quickRejectNoScissor(const Rect& bounds, bool* clipRequired = NULL) { return quickRejectNoScissor(bounds.left, bounds.top, bounds.right, bounds.bottom, clipRequired); @@ -340,6 +341,12 @@ public: SkPaint* filterPaint(SkPaint* paint); + /** + * Store the current display state (most importantly, the current clip and transform), and + * additionally map the state's bounds from local to window coordinates. + * + * Returns true if quick-rejected + */ bool storeDisplayState(DeferredDisplayState& state, int stateDeferFlags); void restoreDisplayState(const DeferredDisplayState& state, bool skipClipRestore = false); void setupMergedMultiDraw(const Rect* clipRect); |