diff options
author | 2023-01-09 14:48:45 +0000 | |
---|---|---|
committer | 2023-01-11 15:51:45 +0000 | |
commit | 8099b671d5037cd15724fc28c1177a48ed7b989f (patch) | |
tree | 8dd22a287d76e7ef699861a574df4bf27aea9218 | |
parent | 123d9f6360a1eb17760cb180a3541f6824a78d96 (diff) |
[base] SkBudgeted -> skgpu::Budgeted
Follow-up from https://skia-review.googlesource.com/c/skia/+/621977
Change-Id: I2a381a325c5c0c50f0d27e9d06210bb6be878919
Bug: skbug.com/13983
-rw-r--r-- | libs/hwui/Readback.cpp | 13 | ||||
-rw-r--r-- | libs/hwui/RecordingCanvas.cpp | 3 | ||||
-rw-r--r-- | libs/hwui/pipeline/skia/GLFunctorDrawable.cpp | 3 | ||||
-rw-r--r-- | libs/hwui/pipeline/skia/SkiaPipeline.cpp | 3 | ||||
-rw-r--r-- | libs/hwui/pipeline/skia/StretchMask.cpp | 4 | ||||
-rw-r--r-- | libs/hwui/tests/unit/CacheManagerTests.cpp | 4 |
6 files changed, 21 insertions, 9 deletions
diff --git a/libs/hwui/Readback.cpp b/libs/hwui/Readback.cpp index 8dcd6dbe6421..045de35c1d97 100644 --- a/libs/hwui/Readback.cpp +++ b/libs/hwui/Readback.cpp @@ -28,6 +28,7 @@ #include <SkRefCnt.h> #include <SkSamplingOptions.h> #include <SkSurface.h> +#include "include/gpu/GpuTypes.h" // from Skia #include <gui/TraceUtils.h> #include <private/android/AHardwareBufferHelpers.h> #include <shaders/shaders.h> @@ -170,14 +171,15 @@ void Readback::copySurfaceInto(ANativeWindow* window, const std::shared_ptr<Copy SkBitmap skBitmap = request->getDestinationBitmap(srcRect.width(), srcRect.height()); SkBitmap* bitmap = &skBitmap; sk_sp<SkSurface> tmpSurface = - SkSurface::MakeRenderTarget(mRenderThread.getGrContext(), SkBudgeted::kYes, + SkSurface::MakeRenderTarget(mRenderThread.getGrContext(), skgpu::Budgeted::kYes, bitmap->info(), 0, kTopLeft_GrSurfaceOrigin, nullptr); // if we can't generate a GPU surface that matches the destination bitmap (e.g. 565) then we // attempt to do the intermediate rendering step in 8888 if (!tmpSurface.get()) { SkImageInfo tmpInfo = bitmap->info().makeColorType(SkColorType::kN32_SkColorType); - tmpSurface = SkSurface::MakeRenderTarget(mRenderThread.getGrContext(), SkBudgeted::kYes, + tmpSurface = SkSurface::MakeRenderTarget(mRenderThread.getGrContext(), + skgpu::Budgeted::kYes, tmpInfo, 0, kTopLeft_GrSurfaceOrigin, nullptr); if (!tmpSurface.get()) { ALOGW("Unable to generate GPU buffer in a format compatible with the provided bitmap"); @@ -345,14 +347,17 @@ bool Readback::copyLayerInto(Layer* layer, const SkRect* srcRect, const SkRect* * software buffer. */ sk_sp<SkSurface> tmpSurface = SkSurface::MakeRenderTarget(mRenderThread.getGrContext(), - SkBudgeted::kYes, bitmap->info(), 0, + skgpu::Budgeted::kYes, + bitmap->info(), + 0, kTopLeft_GrSurfaceOrigin, nullptr); // if we can't generate a GPU surface that matches the destination bitmap (e.g. 565) then we // attempt to do the intermediate rendering step in 8888 if (!tmpSurface.get()) { SkImageInfo tmpInfo = bitmap->info().makeColorType(SkColorType::kN32_SkColorType); - tmpSurface = SkSurface::MakeRenderTarget(mRenderThread.getGrContext(), SkBudgeted::kYes, + tmpSurface = SkSurface::MakeRenderTarget(mRenderThread.getGrContext(), + skgpu::Budgeted::kYes, tmpInfo, 0, kTopLeft_GrSurfaceOrigin, nullptr); if (!tmpSurface.get()) { ALOGW("Unable to generate GPU buffer in a format compatible with the provided bitmap"); diff --git a/libs/hwui/RecordingCanvas.cpp b/libs/hwui/RecordingCanvas.cpp index 3f21940d35a7..a1db462d6652 100644 --- a/libs/hwui/RecordingCanvas.cpp +++ b/libs/hwui/RecordingCanvas.cpp @@ -44,6 +44,7 @@ #include "SkTextBlob.h" #include "SkVertices.h" #include "VectorDrawable.h" +#include "include/gpu/GpuTypes.h" // from Skia #include "pipeline/skia/AnimatedDrawables.h" #include "pipeline/skia/FunctorDrawable.h" @@ -570,7 +571,7 @@ public: GrRecordingContext* directContext = c->recordingContext(); mLayerImageInfo = c->imageInfo().makeWH(deviceBounds.width(), deviceBounds.height()); - mLayerSurface = SkSurface::MakeRenderTarget(directContext, SkBudgeted::kYes, + mLayerSurface = SkSurface::MakeRenderTarget(directContext, skgpu::Budgeted::kYes, mLayerImageInfo, 0, kTopLeft_GrSurfaceOrigin, nullptr); } diff --git a/libs/hwui/pipeline/skia/GLFunctorDrawable.cpp b/libs/hwui/pipeline/skia/GLFunctorDrawable.cpp index dc72aead4873..a4960ea17c79 100644 --- a/libs/hwui/pipeline/skia/GLFunctorDrawable.cpp +++ b/libs/hwui/pipeline/skia/GLFunctorDrawable.cpp @@ -24,6 +24,7 @@ #include "SkClipStack.h" #include "SkRect.h" #include "SkM44.h" +#include "include/gpu/GpuTypes.h" // from Skia #include "utils/GLUtils.h" namespace android { @@ -92,7 +93,7 @@ void GLFunctorDrawable::onDraw(SkCanvas* canvas) { SkImageInfo surfaceInfo = canvas->imageInfo().makeWH(clipBounds.width(), clipBounds.height()); tmpSurface = - SkSurface::MakeRenderTarget(directContext, SkBudgeted::kYes, surfaceInfo); + SkSurface::MakeRenderTarget(directContext, skgpu::Budgeted::kYes, surfaceInfo); tmpSurface->getCanvas()->clear(SK_ColorTRANSPARENT); GrGLFramebufferInfo fboInfo; diff --git a/libs/hwui/pipeline/skia/SkiaPipeline.cpp b/libs/hwui/pipeline/skia/SkiaPipeline.cpp index 1a336c5855d9..3692f0940b28 100644 --- a/libs/hwui/pipeline/skia/SkiaPipeline.cpp +++ b/libs/hwui/pipeline/skia/SkiaPipeline.cpp @@ -36,6 +36,7 @@ #include <SkStream.h> #include <SkString.h> #include <SkTypeface.h> +#include "include/gpu/GpuTypes.h" // from Skia #include <android-base/properties.h> #include <unistd.h> @@ -187,7 +188,7 @@ bool SkiaPipeline::createOrUpdateLayer(RenderNode* node, const DamageAccumulator SkSurfaceProps props(0, kUnknown_SkPixelGeometry); SkASSERT(mRenderThread.getGrContext() != nullptr); node->setLayerSurface(SkSurface::MakeRenderTarget(mRenderThread.getGrContext(), - SkBudgeted::kYes, info, 0, + skgpu::Budgeted::kYes, info, 0, this->getSurfaceOrigin(), &props)); if (node->getLayerSurface()) { // update the transform in window of the layer to reset its origin wrt light source diff --git a/libs/hwui/pipeline/skia/StretchMask.cpp b/libs/hwui/pipeline/skia/StretchMask.cpp index b169c9200e88..cad3703d8d2b 100644 --- a/libs/hwui/pipeline/skia/StretchMask.cpp +++ b/libs/hwui/pipeline/skia/StretchMask.cpp @@ -18,6 +18,8 @@ #include "SkBlendMode.h" #include "SkCanvas.h" #include "SkSurface.h" +#include "include/gpu/GpuTypes.h" // from Skia + #include "TransformCanvas.h" #include "SkiaDisplayList.h" @@ -36,7 +38,7 @@ void StretchMask::draw(GrRecordingContext* context, // not match. mMaskSurface = SkSurface::MakeRenderTarget( context, - SkBudgeted::kYes, + skgpu::Budgeted::kYes, SkImageInfo::Make( width, height, diff --git a/libs/hwui/tests/unit/CacheManagerTests.cpp b/libs/hwui/tests/unit/CacheManagerTests.cpp index 508e1986b4e4..2b90bda87ecd 100644 --- a/libs/hwui/tests/unit/CacheManagerTests.cpp +++ b/libs/hwui/tests/unit/CacheManagerTests.cpp @@ -21,6 +21,7 @@ #include "tests/common/TestUtils.h" #include <SkImagePriv.h> +#include "include/gpu/GpuTypes.h" // from Skia using namespace android; using namespace android::uirenderer; @@ -45,7 +46,8 @@ RENDERTHREAD_SKIA_PIPELINE_TEST(CacheManager, DISABLED_trimMemory) { while (getCacheUsage(grContext) <= renderThread.cacheManager().getBackgroundCacheSize()) { SkImageInfo info = SkImageInfo::MakeA8(width, height); - sk_sp<SkSurface> surface = SkSurface::MakeRenderTarget(grContext, SkBudgeted::kYes, info); + sk_sp<SkSurface> surface = SkSurface::MakeRenderTarget(grContext, skgpu::Budgeted::kYes, + info); surface->getCanvas()->drawColor(SK_AlphaTRANSPARENT); grContext->flushAndSubmit(); |