aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/image
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-11-30 08:46:03 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-11-30 14:16:32 +0000
commit8def8bffe98ee58af6c088f3ab6e4a41f32b732f (patch)
treec79c5c8d5cedbce45cbf0bc0eb39d41b500f47bc /src/image
parent1c8092ac64dc4d9fd140d7fd46fa52163fe26569 (diff)
Add a GrContextThreadSafeProxy to SkSurfaceCharacterization
Ganesh will require access to the GrCaps to make rendering decisions. Change-Id: I6dee42a3f0dc638f052706b8d1ea6e02b589e062 Reviewed-on: https://skia-review.googlesource.com/77681 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/image')
-rw-r--r--src/image/SkSurface_Gpu.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp
index 891f03709b..3d19762cd4 100644
--- a/src/image/SkSurface_Gpu.cpp
+++ b/src/image/SkSurface_Gpu.cpp
@@ -162,18 +162,22 @@ bool SkSurface_Gpu::onWait(int numSemaphores, const GrBackendSemaphore* waitSema
bool SkSurface_Gpu::onCharacterize(SkSurfaceCharacterization* data) const {
GrRenderTargetContext* rtc = fDevice->accessRenderTargetContext();
+ GrContext* ctx = fDevice->context();
data->set(rtc->origin(), rtc->width(), rtc->height(), rtc->colorSpaceInfo().config(),
- rtc->numColorSamples());
+ rtc->numColorSamples(), ctx->threadSafeProxy());
+
return true;
}
bool SkSurface_Gpu::isCompatible(const SkSurfaceCharacterization& data) const {
GrRenderTargetContext* rtc = fDevice->accessRenderTargetContext();
+ GrContext* ctx = fDevice->context();
return data.origin() == rtc->origin() && data.width() == rtc->width() &&
data.height() == rtc->height() && data.config() == rtc->colorSpaceInfo().config() &&
- data.sampleCount() == rtc->numColorSamples();
+ data.sampleCount() == rtc->numColorSamples() &&
+ data.contextInfo() && data.contextInfo()->matches(ctx);
}
void SkSurface_Gpu::onDraw(SkDeferredDisplayList* dl) {