diff options
| author | 2015-05-28 22:03:06 +0000 | |
|---|---|---|
| committer | 2015-05-28 22:03:08 +0000 | |
| commit | 1cd7e4c3d0216cfb9a8a685ca8cf6f0d740a9dff (patch) | |
| tree | 2ae1662b8d6a4ff711e6ce621e690e4f6204c0f1 /libs/hwui/RenderNode.cpp | |
| parent | 5cd795a9094eb02c983751ecabca6f24b0a01c58 (diff) | |
| parent | fca52b7583d1e5f5ff8ed06554875d2a30ef56fa (diff) | |
Merge "Use path intersection instead of saveLayer+mesh to mask projected ripples" into mnc-dev
Diffstat (limited to 'libs/hwui/RenderNode.cpp')
| -rw-r--r-- | libs/hwui/RenderNode.cpp | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp index 9e5ec28ac11a..7d3b41e009a6 100644 --- a/libs/hwui/RenderNode.cpp +++ b/libs/hwui/RenderNode.cpp @@ -769,31 +769,9 @@ void RenderNode::issueOperationsOfProjectedChildren(OpenGLRenderer& renderer, T& const RenderProperties& backgroundProps = backgroundOp->mRenderNode->properties(); renderer.translate(backgroundProps.getTranslationX(), backgroundProps.getTranslationY()); - // If the projection reciever has an outline, we mask each of the projected rendernodes to it - // Either with clipRect, or special saveLayer masking - if (projectionReceiverOutline != nullptr) { - const SkRect& outlineBounds = projectionReceiverOutline->getBounds(); - if (projectionReceiverOutline->isRect(nullptr)) { - // mask to the rect outline simply with clipRect - ClipRectOp* clipOp = new (alloc) ClipRectOp( - outlineBounds.left(), outlineBounds.top(), - outlineBounds.right(), outlineBounds.bottom(), SkRegion::kIntersect_Op); - handler(clipOp, PROPERTY_SAVECOUNT, properties().getClipToBounds()); - } else { - // wrap the projected RenderNodes with a SaveLayer that will mask to the outline - SaveLayerOp* op = new (alloc) SaveLayerOp( - outlineBounds.left(), outlineBounds.top(), - outlineBounds.right(), outlineBounds.bottom(), - 255, SkCanvas::kMatrix_SaveFlag | SkCanvas::kClip_SaveFlag | SkCanvas::kARGB_ClipLayer_SaveFlag); - op->setMask(projectionReceiverOutline); - handler(op, PROPERTY_SAVECOUNT, properties().getClipToBounds()); - - /* TODO: add optimizations here to take advantage of placement/size of projected - * children (which may shrink saveLayer area significantly). This is dependent on - * passing actual drawing/dirtying bounds of projected content down to native. - */ - } - } + // If the projection reciever has an outline, we mask projected content to it + // (which we know, apriori, are all tessellated paths) + renderer.setProjectionPathMask(alloc, projectionReceiverOutline); // draw projected nodes for (size_t i = 0; i < mProjectedNodes.size(); i++) { @@ -808,10 +786,8 @@ void RenderNode::issueOperationsOfProjectedChildren(OpenGLRenderer& renderer, T& renderer.restoreToCount(restoreTo); } - if (projectionReceiverOutline != nullptr) { - handler(new (alloc) RestoreToCountOp(restoreTo), - PROPERTY_SAVECOUNT, properties().getClipToBounds()); - } + handler(new (alloc) RestoreToCountOp(restoreTo), + PROPERTY_SAVECOUNT, properties().getClipToBounds()); } /** |