diff options
author | 2022-10-14 11:52:44 +0800 | |
---|---|---|
committer | 2022-10-14 11:52:44 +0800 | |
commit | 93f9989edf24475e916db55007d5a6bd57e12ce1 (patch) | |
tree | 7de2fca5eb0c54b11bf2fe187bf31fd5c4dfe1bb | |
parent | 8314a3e51bd31e9c11a9b61e4bef88b2ad65803d (diff) |
Only create clip bound object when RenderNode is not quick rejected
These three objects are only used when we really draw the node, so
don't create them if node has been quick rejected.
Test: TBD
Change-Id: Iae3f7a5d9c49aafd8ce3ede09b4093a2146d6568
-rw-r--r-- | libs/hwui/pipeline/skia/RenderNodeDrawable.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp b/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp index 507d3dcdcde9..9e17b9e6d985 100644 --- a/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp +++ b/libs/hwui/pipeline/skia/RenderNodeDrawable.cpp @@ -224,10 +224,10 @@ void RenderNodeDrawable::drawContent(SkCanvas* canvas) const { // TODO should we let the bound of the drawable do this for us? const SkRect bounds = SkRect::MakeWH(properties.getWidth(), properties.getHeight()); bool quickRejected = properties.getClipToBounds() && canvas->quickReject(bounds); - auto clipBounds = canvas->getLocalClipBounds(); - SkIRect srcBounds = SkIRect::MakeWH(bounds.width(), bounds.height()); - SkIPoint offset = SkIPoint::Make(0.0f, 0.0f); if (!quickRejected) { + auto clipBounds = canvas->getLocalClipBounds(); + SkIRect srcBounds = SkIRect::MakeWH(bounds.width(), bounds.height()); + SkIPoint offset = SkIPoint::Make(0.0f, 0.0f); SkiaDisplayList* displayList = renderNode->getDisplayList().asSkiaDl(); const LayerProperties& layerProperties = properties.layerProperties(); // composing a hardware layer |