diff options
author | Robert Phillips <robertphillips@google.com> | 2017-06-23 14:09:30 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-06-26 15:29:18 +0000 |
commit | 8744405448b9402e1368aebd321c4f555543301a (patch) | |
tree | b5df1fbe70897eca74072f9c5b9920977c817d36 /src | |
parent | 6945c946ea800b7bff31920914a990c88a706718 (diff) |
Remove SkImage_Base::peekTexture call
Change-Id: Ie5b6bec8df083e0a128aa234d80f5a214cd98f0d
Reviewed-on: https://skia-review.googlesource.com/20741
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/image/SkImage_Base.h | 3 | ||||
-rw-r--r-- | src/image/SkImage_Gpu.cpp | 4 | ||||
-rw-r--r-- | src/image/SkImage_Gpu.h | 9 |
3 files changed, 4 insertions, 12 deletions
diff --git a/src/image/SkImage_Base.h b/src/image/SkImage_Base.h index 9604dc6b31..650041870c 100644 --- a/src/image/SkImage_Base.h +++ b/src/image/SkImage_Base.h @@ -44,8 +44,7 @@ public: virtual bool onReadPixels(const SkImageInfo& dstInfo, void* dstPixels, size_t dstRowBytes, int srcX, int srcY, CachingHint) const = 0; - // MDB TODO: this entry point needs to go away - virtual GrTexture* peekTexture() const { return nullptr; } + virtual GrContext* context() const { return nullptr; } #if SK_SUPPORT_GPU virtual GrTextureProxy* peekProxy() const { return nullptr; } virtual sk_sp<GrTextureProxy> asTextureProxyRef() const { return nullptr; } diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp index 41990e842b..4e8b28bc74 100644 --- a/src/image/SkImage_Gpu.cpp +++ b/src/image/SkImage_Gpu.cpp @@ -454,8 +454,8 @@ sk_sp<SkImage> SkImage::makeTextureImage(GrContext* context, SkColorSpace* dstCo if (!context) { return nullptr; } - if (GrTexture* peek = as_IB(this)->peekTexture()) { - return peek->getContext() == context ? sk_ref_sp(const_cast<SkImage*>(this)) : nullptr; + if (GrContext* incumbent = as_IB(this)->context()) { + return incumbent == context ? sk_ref_sp(const_cast<SkImage*>(this)) : nullptr; } if (this->isLazyGenerated()) { diff --git a/src/image/SkImage_Gpu.h b/src/image/SkImage_Gpu.h index 32a6647a73..9c3517bac5 100644 --- a/src/image/SkImage_Gpu.h +++ b/src/image/SkImage_Gpu.h @@ -33,16 +33,10 @@ public: bool getROPixels(SkBitmap*, SkColorSpace* dstColorSpace, CachingHint) const override; sk_sp<SkImage> onMakeSubset(const SkIRect&) const override; + GrContext* context() const override { return fContext; } GrTextureProxy* peekProxy() const override { return fProxy.get(); } - GrTexture* peekTexture() const override { - if (!fProxy->instantiate(fContext->resourceProvider())) { - return nullptr; - } - - return fProxy->priv().peekTexture(); - } sk_sp<GrTextureProxy> asTextureProxyRef() const override { return fProxy; } @@ -61,7 +55,6 @@ public: bool onReadPixels(const SkImageInfo&, void* dstPixels, size_t dstRowBytes, int srcX, int srcY, CachingHint) const override; - GrContext* context() { return fContext; } sk_sp<SkColorSpace> refColorSpace() { return fColorSpace; } sk_sp<SkImage> onMakeColorSpace(sk_sp<SkColorSpace>, SkColorType, |