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/mock/GrMockGpu.cpp b/src/gpu/mock/GrMockGpu.cpp
index f7c40c4..5de09e7 100644
--- a/src/gpu/mock/GrMockGpu.cpp
+++ b/src/gpu/mock/GrMockGpu.cpp
@@ -143,8 +143,9 @@
}
sk_sp<GrTexture> GrMockGpu::onCreateTexture(const GrSurfaceDesc& desc, GrRenderable renderable,
- SkBudgeted budgeted, GrProtected isProtected,
- const GrMipLevel texels[], int mipLevelCount) {
+ int renderTargetSampleCnt, SkBudgeted budgeted,
+ GrProtected isProtected, const GrMipLevel texels[],
+ int mipLevelCount) {
if (fMockOptions.fFailTextureAllocations) {
return nullptr;
}
@@ -159,7 +160,8 @@
GrMockTextureInfo texInfo(ct, NextInternalTextureID());
if (renderable == GrRenderable::kYes) {
GrMockRenderTargetInfo rtInfo(ct, NextInternalRenderTargetID());
- return sk_sp<GrTexture>(new GrMockTextureRenderTarget(this, budgeted, desc, isProtected,
+ return sk_sp<GrTexture>(new GrMockTextureRenderTarget(this, budgeted, desc,
+ renderTargetSampleCnt, isProtected,
mipMapsStatus, texInfo, rtInfo));
}
return sk_sp<GrTexture>(
@@ -211,8 +213,8 @@
GrMockRenderTargetInfo rtInfo(texInfo.fColorType, NextInternalRenderTargetID());
auto isProtected = GrProtected(tex.isProtected());
- return sk_sp<GrTexture>(new GrMockTextureRenderTarget(this, desc, isProtected, mipMapsStatus,
- texInfo, rtInfo, cacheable));
+ return sk_sp<GrTexture>(new GrMockTextureRenderTarget(
+ this, desc, sampleCnt, isProtected, mipMapsStatus, texInfo, rtInfo, cacheable));
}
sk_sp<GrRenderTarget> GrMockGpu::onWrapBackendRenderTarget(const GrBackendRenderTarget& rt) {
@@ -225,8 +227,8 @@
desc.fConfig = info.pixelConfig();
auto isProtected = GrProtected(rt.isProtected());
- return sk_sp<GrRenderTarget>(
- new GrMockRenderTarget(this, GrMockRenderTarget::kWrapped, desc, isProtected, info));
+ return sk_sp<GrRenderTarget>(new GrMockRenderTarget(this, GrMockRenderTarget::kWrapped, desc,
+ rt.sampleCnt(), isProtected, info));
}
sk_sp<GrRenderTarget> GrMockGpu::onWrapBackendTextureAsRenderTarget(const GrBackendTexture& tex,
@@ -238,14 +240,13 @@
desc.fWidth = tex.width();
desc.fHeight = tex.height();
desc.fConfig = texInfo.pixelConfig();
- desc.fSampleCnt = sampleCnt;
// The client gave us the texture ID but we supply the render target ID.
GrMockRenderTargetInfo rtInfo(texInfo.fColorType, NextInternalRenderTargetID());
auto isProtected = GrProtected(tex.isProtected());
- return sk_sp<GrRenderTarget>(
- new GrMockRenderTarget(this, GrMockRenderTarget::kWrapped, desc, isProtected, rtInfo));
+ return sk_sp<GrRenderTarget>(new GrMockRenderTarget(this, GrMockRenderTarget::kWrapped, desc,
+ sampleCnt, isProtected, rtInfo));
}
sk_sp<GrGpuBuffer> GrMockGpu::onCreateBuffer(size_t sizeInBytes, GrGpuBufferType type,