aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/image/SkImage_Base.h3
-rw-r--r--src/image/SkImage_Gpu.cpp4
-rw-r--r--src/image/SkImage_Gpu.h9
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,