diff options
author | Chris Craik <ccraik@google.com> | 2014-12-02 01:33:28 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-12-02 01:33:28 +0000 |
commit | 9a04480e36c42eb63d1d727221ba3ce6a6d533ef (patch) | |
tree | f5f52bb553e09a32f88a69cc3a5fa95ecfb0c983 /libs | |
parent | 8ea0d19fe2522ceaf5f09808b7835deb9e53c88a (diff) | |
parent | ef124887c616d03cf0a689d2b7d5b1894405d12e (diff) | |
download | frameworks_base-9a04480e36c42eb63d1d727221ba3ce6a6d533ef.zip frameworks_base-9a04480e36c42eb63d1d727221ba3ce6a6d533ef.tar.gz frameworks_base-9a04480e36c42eb63d1d727221ba3ce6a6d533ef.tar.bz2 |
am ef124887: Merge "Clip outline to View clip bounds for shadow computation" into lmp-mr1-dev
* commit 'ef124887c616d03cf0a689d2b7d5b1894405d12e':
Clip outline to View clip bounds for shadow computation
Diffstat (limited to 'libs')
-rw-r--r-- | libs/hwui/RenderNode.cpp | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp index bbba2dd..810e487 100644 --- a/libs/hwui/RenderNode.cpp +++ b/libs/hwui/RenderNode.cpp @@ -680,13 +680,32 @@ void RenderNode::issueDrawShadowOperation(const Matrix4& transformFromParent, T& float casterAlpha = properties().getAlpha() * properties().getOutline().getAlpha(); + + // holds temporary SkPath to store the result of intersections + SkPath* frameAllocatedPath = NULL; const SkPath* outlinePath = casterOutlinePath; + + // intersect the outline with the reveal clip, if present if (revealClipPath) { - // if we can't simply use the caster's path directly, create a temporary one - SkPath* frameAllocatedPath = handler.allocPathForFrame(); + frameAllocatedPath = handler.allocPathForFrame(); + + Op(*outlinePath, *revealClipPath, kIntersect_PathOp, frameAllocatedPath); + outlinePath = frameAllocatedPath; + } + + // intersect the outline with the clipBounds, if present + if (properties().getClippingFlags() & CLIP_TO_CLIP_BOUNDS) { + if (!frameAllocatedPath) { + frameAllocatedPath = handler.allocPathForFrame(); + } + + Rect clipBounds; + properties().getClippingRectForFlags(CLIP_TO_CLIP_BOUNDS, &clipBounds); + SkPath clipBoundsPath; + clipBoundsPath.addRect(clipBounds.left, clipBounds.top, + clipBounds.right, clipBounds.bottom); - // intersect the outline with the convex reveal clip - Op(*casterOutlinePath, *revealClipPath, kIntersect_PathOp, frameAllocatedPath); + Op(*outlinePath, clipBoundsPath, kIntersect_PathOp, frameAllocatedPath); outlinePath = frameAllocatedPath; } |