summaryrefslogtreecommitdiff
path: root/libs/hwui/pipeline/skia/SkiaPipeline.cpp
diff options
context:
space:
mode:
authorAdlai Holler <adlai@google.com>2020-09-16 10:37:19 -0400
committerAdlai Holler <adlai@google.com>2020-09-18 14:42:41 +0000
commitab762153fb6156ac014bd715100697e20aac9516 (patch)
tree69d278fa299f20581d676088950604bf51536f48 /libs/hwui/pipeline/skia/SkiaPipeline.cpp
parentb850bfbd7854b12c5932faba7c240e29057d919b (diff)
Migrate from SkCanvas::getGrContext to SkCanvas::recordingContext
This is part of API cleanup as we make DDL usage more mainstream in Skia. Since Android doesn't use DDLs, the cast from recordingContext to directContext will always succeed and there's no functional change. Change-Id: Ie585cf6c97d01fecf082f146d5692999371fd39d
Diffstat (limited to 'libs/hwui/pipeline/skia/SkiaPipeline.cpp')
-rw-r--r--libs/hwui/pipeline/skia/SkiaPipeline.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/libs/hwui/pipeline/skia/SkiaPipeline.cpp b/libs/hwui/pipeline/skia/SkiaPipeline.cpp
index 6dd36981e8aa..6e7493cb443d 100644
--- a/libs/hwui/pipeline/skia/SkiaPipeline.cpp
+++ b/libs/hwui/pipeline/skia/SkiaPipeline.cpp
@@ -86,7 +86,7 @@ void SkiaPipeline::renderLayers(const LightGeometry& lightGeometry,
}
void SkiaPipeline::renderLayersImpl(const LayerUpdateQueue& layers, bool opaque) {
- sk_sp<GrContext> cachedContext;
+ sk_sp<GrDirectContext> cachedContext;
// Render all layers that need to be updated, in order.
for (size_t i = 0; i < layers.entries().size(); i++) {
@@ -142,7 +142,8 @@ void SkiaPipeline::renderLayersImpl(const LayerUpdateQueue& layers, bool opaque)
// cache the current context so that we can defer flushing it until
// either all the layers have been rendered or the context changes
- GrContext* currentContext = layerNode->getLayerSurface()->getCanvas()->getGrContext();
+ GrDirectContext* currentContext =
+ GrAsDirectContext(layerNode->getLayerSurface()->getCanvas()->recordingContext());
if (cachedContext.get() != currentContext) {
if (cachedContext.get()) {
ATRACE_NAME("flush layers (context changed)");
@@ -201,7 +202,7 @@ bool SkiaPipeline::createOrUpdateLayer(RenderNode* node, const DamageAccumulator
}
void SkiaPipeline::prepareToDraw(const RenderThread& thread, Bitmap* bitmap) {
- GrContext* context = thread.getGrContext();
+ GrDirectContext* context = thread.getGrContext();
if (context) {
ATRACE_FORMAT("Bitmap#prepareToDraw %dx%d", bitmap->width(), bitmap->height());
auto image = bitmap->makeImage();