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 /src/gpu/GrRenderTargetProxy.cpp | |
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 'src/gpu/GrRenderTargetProxy.cpp')
-rw-r--r-- | src/gpu/GrRenderTargetProxy.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/gpu/GrRenderTargetProxy.cpp b/src/gpu/GrRenderTargetProxy.cpp index 7cc51dfcd6..b582455809 100644 --- a/src/gpu/GrRenderTargetProxy.cpp +++ b/src/gpu/GrRenderTargetProxy.cpp @@ -45,20 +45,19 @@ int GrRenderTargetProxy::maxWindowRectangles(const GrCaps& caps) const { : 0; } -GrSurface* GrRenderTargetProxy::instantiate(GrResourceProvider* resourceProvider) { +bool GrRenderTargetProxy::instantiate(GrResourceProvider* resourceProvider) { static constexpr GrSurfaceFlags kFlags = kRenderTarget_GrSurfaceFlag; - GrSurface* surf = this->instantiateImpl(resourceProvider, fSampleCnt, kFlags, - /* isMipped = */ false, - SkDestinationSurfaceColorMode::kLegacy); - if (!surf) { - return nullptr; + if (!this->instantiateImpl(resourceProvider, fSampleCnt, kFlags, + /* isMipped = */ false, + SkDestinationSurfaceColorMode::kLegacy)) { + return false; } - SkASSERT(surf->asRenderTarget()); + SkASSERT(fTarget->asRenderTarget()); // Check that our a priori computation matched the ultimate reality - SkASSERT(fRenderTargetFlags == surf->asRenderTarget()->renderTargetPriv().flags()); + SkASSERT(fRenderTargetFlags == fTarget->asRenderTarget()->renderTargetPriv().flags()); - return surf; + return true; } int GrRenderTargetProxy::worstCaseWidth() const { |