Remove kRenderTarget_GrSurfaceFlag, instead pass GrRenderable.
This is the last surface desc flag, so remove flags from GrSurfaceDesc.
Bug: skia:6718
Change-Id: Id3ed66b161289927b62f40bfb1f6482cf544deda
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/227858
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrRenderTargetProxy.cpp b/src/gpu/GrRenderTargetProxy.cpp
index 756e1d6..0d70920 100644
--- a/src/gpu/GrRenderTargetProxy.cpp
+++ b/src/gpu/GrRenderTargetProxy.cpp
@@ -24,11 +24,11 @@
const GrSwizzle& textureSwizzle,
const GrSwizzle& outputSwizzle, SkBackingFit fit,
SkBudgeted budgeted, GrInternalSurfaceFlags surfaceFlags)
- : INHERITED(format, desc, origin, textureSwizzle, fit, budgeted, surfaceFlags)
+ : INHERITED(format, desc, GrRenderable::kYes, origin, textureSwizzle, fit, budgeted,
+ surfaceFlags)
, fSampleCnt(desc.fSampleCnt)
, fWrapsVkSecondaryCB(WrapsVkSecondaryCB::kNo)
- , fOutputSwizzle(outputSwizzle) {
-}
+ , fOutputSwizzle(outputSwizzle) {}
// Lazy-callback version
GrRenderTargetProxy::GrRenderTargetProxy(LazyInstantiateCallback&& callback,
@@ -38,13 +38,11 @@
const GrSwizzle& outputSwizzle, SkBackingFit fit,
SkBudgeted budgeted, GrInternalSurfaceFlags surfaceFlags,
WrapsVkSecondaryCB wrapsVkSecondaryCB)
- : INHERITED(std::move(callback), lazyType, format, desc, origin, textureSwizzle, fit,
- budgeted, surfaceFlags)
+ : INHERITED(std::move(callback), lazyType, format, desc, GrRenderable::kYes, origin,
+ textureSwizzle, fit, budgeted, surfaceFlags)
, fSampleCnt(desc.fSampleCnt)
, fWrapsVkSecondaryCB(wrapsVkSecondaryCB)
- , fOutputSwizzle(outputSwizzle) {
- SkASSERT(SkToBool(kRenderTarget_GrSurfaceFlag & desc.fFlags));
-}
+ , fOutputSwizzle(outputSwizzle) {}
// Wrapped version
GrRenderTargetProxy::GrRenderTargetProxy(sk_sp<GrSurface> surf, GrSurfaceOrigin origin,
@@ -65,9 +63,7 @@
if (LazyState::kNot != this->lazyInstantiationState()) {
return false;
}
- static constexpr GrSurfaceDescFlags kDescFlags = kRenderTarget_GrSurfaceFlag;
-
- if (!this->instantiateImpl(resourceProvider, fSampleCnt, fNumStencilSamples, kDescFlags,
+ if (!this->instantiateImpl(resourceProvider, fSampleCnt, fNumStencilSamples, GrRenderable::kYes,
GrMipMapped::kNo, nullptr)) {
return false;
}
@@ -87,10 +83,8 @@
}
sk_sp<GrSurface> GrRenderTargetProxy::createSurface(GrResourceProvider* resourceProvider) const {
- static constexpr GrSurfaceDescFlags kDescFlags = kRenderTarget_GrSurfaceFlag;
-
sk_sp<GrSurface> surface = this->createSurfaceImpl(
- resourceProvider, fSampleCnt, fNumStencilSamples, kDescFlags, GrMipMapped::kNo);
+ resourceProvider, fSampleCnt, fNumStencilSamples, GrRenderable::kYes, GrMipMapped::kNo);
if (!surface) {
return nullptr;
}