[graphite] Add getter for default MSAA TextureInfo.

Bug: skia:12466
Change-Id: I663bc5ce12fc15bb4783ab9cf13cd7ccbfd9f9be
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/459876
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This commit is contained in:
Greg Daniel 2021-10-15 10:30:56 -04:00 committed by SkCQ
parent 0e55a137dd
commit 11c4d14d89
3 changed files with 24 additions and 4 deletions

View File

@ -21,11 +21,14 @@ public:
~Caps() override {}
virtual TextureInfo getDefaultSampledTextureInfo(SkColorType,
uint32_t sampleCount,
uint32_t levelCount,
Protected,
Renderable) = 0;
virtual TextureInfo getDefaultMSAATextureInfo(SkColorType,
uint32_t sampleCount,
Protected) = 0;
virtual TextureInfo getDefaultDepthStencilTextureInfo(DepthStencilType,
uint32_t sampleCount,
Protected) = 0;

View File

@ -20,11 +20,14 @@ public:
~Caps() override {}
skgpu::TextureInfo getDefaultSampledTextureInfo(SkColorType,
uint32_t sampleCount,
uint32_t levelCount,
Protected,
Renderable) override;
skgpu::TextureInfo getDefaultMSAATextureInfo(SkColorType,
uint32_t sampleCount,
Protected) override;
skgpu::TextureInfo getDefaultDepthStencilTextureInfo(DepthStencilType,
uint32_t sampleCount,
Protected) override;

View File

@ -223,7 +223,6 @@ void Caps::initFormatTable() {
}
skgpu::TextureInfo Caps::getDefaultSampledTextureInfo(SkColorType colorType,
uint32_t sampleCount,
uint32_t levelCount,
Protected,
Renderable renderable) {
@ -233,7 +232,7 @@ skgpu::TextureInfo Caps::getDefaultSampledTextureInfo(SkColorType colorType,
}
TextureInfo info;
info.fSampleCount = sampleCount;
info.fSampleCount = 1;
info.fLevelCount = levelCount;
info.fFormat = SkColorTypeToFormat(colorType);
info.fUsage = usage;
@ -242,6 +241,21 @@ skgpu::TextureInfo Caps::getDefaultSampledTextureInfo(SkColorType colorType,
return info;
}
skgpu::TextureInfo Caps::getDefaultMSAATextureInfo(SkColorType colorType,
uint32_t sampleCount,
Protected) {
MTLTextureUsage usage = MTLTextureUsageRenderTarget;
TextureInfo info;
info.fSampleCount = sampleCount;
info.fLevelCount = 1;
info.fFormat = SkColorTypeToFormat(colorType);
info.fUsage = usage;
info.fStorageMode = MTLStorageModePrivate;
return info;
}
skgpu::TextureInfo Caps::getDefaultDepthStencilTextureInfo(DepthStencilType depthStencilType,
uint32_t sampleCount,
Protected) {