diff options
author | Greg Daniel <egdaniel@google.com> | 2018-04-24 14:32:53 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-04-24 18:59:16 +0000 |
commit | 849dce1d7bc10b532c3d8f81a503416caf5f444e (patch) | |
tree | e60653b3a87a7e73ce4ba923ff4f83dd354c430d /src/gpu/GrSurfaceProxy.cpp | |
parent | 55d330c32dce20b56e4c104fa4d844f2fb3b2fc7 (diff) |
Update flag checks when validating surface being assigned to proxy.
Bug: skia:7748
Change-Id: Id87c0b1be2efbdefd96740e9591fd102e09b4d95
Reviewed-on: https://skia-review.googlesource.com/123423
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrSurfaceProxy.cpp')
-rw-r--r-- | src/gpu/GrSurfaceProxy.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/gpu/GrSurfaceProxy.cpp b/src/gpu/GrSurfaceProxy.cpp index ff3ae3b560..4d44d1ecc6 100644 --- a/src/gpu/GrSurfaceProxy.cpp +++ b/src/gpu/GrSurfaceProxy.cpp @@ -180,11 +180,7 @@ sk_sp<GrSurface> GrSurfaceProxy::createSurfaceImpl( void GrSurfaceProxy::assign(sk_sp<GrSurface> surface) { SkASSERT(!fTarget && surface); - // Check that our a priori computation matched the ultimate reality - // DDL TODO: re-enable this after skbug.com/7748 (Add FBO-0-ness to SkSurfaceCharacterization) - // is fixed. -// SkASSERT((fSurfaceFlags & ~GrInternalSurfaceFlags::kNoPendingIO) == -// surface->surfacePriv().flags()); + SkDEBUGCODE(this->validateSurface(surface.get());) fTarget = surface.release(); @@ -424,13 +420,19 @@ bool GrSurfaceProxyPriv::doLazyInstantiation(GrResourceProvider* resourceProvide GrSurfaceProxyPriv::AttachStencilIfNeeded(resourceProvider, surface.get(), needsStencil); - SkASSERT(surface->config() == fProxy->fConfig); - // Assert the flags are the same except for kNoPendingIO which is not passed onto the GrSurface. - SkDEBUGCODE(GrInternalSurfaceFlags proxyFlags = - fProxy->fSurfaceFlags & ~GrInternalSurfaceFlags::kNoPendingIO); - SkASSERT(surface->surfacePriv().flags() == proxyFlags); - SkDEBUGCODE(fProxy->validateLazySurface(surface.get());) this->assign(std::move(surface)); return true; } +#ifdef SK_DEBUG +void GrSurfaceProxy::validateSurface(const GrSurface* surface) { + SkASSERT(surface->config() == fConfig); + + // Assert the flags are the same except for kNoPendingIO which is not passed onto the GrSurface. + GrInternalSurfaceFlags proxyFlags = fSurfaceFlags & ~GrInternalSurfaceFlags::kNoPendingIO; + GrInternalSurfaceFlags surfaceFlags = surface->surfacePriv().flags(); + SkASSERT((proxyFlags & GrInternalSurfaceFlags::kSurfaceMask) == + (surfaceFlags & GrInternalSurfaceFlags::kSurfaceMask)); + this->onValidateSurface(surface); +} +#endif |