summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Kevin Lubick <kjlubick@google.com> 2023-05-03 11:49:21 +0000
committer Kevin Lubick <kjlubick@google.com> 2023-05-04 11:44:21 +0000
commit625c94afa650d77bebcb02414a2ccd523b24c565 (patch)
tree78193d771e67e7823db55f90b7f029f7c0430a9d
parentbc120bd86f894e2bf787cf7686402753ea4e162f (diff)
Replace direct SkSurface creation with canvas->makeSurface
This is causing Skia to need to define GPU-specific canvas methods even when Android is being built without a GPU backend. Change-Id: Ia2be81e15599d3c6984748edde8d7ec97be9eb7a
-rw-r--r--libs/hwui/RecordingCanvas.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/libs/hwui/RecordingCanvas.cpp b/libs/hwui/RecordingCanvas.cpp
index 924fbd659824..d4d589897422 100644
--- a/libs/hwui/RecordingCanvas.cpp
+++ b/libs/hwui/RecordingCanvas.cpp
@@ -675,12 +675,11 @@ public:
// because the webview functor still doesn't respect the canvas clip stack.
const SkIRect deviceBounds = c->getDeviceClipBounds();
if (mLayerSurface == nullptr || c->imageInfo() != mLayerImageInfo) {
- GrRecordingContext* directContext = c->recordingContext();
mLayerImageInfo =
c->imageInfo().makeWH(deviceBounds.width(), deviceBounds.height());
- mLayerSurface = SkSurface::MakeRenderTarget(directContext, skgpu::Budgeted::kYes,
- mLayerImageInfo, 0,
- kTopLeft_GrSurfaceOrigin, nullptr);
+ // SkCanvas::makeSurface returns a new surface that will be GPU-backed if
+ // canvas was also.
+ mLayerSurface = c->makeSurface(mLayerImageInfo);
}
SkCanvas* layerCanvas = mLayerSurface->getCanvas();