Support multisample in GrProxyProvider::MakeFullyLazyProxy
Bug: skia:
Change-Id: I5784a309b8775b9a805f1240e2c6ba7cc1bab70c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/208145
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
diff --git a/src/gpu/GrProxyProvider.cpp b/src/gpu/GrProxyProvider.cpp
index d2c47ac..1b30cc6 100644
--- a/src/gpu/GrProxyProvider.cpp
+++ b/src/gpu/GrProxyProvider.cpp
@@ -749,21 +749,21 @@
vkSCB));
}
-sk_sp<GrTextureProxy> GrProxyProvider::MakeFullyLazyProxy(LazyInstantiateCallback&& callback,
- const GrBackendFormat& format,
- Renderable renderable,
- GrSurfaceOrigin origin,
- GrPixelConfig config,
- const GrCaps& caps) {
+sk_sp<GrTextureProxy> GrProxyProvider::MakeFullyLazyProxy(
+ LazyInstantiateCallback&& callback, const GrBackendFormat& format, Renderable renderable,
+ GrSurfaceOrigin origin, GrPixelConfig config, const GrCaps& caps, int sampleCnt) {
GrSurfaceDesc desc;
GrInternalSurfaceFlags surfaceFlags = GrInternalSurfaceFlags::kNoPendingIO;
if (Renderable::kYes == renderable) {
desc.fFlags = kRenderTarget_GrSurfaceFlag;
+ if (sampleCnt > 1 && caps.usesMixedSamples()) {
+ surfaceFlags |= GrInternalSurfaceFlags::kMixedSampled;
+ }
}
desc.fWidth = -1;
desc.fHeight = -1;
desc.fConfig = config;
- desc.fSampleCnt = 1;
+ desc.fSampleCnt = sampleCnt;
return sk_sp<GrTextureProxy>(
(Renderable::kYes == renderable)
diff --git a/src/gpu/GrProxyProvider.h b/src/gpu/GrProxyProvider.h
index 089093c..969b674 100644
--- a/src/gpu/GrProxyProvider.h
+++ b/src/gpu/GrProxyProvider.h
@@ -189,9 +189,9 @@
* Fully lazy proxies have unspecified width and height. Methods that rely on those values
* (e.g., width, height, getBoundsRect) should be avoided.
*/
- static sk_sp<GrTextureProxy> MakeFullyLazyProxy(LazyInstantiateCallback&&,
- const GrBackendFormat&, Renderable,
- GrSurfaceOrigin, GrPixelConfig, const GrCaps&);
+ static sk_sp<GrTextureProxy> MakeFullyLazyProxy(
+ LazyInstantiateCallback&&, const GrBackendFormat&, Renderable, GrSurfaceOrigin,
+ GrPixelConfig, const GrCaps&, int sampleCnt = 1);
// 'proxy' is about to be used as a texture src or drawn to. This query can be used to
// determine if it is going to need a texture domain or a full clear.