diff options
author | Xin Li <delphij@google.com> | 2017-11-14 12:31:11 -0800 |
---|---|---|
committer | Xin Li <delphij@google.com> | 2017-11-14 12:31:11 -0800 |
commit | 220871a697290529278ed16db508eda8e12f3fc7 (patch) | |
tree | bc13101b63c6fe39a9d92706ecb7ded7f98f5a9c /libs/hwui/pipeline/skia/SkiaPipeline.cpp | |
parent | 802f191b2b84a1b1b82c7f6f3268846084b35dfb (diff) | |
parent | 98e12851336b7db16e583f9afac63ecc97465980 (diff) |
Merge commit '98e12851336b7db16e583f9afac63ecc97465980' from
oc-mr1-dev-plus-aosp-without-vendor into stage-aosp-master.
Change-Id: Ia7b8da4a00d215160e4a4fa40f6044208d1297b7
Merged-In: I19846d2a3ee27aecbae2367a74ee49082eea154d
Diffstat (limited to 'libs/hwui/pipeline/skia/SkiaPipeline.cpp')
-rw-r--r-- | libs/hwui/pipeline/skia/SkiaPipeline.cpp | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/libs/hwui/pipeline/skia/SkiaPipeline.cpp b/libs/hwui/pipeline/skia/SkiaPipeline.cpp index 0bab7932432c..03792e0ed291 100644 --- a/libs/hwui/pipeline/skia/SkiaPipeline.cpp +++ b/libs/hwui/pipeline/skia/SkiaPipeline.cpp @@ -95,7 +95,7 @@ void SkiaPipeline::renderLayersImpl(const LayerUpdateQueue& layers, SkASSERT(layerNode->getDisplayList()->isSkiaDL()); SkiaDisplayList* displayList = (SkiaDisplayList*)layerNode->getDisplayList(); if (!displayList || displayList->isEmpty()) { - SkDEBUGF(("%p drawLayers(%s) : missing drawable", this, layerNode->getName())); + SkDEBUGF(("%p drawLayers(%s) : missing drawable", layerNode, layerNode->getName())); return; } @@ -183,26 +183,16 @@ public: }; void SkiaPipeline::renderVectorDrawableCache() { - //render VectorDrawables into offscreen buffers - for (auto vd : mVectorDrawables) { - sk_sp<SkSurface> surface; - if (!vd->canReuseSurface()) { -#ifndef ANDROID_ENABLE_LINEAR_BLENDING - sk_sp<SkColorSpace> colorSpace = nullptr; -#else - sk_sp<SkColorSpace> colorSpace = SkColorSpace::MakeSRGB(); -#endif - int scaledWidth = SkScalarCeilToInt(vd->properties().getScaledWidth()); - int scaledHeight = SkScalarCeilToInt(vd->properties().getScaledHeight()); - SkImageInfo info = SkImageInfo::MakeN32(scaledWidth, scaledHeight, - kPremul_SkAlphaType, colorSpace); - SkASSERT(mRenderThread.getGrContext() != nullptr); - surface = SkSurface::MakeRenderTarget(mRenderThread.getGrContext(), SkBudgeted::kYes, - info); + if (!mVectorDrawables.empty()) { + sp<VectorDrawableAtlas> atlas = mRenderThread.cacheManager().acquireVectorDrawableAtlas(); + auto grContext = mRenderThread.getGrContext(); + atlas->prepareForDraw(grContext); + for (auto vd : mVectorDrawables) { + vd->updateCache(atlas, grContext); } - vd->updateCache(surface); + grContext->flush(); + mVectorDrawables.clear(); } - mVectorDrawables.clear(); } void SkiaPipeline::renderFrame(const LayerUpdateQueue& layers, const SkRect& clip, |