Reland "Store GrSwizzle on proxies for texturing and swizzling."
This reverts commit 3ec1f54750a745482e06b2144a1cfd2e733e4200.
Reason for revert: Relanding with GrSwizzle now back in src
Original change's description:
> Revert "Store GrSwizzle on proxies for texturing and swizzling."
>
> This reverts commit 23093135d17427ef59385761d2d729ada6d961cf.
>
> Reason for revert: Breaking Google3 :(
>
> Original change's description:
> > Store GrSwizzle on proxies for texturing and swizzling.
> >
> > Bug: skia: 6718
> > Change-Id: I023d7507da9334e984ac8209a32323d616b3d79d
> > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/214305
> > Reviewed-by: Brian Salomon <bsalomon@google.com>
> > Commit-Queue: Greg Daniel <egdaniel@google.com>
>
> TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
>
> Change-Id: Ie2303ad090f58de07db7b0ac2d42e06e5e5bbcc1
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: skia: 6718
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221338
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Brian Salomon <bsalomon@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,robertphillips@google.com
Change-Id: I42ad83892382b123b8dc4dc5e2cf375ad3c5eaeb
Bug: skia: 6718
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/221349
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/GrRenderTargetProxy.cpp b/src/gpu/GrRenderTargetProxy.cpp
index 6dad311..50e0c5c 100644
--- a/src/gpu/GrRenderTargetProxy.cpp
+++ b/src/gpu/GrRenderTargetProxy.cpp
@@ -21,10 +21,12 @@
// cases to make the sampleConfig/numSamples stuff more rational.
GrRenderTargetProxy::GrRenderTargetProxy(const GrCaps& caps, const GrBackendFormat& format,
const GrSurfaceDesc& desc, GrSurfaceOrigin origin,
- SkBackingFit fit, SkBudgeted budgeted,
- GrInternalSurfaceFlags surfaceFlags)
- : INHERITED(format, desc, origin, fit, budgeted, surfaceFlags)
+ const GrSwizzle& textureSwizzle,
+ const GrSwizzle& outputSwizzle, SkBackingFit fit,
+ SkBudgeted budgeted, GrInternalSurfaceFlags surfaceFlags)
+ : INHERITED(format, desc, origin, textureSwizzle, fit, budgeted, surfaceFlags)
, fSampleCnt(desc.fSampleCnt)
+ , fOutputSwizzle(outputSwizzle)
, fNeedsStencil(false)
, fWrapsVkSecondaryCB(WrapsVkSecondaryCB::kNo) {
// Since we know the newly created render target will be internal, we are able to precompute
@@ -38,12 +40,14 @@
GrRenderTargetProxy::GrRenderTargetProxy(LazyInstantiateCallback&& callback,
LazyInstantiationType lazyType,
const GrBackendFormat& format, const GrSurfaceDesc& desc,
- GrSurfaceOrigin origin, SkBackingFit fit,
+ GrSurfaceOrigin origin, const GrSwizzle& textureSwizzle,
+ const GrSwizzle& outputSwizzle, SkBackingFit fit,
SkBudgeted budgeted, GrInternalSurfaceFlags surfaceFlags,
WrapsVkSecondaryCB wrapsVkSecondaryCB)
- : INHERITED(std::move(callback), lazyType, format, desc, origin, fit, budgeted,
- surfaceFlags)
+ : INHERITED(std::move(callback), lazyType, format, desc, origin, textureSwizzle, fit,
+ budgeted, surfaceFlags)
, fSampleCnt(desc.fSampleCnt)
+ , fOutputSwizzle(outputSwizzle)
, fNeedsStencil(false)
, fWrapsVkSecondaryCB(wrapsVkSecondaryCB) {
SkASSERT(SkToBool(kRenderTarget_GrSurfaceFlag & desc.fFlags));
@@ -51,9 +55,12 @@
// Wrapped version
GrRenderTargetProxy::GrRenderTargetProxy(sk_sp<GrSurface> surf, GrSurfaceOrigin origin,
+ const GrSwizzle& textureSwizzle,
+ const GrSwizzle& outputSwizzle,
WrapsVkSecondaryCB wrapsVkSecondaryCB)
- : INHERITED(std::move(surf), origin, SkBackingFit::kExact)
+ : INHERITED(std::move(surf), origin, textureSwizzle, SkBackingFit::kExact)
, fSampleCnt(fTarget->asRenderTarget()->numStencilSamples())
+ , fOutputSwizzle(outputSwizzle)
, fNeedsStencil(false)
, fWrapsVkSecondaryCB(wrapsVkSecondaryCB) {
}