diff options
author | Xin Li <delphij@google.com> | 2020-08-31 21:21:38 -0700 |
---|---|---|
committer | Xin Li <delphij@google.com> | 2020-08-31 21:21:38 -0700 |
commit | 628590d7ec80e10a3fc24b1c18a1afb55cca10a8 (patch) | |
tree | 4b1c3f52d86d7fb53afbe9e9438468588fa489f8 /libs/hwui/pipeline/skia/SkiaDisplayList.cpp | |
parent | b11b8ec3aec8bb42f2c07e1c5ac7942da293baa8 (diff) | |
parent | d2d3a20624d968199353ccf6ddbae6f3ac39c9af (diff) |
Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: I3d92a6de21a938f6b352ec26dc23420c0fe02b27
Change-Id: Ifdb80563ef042738778ebb8a7581a97c4e3d96e2
Diffstat (limited to 'libs/hwui/pipeline/skia/SkiaDisplayList.cpp')
-rw-r--r-- | libs/hwui/pipeline/skia/SkiaDisplayList.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/libs/hwui/pipeline/skia/SkiaDisplayList.cpp b/libs/hwui/pipeline/skia/SkiaDisplayList.cpp index 41bcfc25f5c1..158c3493a90c 100644 --- a/libs/hwui/pipeline/skia/SkiaDisplayList.cpp +++ b/libs/hwui/pipeline/skia/SkiaDisplayList.cpp @@ -15,11 +15,18 @@ */ #include "SkiaDisplayList.h" +#include "FunctorDrawable.h" #include "DumpOpsCanvas.h" +#ifdef __ANDROID__ // Layoutlib does not support SkiaPipeline #include "SkiaPipeline.h" +#else +#include "DamageAccumulator.h" +#endif #include "VectorDrawable.h" +#ifdef __ANDROID__ #include "renderthread/CanvasContext.h" +#endif #include <SkImagePriv.h> #include <SkPathOps.h> @@ -81,6 +88,7 @@ bool SkiaDisplayList::prepareListAndChildren( // If the prepare tree is triggered by the UI thread and no previous call to // pinImages has failed then we must pin all mutable images in the GPU cache // until the next UI thread draw. +#ifdef __ANDROID__ // Layoutlib does not support CanvasContext if (info.prepareTextures && !info.canvasContext.pinImages(mMutableImages)) { // In the event that pinning failed we prevent future pinImage calls for the // remainder of this tree traversal and also unpin any currently pinned images @@ -88,6 +96,7 @@ bool SkiaDisplayList::prepareListAndChildren( info.prepareTextures = false; info.canvasContext.unpinImages(); } +#endif bool hasBackwardProjectedNodesHere = false; bool hasBackwardProjectedNodesSubtree = false; @@ -131,20 +140,16 @@ bool SkiaDisplayList::prepareListAndChildren( } } - for (auto& vectorDrawablePair : mVectorDrawables) { + for (auto& [vectorDrawable, cachedMatrix] : mVectorDrawables) { // If any vector drawable in the display list needs update, damage the node. - auto& vectorDrawable = vectorDrawablePair.first; if (vectorDrawable->isDirty()) { Matrix4 totalMatrix; info.damageAccumulator->computeCurrentTransform(&totalMatrix); - Matrix4 canvasMatrix(vectorDrawablePair.second); + Matrix4 canvasMatrix(cachedMatrix); totalMatrix.multiply(canvasMatrix); const SkRect& bounds = vectorDrawable->properties().getBounds(); if (intersects(info.screenSize, totalMatrix, bounds)) { isDirty = true; - static_cast<SkiaPipeline*>(info.canvasContext.getRenderPipeline()) - ->getVectorDrawables() - ->push_back(vectorDrawable); vectorDrawable->setPropertyChangeWillBeConsumed(true); } } |