diff options
author | Robert Phillips <robertphillips@google.com> | 2017-06-05 09:26:07 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-06-05 14:03:10 +0000 |
commit | eee4d6e4e8cc5c4c79f065abcc3ce609f71238f9 (patch) | |
tree | 9a855a9892a8b3017370164355b88c2a4ac9c89c /include | |
parent | 9beafc41afa3c78ffa12649dcde73628c277da9c (diff) |
Make instantiate return a Boolean
From an off-line conversation:
The longer term idea will be to create a helper class isolates the
ability to instantiate proxies until flush time. The peek* methods
could then be moved to GrSurfaceProxy.
Change-Id: I8e8c02c098475b77d515791c0d6b81f7e4a327dd
Reviewed-on: https://skia-review.googlesource.com/18076
Commit-Queue: Robert Phillips <robertphillips@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/private/GrRenderTargetProxy.h | 8 | ||||
-rw-r--r-- | include/private/GrSurfaceProxy.h | 8 | ||||
-rw-r--r-- | include/private/GrTextureProxy.h | 8 |
3 files changed, 6 insertions, 18 deletions
diff --git a/include/private/GrRenderTargetProxy.h b/include/private/GrRenderTargetProxy.h index 6d8b000d7c..31c386860d 100644 --- a/include/private/GrRenderTargetProxy.h +++ b/include/private/GrRenderTargetProxy.h @@ -24,13 +24,7 @@ public: const GrRenderTargetProxy* asRenderTargetProxy() const override { return this; } // Actually instantiate the backing rendertarget, if necessary. - GrSurface* instantiate(GrResourceProvider* resourceProvider) override; - GrRenderTarget* instantiateRenderTarget(GrResourceProvider* resourceProvider) { - if (auto surf = this->instantiate(resourceProvider)) { - return surf->asRenderTarget(); - } - return nullptr; - } + bool instantiate(GrResourceProvider* resourceProvider) override; GrFSAAType fsaaType() const { if (!fSampleCnt) { diff --git a/include/private/GrSurfaceProxy.h b/include/private/GrSurfaceProxy.h index be8c1940bc..bded2c1be6 100644 --- a/include/private/GrSurfaceProxy.h +++ b/include/private/GrSurfaceProxy.h @@ -244,7 +244,7 @@ public: */ UniqueID uniqueID() const { return fUniqueID; } - virtual GrSurface* instantiate(GrResourceProvider* resourceProvider) = 0; + virtual bool instantiate(GrResourceProvider* resourceProvider) = 0; /** * Helper that gets the width and height of the surface as a bounding rectangle. @@ -347,9 +347,9 @@ protected: return this->internalHasPendingWrite(); } - GrSurface* instantiateImpl(GrResourceProvider* resourceProvider, int sampleCnt, - GrSurfaceFlags flags, bool isMipMapped, - SkDestinationSurfaceColorMode mipColorMode); + bool instantiateImpl(GrResourceProvider* resourceProvider, int sampleCnt, + GrSurfaceFlags flags, bool isMipMapped, + SkDestinationSurfaceColorMode mipColorMode); // For wrapped resources, 'fConfig', 'fWidth', 'fHeight', and 'fOrigin; will always be filled in // from the wrapped resource. diff --git a/include/private/GrTextureProxy.h b/include/private/GrTextureProxy.h index d40b2e173e..dcc3afcdb1 100644 --- a/include/private/GrTextureProxy.h +++ b/include/private/GrTextureProxy.h @@ -22,13 +22,7 @@ public: const GrTextureProxy* asTextureProxy() const override { return this; } // Actually instantiate the backing texture, if necessary - GrSurface* instantiate(GrResourceProvider*) override; - GrTexture* instantiateTexture(GrResourceProvider* resourceProvider) { - if (auto surf = this->instantiate(resourceProvider)) { - return surf->asTexture(); - } - return nullptr; - } + bool instantiate(GrResourceProvider*) override; void setMipColorMode(SkDestinationSurfaceColorMode colorMode); |