aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/image/SkImage_Gpu.h
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2017-03-21 16:22:00 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-22 11:52:16 +0000
commit0ae6faa34d73ffc7ebec3d13f0473703bade821b (patch)
treed54d076330e9da961cd198732aca245ee7b4a646 /src/image/SkImage_Gpu.h
parent54d212e1bfaea0be88c3c40820d0b1ae0daebecf (diff)
Make SkImage_Gpu be deferred (take 2)
This CL removes the GrTexture-based ctor forcing everyone to create deferred SkImage_Gpus. relanding of: https://skia-review.googlesource.com/c/6680/ (Make SkImage_Gpu be deferred) split out into: https://skia-review.googlesource.com/c/9106/ (Remove atlas creation from GrResourceProvider) Change-Id: I834ede430b9706cf9b675bdfdddf1c8c624c2f14 Reviewed-on: https://skia-review.googlesource.com/9965 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/image/SkImage_Gpu.h')
-rw-r--r--src/image/SkImage_Gpu.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/image/SkImage_Gpu.h b/src/image/SkImage_Gpu.h
index fb04a27f79..ea621b0583 100644
--- a/src/image/SkImage_Gpu.h
+++ b/src/image/SkImage_Gpu.h
@@ -22,7 +22,6 @@
class SkImage_Gpu : public SkImage_Base {
public:
- SkImage_Gpu(uint32_t uniqueID, SkAlphaType, sk_sp<GrTexture>, sk_sp<SkColorSpace>, SkBudgeted);
SkImage_Gpu(GrContext*, uint32_t uniqueID, SkAlphaType, sk_sp<GrTextureProxy>,
sk_sp<SkColorSpace>, SkBudgeted);
~SkImage_Gpu() override;
@@ -35,6 +34,9 @@ public:
sk_sp<SkColorSpace>*, SkScalar scaleAdjust[2]) const override;
sk_sp<SkImage> onMakeSubset(const SkIRect&) const override;
+ GrTextureProxy* peekProxy() const override {
+ return fProxy.get();
+ }
GrTexture* peekTexture() const override {
return fProxy->instantiate(fContext->resourceProvider());
}
@@ -44,10 +46,14 @@ public:
sk_sp<GrTextureProxy> asTextureProxyRef(GrContext*, const GrSamplerParams&, SkColorSpace*,
sk_sp<SkColorSpace>*,
SkScalar scaleAdjust[2]) const override;
+
sk_sp<GrTexture> refPinnedTexture(uint32_t* uniqueID) const override {
*uniqueID = this->uniqueID();
return sk_ref_sp(this->peekTexture());
}
+ GrBackendObject onGetTextureHandle(bool flushPendingGrContextIO,
+ GrSurfaceOrigin* origin) const override;
+ GrTexture* onGetTexture() const override;
bool onReadYUV8Planes(const SkISize sizes[3], void* const planes[3],
const size_t rowBytes[3], SkYUVColorSpace colorSpace) const override;