diff options
author | Robert Phillips <robertphillips@google.com> | 2017-03-22 12:21:03 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-03-22 17:29:08 +0000 |
commit | 801f8b824fee6397422e47537f0f13034ac54ce6 (patch) | |
tree | 0832759a300aae586bada42a87e425512459ff7f /gm | |
parent | 44c1b111c7528cdbcfbd76989e0701ce9bbddf58 (diff) |
Make SkImageCacherator be deferred
Split out of: https://skia-review.googlesource.com/c/8823/ (Remove GrFragmentProcessor-derived class' GrTexture-based ctors)
Change-Id: I16cf0aea9d887e5ebe053e9b5c94a970dc254beb
Reviewed-on: https://skia-review.googlesource.com/9945
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'gm')
-rw-r--r-- | gm/image_pict.cpp | 13 |
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, |