diff options
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, |