Remove sample count from GrSurfaceDesc.
This leaves just width, height, and GrPixelConfig. Once we remove the
latter we can replace GrSurfaceDesc with SkISize.
Also remove unused GrRenderTarget::overrideResolveRect
Also remove GrSurfaceProxy::Renderable and use GrRenderable instead.
Change-Id: I652fe6169a22ca33d199b144ec6385286ac07b5a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/228570
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrProxyProvider.h b/src/gpu/GrProxyProvider.h
index 838eac8..dd75171 100644
--- a/src/gpu/GrProxyProvider.h
+++ b/src/gpu/GrProxyProvider.h
@@ -73,7 +73,8 @@
* based on the width and height in the GrSurfaceDesc.
*/
sk_sp<GrTextureProxy> createMipMapProxy(const GrBackendFormat&, const GrSurfaceDesc&,
- GrRenderable, GrSurfaceOrigin, SkBudgeted, GrProtected);
+ GrRenderable, int renderTargetSampleCnt,
+ GrSurfaceOrigin, SkBudgeted, GrProtected);
/*
* Creates a new texture proxy for the bitmap, optionally with mip levels generated by the cpu.
@@ -84,15 +85,17 @@
* Create a GrSurfaceProxy without any data.
*/
sk_sp<GrTextureProxy> createProxy(const GrBackendFormat&, const GrSurfaceDesc&, GrRenderable,
- GrSurfaceOrigin, GrMipMapped, SkBackingFit, SkBudgeted,
- GrProtected, GrInternalSurfaceFlags);
+ int renderTargetSampleCnt, GrSurfaceOrigin, GrMipMapped,
+ SkBackingFit, SkBudgeted, GrProtected,
+ GrInternalSurfaceFlags);
sk_sp<GrTextureProxy> createProxy(
const GrBackendFormat& format, const GrSurfaceDesc& desc, GrRenderable renderable,
- GrSurfaceOrigin origin, SkBackingFit fit, SkBudgeted budgeted, GrProtected isProtected,
+ int renderTargetSampleCnt, GrSurfaceOrigin origin, SkBackingFit fit,
+ SkBudgeted budgeted, GrProtected isProtected,
GrInternalSurfaceFlags surfaceFlags = GrInternalSurfaceFlags::kNone) {
- return this->createProxy(format, desc, renderable, origin, GrMipMapped::kNo, fit, budgeted,
- isProtected, surfaceFlags);
+ return this->createProxy(format, desc, renderable, renderTargetSampleCnt, origin,
+ GrMipMapped::kNo, fit, budgeted, isProtected, surfaceFlags);
}
/*
@@ -143,11 +146,6 @@
using LazyInstantiationResult = GrSurfaceProxy::LazyInstantiationResult;
using LazyInstantiateCallback = GrSurfaceProxy::LazyInstantiateCallback;
- enum class Renderable : bool {
- kNo = false,
- kYes = true
- };
-
struct TextureInfo {
GrMipMapped fMipMapped;
GrTextureType fTextureType;
@@ -165,23 +163,27 @@
* callback should cleanup any resources it captured and return an empty sk_sp<GrTextureProxy>.
*/
sk_sp<GrTextureProxy> createLazyProxy(LazyInstantiateCallback&&, const GrBackendFormat&,
- const GrSurfaceDesc&, GrRenderable, GrSurfaceOrigin,
- GrMipMapped, GrInternalSurfaceFlags, SkBackingFit,
- SkBudgeted, GrProtected, LazyInstantiationType);
+ const GrSurfaceDesc&, GrRenderable,
+ int renderTargetSampleCnt, GrSurfaceOrigin, GrMipMapped,
+ GrInternalSurfaceFlags, SkBackingFit, SkBudgeted,
+ GrProtected, LazyInstantiationType);
sk_sp<GrTextureProxy> createLazyProxy(LazyInstantiateCallback&&, const GrBackendFormat&,
- const GrSurfaceDesc&, GrRenderable, GrSurfaceOrigin,
- GrMipMapped, GrInternalSurfaceFlags, SkBackingFit,
- SkBudgeted, GrProtected);
+ const GrSurfaceDesc&, GrRenderable,
+ int renderTargetSampleCnt, GrSurfaceOrigin, GrMipMapped,
+ GrInternalSurfaceFlags, SkBackingFit, SkBudgeted,
+ GrProtected);
sk_sp<GrTextureProxy> createLazyProxy(LazyInstantiateCallback&&, const GrBackendFormat&,
- const GrSurfaceDesc&, GrRenderable, GrSurfaceOrigin,
- GrMipMapped, SkBackingFit, SkBudgeted, GrProtected);
+ const GrSurfaceDesc&, GrRenderable,
+ int renderTargetSampleCnt, GrSurfaceOrigin, GrMipMapped,
+ SkBackingFit, SkBudgeted, GrProtected);
/** A null TextureInfo indicates a non-textureable render target. */
sk_sp<GrRenderTargetProxy> createLazyRenderTargetProxy(LazyInstantiateCallback&&,
const GrBackendFormat&,
const GrSurfaceDesc&,
+ int renderTargetSampleCnt,
GrSurfaceOrigin origin,
GrInternalSurfaceFlags,
const TextureInfo*,
@@ -195,9 +197,9 @@
* (e.g., width, height, getBoundsRect) should be avoided.
*/
static sk_sp<GrTextureProxy> MakeFullyLazyProxy(LazyInstantiateCallback&&,
- const GrBackendFormat&, Renderable, GrProtected,
- GrSurfaceOrigin, GrPixelConfig, const GrCaps&,
- int sampleCnt = 1);
+ const GrBackendFormat&, GrRenderable,
+ int renderTargetSampleCnt, GrProtected,
+ GrSurfaceOrigin, GrPixelConfig, const GrCaps&);
// '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.
@@ -245,6 +247,7 @@
* Create a texture proxy that is backed by an instantiated GrSurface.
*/
sk_sp<GrTextureProxy> testingOnly_createInstantiatedProxy(const GrSurfaceDesc&, GrRenderable,
+ int renderTargetSampleCnt,
GrSurfaceOrigin, SkBackingFit,
SkBudgeted, GrProtected);
sk_sp<GrTextureProxy> testingOnly_createWrapped(sk_sp<GrTexture>, GrSurfaceOrigin);