aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/image_pict.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-03-23 08:21:00 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-23 13:10:45 +0000
commit4f358be6b72cca97856b3f59d83448650d359d93 (patch)
treed33121e3ca23281a6f81cda316cef3e7e66804d6 /gm/image_pict.cpp
parent5df93de8ad968b4e25708964e558979375eeaa9e (diff)
Make SkImageCacherator be deferred (take 2)
Split out of: https://skia-review.googlesource.com/c/8823/ (Remove GrFragmentProcessor-derived class' GrTexture-based ctors) This is a second pass at: https://skia-review.googlesource.com/c/9945/ (Make SkImageCacherator be deferred) Change-Id: I3451383eed497d1235686e8961087859c7c7bd30 Reviewed-on: https://skia-review.googlesource.com/10034 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'gm/image_pict.cpp')
-rw-r--r--gm/image_pict.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/gm/image_pict.cpp b/gm/image_pict.cpp
index 883fd34725..792173ce66 100644
--- a/gm/image_pict.cpp
+++ b/gm/image_pict.cpp
@@ -344,12 +344,11 @@ protected:
static void draw_as_tex(SkCanvas* canvas, SkImageCacherator* cache, SkScalar x, SkScalar y) {
#if SK_SUPPORT_GPU
sk_sp<SkColorSpace> texColorSpace;
- // MDB TODO: this should be lockAsTextureRef
- sk_sp<GrTexture> texture(
- cache->lockAsTexture(canvas->getGrContext(), GrSamplerParams::ClampBilerp(),
- canvas->imageInfo().colorSpace(), &texColorSpace,
- nullptr, nullptr));
- if (!texture) {
+ sk_sp<GrTextureProxy> proxy(
+ cache->lockAsTextureProxy(canvas->getGrContext(), GrSamplerParams::ClampBilerp(),
+ canvas->imageInfo().colorSpace(), &texColorSpace,
+ nullptr, nullptr));
+ if (!proxy) {
// show placeholder if we have no texture
SkPaint paint;
paint.setStyle(SkPaint::kStroke_Style);
@@ -361,8 +360,6 @@ protected:
return;
}
- sk_sp<GrTextureProxy> proxy = GrSurfaceProxy::MakeWrapped(std::move(texture));
-
// No API to draw a GrTexture directly, so we cheat and create a private image subclass
sk_sp<SkImage> image(new SkImage_Gpu(canvas->getGrContext(),
cache->uniqueID(), kPremul_SkAlphaType,