diff options
author | 2016-03-01 13:27:54 -0800 | |
---|---|---|
committer | 2016-03-02 10:29:15 -0800 | |
commit | 678ff81105753656aa4822f4f675ef96dc9d2b83 (patch) | |
tree | 695ff095d9b5c839a51316c9b3f8976682be7d5e /libs/hwui/OpenGLRenderer.cpp | |
parent | 82197c33a23a130acd93dcf54e70138a7e7ba970 (diff) |
Clip projected ripples to outlines
bug:27343928
Also fixes positioning of ripples to a scrolled projection receiver.
Change-Id: I74b7233c46d7c15839ca8bf50e188ba6646d7432
Diffstat (limited to 'libs/hwui/OpenGLRenderer.cpp')
-rw-r--r-- | libs/hwui/OpenGLRenderer.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libs/hwui/OpenGLRenderer.cpp b/libs/hwui/OpenGLRenderer.cpp index b7a5923cdd65..7693fdcbe817 100644 --- a/libs/hwui/OpenGLRenderer.cpp +++ b/libs/hwui/OpenGLRenderer.cpp @@ -1148,7 +1148,9 @@ bool OpenGLRenderer::storeDisplayState(DeferredDisplayState& state, int stateDef // always store/restore, since these are just pointers state.mRoundRectClipState = currentSnapshot()->roundRectClipState; +#if !HWUI_NEW_OPS state.mProjectionPathMask = currentSnapshot()->projectionPathMask; +#endif return false; } @@ -1156,7 +1158,9 @@ void OpenGLRenderer::restoreDisplayState(const DeferredDisplayState& state, bool setGlobalMatrix(state.mMatrix); writableSnapshot()->alpha = state.mAlpha; writableSnapshot()->roundRectClipState = state.mRoundRectClipState; +#if !HWUI_NEW_OPS writableSnapshot()->projectionPathMask = state.mProjectionPathMask; +#endif if (state.mClipValid && !skipClipRestore) { writableSnapshot()->setClip(state.mClip.left, state.mClip.top, @@ -1833,6 +1837,7 @@ void OpenGLRenderer::drawCircle(float x, float y, float radius, const SkPaint* p path.addCircle(x, y, radius); } +#if !HWUI_NEW_OPS if (CC_UNLIKELY(currentSnapshot()->projectionPathMask != nullptr)) { // mask ripples with projection mask SkPath maskPath = *(currentSnapshot()->projectionPathMask->projectionMask); @@ -1852,6 +1857,7 @@ void OpenGLRenderer::drawCircle(float x, float y, float radius, const SkPaint* p // in local space. Note that this can create CCW paths. Op(path, maskPath, kIntersect_SkPathOp, &path); } +#endif drawConvexPath(path, p); } |