aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/image_pict.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-03-22 18:13:37 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-22 18:13:42 +0000
commite3060ba87c87bb2f96469389d0ace7b82f85749e (patch)
treeeff67624cdb256362441fde3957685cfcfede729 /gm/image_pict.cpp
parent33d2055e594177b27360f84e0631b26d74a55a9b (diff)
Revert "Make SkImageCacherator be deferred"
This reverts commit 801f8b824fee6397422e47537f0f13034ac54ce6. Reason for revert: Failures on Tegra3-based Android devices (so, npot issues) Original change's description: > 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> > TBR=bsalomon@google.com,robertphillips@google.com,reviews@skia.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Ib143ef86cfad4a221e25145679ba7e48f6f7f3ba Reviewed-on: https://skia-review.googlesource.com/9949 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, 8 insertions, 5 deletions
diff --git a/gm/image_pict.cpp b/gm/image_pict.cpp
index 792173ce66..883fd34725 100644
--- a/gm/image_pict.cpp
+++ b/gm/image_pict.cpp
@@ -344,11 +344,12 @@ protected:
static void draw_as_tex(SkCanvas* canvas, SkImageCacherator* cache, SkScalar x, SkScalar y) {
#if SK_SUPPORT_GPU
sk_sp<SkColorSpace> texColorSpace;
- sk_sp<GrTextureProxy> proxy(
- cache->lockAsTextureProxy(canvas->getGrContext(), GrSamplerParams::ClampBilerp(),
- canvas->imageInfo().colorSpace(), &texColorSpace,
- nullptr, nullptr));
- if (!proxy) {
+ // MDB TODO: this should be lockAsTextureRef
+ sk_sp<GrTexture> texture(
+ cache->lockAsTexture(canvas->getGrContext(), GrSamplerParams::ClampBilerp(),
+ canvas->imageInfo().colorSpace(), &texColorSpace,
+ nullptr, nullptr));
+ if (!texture) {
// show placeholder if we have no texture
SkPaint paint;
paint.setStyle(SkPaint::kStroke_Style);
@@ -360,6 +361,8 @@ 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,