Pass size and GrPixelConfig to GrSurface/Texture/RenderTarget constructors
Change-Id: I4421354453a22a0a2853fc3cd64199f76b70c9f2
Bug: skia:6718
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/232556
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Auto-Submit: Brian Salomon <bsalomon@google.com>
diff --git a/src/gpu/GrRenderTarget.cpp b/src/gpu/GrRenderTarget.cpp
index 7777cb6..62935d3 100644
--- a/src/gpu/GrRenderTarget.cpp
+++ b/src/gpu/GrRenderTarget.cpp
@@ -19,9 +19,10 @@
#include "src/gpu/GrStencilAttachment.h"
#include "src/gpu/GrStencilSettings.h"
-GrRenderTarget::GrRenderTarget(GrGpu* gpu, const GrSurfaceDesc& desc, int sampleCount,
- GrProtected isProtected, GrStencilAttachment* stencil)
- : INHERITED(gpu, desc, isProtected)
+GrRenderTarget::GrRenderTarget(GrGpu* gpu, const SkISize& size, GrPixelConfig config,
+ int sampleCount, GrProtected isProtected,
+ GrStencilAttachment* stencil)
+ : INHERITED(gpu, size, config, isProtected)
, fSampleCnt(sampleCount)
, fSamplePatternKey(GrSamplePatternDictionary::kInvalidSamplePatternKey)
, fStencilAttachment(stencil) {
diff --git a/src/gpu/GrTexture.cpp b/src/gpu/GrTexture.cpp
index 627c507..c3dacaa 100644
--- a/src/gpu/GrTexture.cpp
+++ b/src/gpu/GrTexture.cpp
@@ -36,9 +36,9 @@
}
/////////////////////////////////////////////////////////////////////////////
-GrTexture::GrTexture(GrGpu* gpu, const GrSurfaceDesc& desc, GrProtected isProtected,
+GrTexture::GrTexture(GrGpu* gpu, const SkISize& size, GrPixelConfig config, GrProtected isProtected,
GrTextureType textureType, GrMipMapsStatus mipMapsStatus)
- : INHERITED(gpu, desc, isProtected)
+ : INHERITED(gpu, size, config, isProtected)
, fTextureType(textureType)
, fMipMapsStatus(mipMapsStatus) {
if (GrMipMapsStatus::kNotAllocated == fMipMapsStatus) {
diff --git a/src/gpu/dawn/GrDawnRenderTarget.cpp b/src/gpu/dawn/GrDawnRenderTarget.cpp
index 467049d..0a20473 100644
--- a/src/gpu/dawn/GrDawnRenderTarget.cpp
+++ b/src/gpu/dawn/GrDawnRenderTarget.cpp
@@ -16,8 +16,9 @@
int sampleCnt,
const GrDawnImageInfo& info,
GrBackendObjectOwnership ownership)
- : GrSurface(gpu, desc, GrProtected::kNo)
- , GrRenderTarget(gpu, desc, sampleCnt, GrProtected::kNo)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, GrProtected::kNo)
+ , GrRenderTarget(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, sampleCnt,
+ GrProtected::kNo)
, fInfo(info) {
this->registerWithCacheWrapped(GrWrapCacheable::kNo);
}
diff --git a/src/gpu/gl/GrGLRenderTarget.cpp b/src/gpu/gl/GrGLRenderTarget.cpp
index 104b6e9..a7784e9 100644
--- a/src/gpu/gl/GrGLRenderTarget.cpp
+++ b/src/gpu/gl/GrGLRenderTarget.cpp
@@ -25,8 +25,9 @@
GrGLenum format,
const IDDesc& idDesc,
GrGLStencilAttachment* stencil)
- : GrSurface(gpu, desc, GrProtected::kNo)
- , INHERITED(gpu, desc, sampleCount, GrProtected::kNo, stencil) {
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, GrProtected::kNo)
+ , INHERITED(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, sampleCount, GrProtected::kNo,
+ stencil) {
this->setFlags(gpu->glCaps(), idDesc);
this->init(desc, format, idDesc);
this->registerWithCacheWrapped(GrWrapCacheable::kNo);
@@ -34,8 +35,8 @@
GrGLRenderTarget::GrGLRenderTarget(GrGLGpu* gpu, const GrSurfaceDesc& desc, int sampleCount,
GrGLenum format, const IDDesc& idDesc)
- : GrSurface(gpu, desc, GrProtected::kNo)
- , INHERITED(gpu, desc, sampleCount, GrProtected::kNo) {
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, GrProtected::kNo)
+ , INHERITED(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, sampleCount, GrProtected::kNo) {
this->setFlags(gpu->glCaps(), idDesc);
this->init(desc, format, idDesc);
}
diff --git a/src/gpu/gl/GrGLTexture.cpp b/src/gpu/gl/GrGLTexture.cpp
index ff25b38..d5caef5 100644
--- a/src/gpu/gl/GrGLTexture.cpp
+++ b/src/gpu/gl/GrGLTexture.cpp
@@ -47,9 +47,9 @@
// Because this class is virtually derived from GrSurface we must explicitly call its constructor.
GrGLTexture::GrGLTexture(GrGLGpu* gpu, SkBudgeted budgeted, const GrSurfaceDesc& desc,
const IDDesc& idDesc, GrMipMapsStatus mipMapsStatus)
- : GrSurface(gpu, desc, GrProtected::kNo)
- , INHERITED(gpu, desc, GrProtected::kNo, TextureTypeFromTarget(idDesc.fInfo.fTarget),
- mipMapsStatus)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, GrProtected::kNo)
+ , INHERITED(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, GrProtected::kNo,
+ TextureTypeFromTarget(idDesc.fInfo.fTarget), mipMapsStatus)
, fParameters(sk_make_sp<GrGLTextureParameters>()) {
this->init(desc, idDesc);
this->registerWithCache(budgeted);
@@ -61,9 +61,9 @@
GrGLTexture::GrGLTexture(GrGLGpu* gpu, const GrSurfaceDesc& desc, GrMipMapsStatus mipMapsStatus,
const IDDesc& idDesc, sk_sp<GrGLTextureParameters> parameters,
GrWrapCacheable cacheable, GrIOType ioType)
- : GrSurface(gpu, desc, GrProtected::kNo)
- , INHERITED(gpu, desc, GrProtected::kNo, TextureTypeFromTarget(idDesc.fInfo.fTarget),
- mipMapsStatus)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, GrProtected::kNo)
+ , INHERITED(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, GrProtected::kNo,
+ TextureTypeFromTarget(idDesc.fInfo.fTarget), mipMapsStatus)
, fParameters(std::move(parameters)) {
SkASSERT(fParameters);
this->init(desc, idDesc);
@@ -75,9 +75,9 @@
GrGLTexture::GrGLTexture(GrGLGpu* gpu, const GrSurfaceDesc& desc, const IDDesc& idDesc,
sk_sp<GrGLTextureParameters> parameters, GrMipMapsStatus mipMapsStatus)
- : GrSurface(gpu, desc, GrProtected::kNo)
- , INHERITED(gpu, desc, GrProtected::kNo, TextureTypeFromTarget(idDesc.fInfo.fTarget),
- mipMapsStatus) {
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, GrProtected::kNo)
+ , INHERITED(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, GrProtected::kNo,
+ TextureTypeFromTarget(idDesc.fInfo.fTarget), mipMapsStatus) {
SkASSERT(parameters || idDesc.fOwnership == GrBackendObjectOwnership::kOwned);
fParameters = parameters ? std::move(parameters) : sk_make_sp<GrGLTextureParameters>();
this->init(desc, idDesc);
diff --git a/src/gpu/gl/GrGLTextureRenderTarget.cpp b/src/gpu/gl/GrGLTextureRenderTarget.cpp
index de86e9f..35ce13d 100644
--- a/src/gpu/gl/GrGLTextureRenderTarget.cpp
+++ b/src/gpu/gl/GrGLTextureRenderTarget.cpp
@@ -19,7 +19,7 @@
const GrGLTexture::IDDesc& texIDDesc,
const GrGLRenderTarget::IDDesc& rtIDDesc,
GrMipMapsStatus mipMapsStatus)
- : GrSurface(gpu, desc, GrProtected::kNo)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, GrProtected::kNo)
, GrGLTexture(gpu, desc, texIDDesc, nullptr, mipMapsStatus)
, GrGLRenderTarget(gpu, desc, sampleCount, texIDDesc.fInfo.fFormat, rtIDDesc) {
this->registerWithCache(budgeted);
@@ -33,7 +33,7 @@
const GrGLRenderTarget::IDDesc& rtIDDesc,
GrWrapCacheable cacheable,
GrMipMapsStatus mipMapsStatus)
- : GrSurface(gpu, desc, GrProtected::kNo)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, GrProtected::kNo)
, GrGLTexture(gpu, desc, texIDDesc, std::move(parameters), mipMapsStatus)
, GrGLRenderTarget(gpu, desc, sampleCount, texIDDesc.fInfo.fFormat, rtIDDesc) {
this->registerWithCacheWrapped(cacheable);
diff --git a/src/gpu/mock/GrMockTexture.h b/src/gpu/mock/GrMockTexture.h
index 7406ced..5061f2b 100644
--- a/src/gpu/mock/GrMockTexture.h
+++ b/src/gpu/mock/GrMockTexture.h
@@ -51,8 +51,9 @@
// constructor for subclasses
GrMockTexture(GrMockGpu* gpu, const GrSurfaceDesc& desc, GrProtected isProtected,
GrMipMapsStatus mipMapsStatus, const GrMockTextureInfo& info)
- : GrSurface(gpu, desc, isProtected)
- , INHERITED(gpu, desc, isProtected, GrTextureType::k2D, mipMapsStatus)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, isProtected)
+ , INHERITED(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, isProtected,
+ GrTextureType::k2D, mipMapsStatus)
, fInfo(info) {}
void onRelease() override {
@@ -77,8 +78,8 @@
public:
GrMockRenderTarget(GrMockGpu* gpu, SkBudgeted budgeted, const GrSurfaceDesc& desc,
int sampleCnt, GrProtected isProtected, const GrMockRenderTargetInfo& info)
- : GrSurface(gpu, desc, isProtected)
- , INHERITED(gpu, desc, sampleCnt, isProtected)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, isProtected)
+ , INHERITED(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, sampleCnt, isProtected)
, fInfo(info) {
this->registerWithCache(budgeted);
}
@@ -86,8 +87,8 @@
enum Wrapped { kWrapped };
GrMockRenderTarget(GrMockGpu* gpu, Wrapped, const GrSurfaceDesc& desc, int sampleCnt,
GrProtected isProtected, const GrMockRenderTargetInfo& info)
- : GrSurface(gpu, desc, isProtected)
- , INHERITED(gpu, desc, sampleCnt, isProtected)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, isProtected)
+ , INHERITED(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, sampleCnt, isProtected)
, fInfo(info) {
this->registerWithCacheWrapped(GrWrapCacheable::kNo);
}
@@ -122,8 +123,8 @@
// constructor for subclasses
GrMockRenderTarget(GrMockGpu* gpu, const GrSurfaceDesc& desc, int sampleCnt,
GrProtected isProtected, const GrMockRenderTargetInfo& info)
- : GrSurface(gpu, desc, isProtected)
- , INHERITED(gpu, desc, sampleCnt, isProtected)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, isProtected)
+ , INHERITED(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, sampleCnt, isProtected)
, fInfo(info) {}
private:
@@ -139,7 +140,7 @@
int sampleCnt, GrProtected isProtected, GrMipMapsStatus mipMapsStatus,
const GrMockTextureInfo& texInfo,
const GrMockRenderTargetInfo& rtInfo)
- : GrSurface(gpu, desc, isProtected)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, isProtected)
, GrMockTexture(gpu, desc, isProtected, mipMapsStatus, texInfo)
, GrMockRenderTarget(gpu, desc, sampleCnt, isProtected, rtInfo) {
this->registerWithCache(budgeted);
@@ -150,7 +151,7 @@
GrProtected isProtected, GrMipMapsStatus mipMapsStatus,
const GrMockTextureInfo& texInfo,
const GrMockRenderTargetInfo& rtInfo, GrWrapCacheable cacheble)
- : GrSurface(gpu, desc, isProtected)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, isProtected)
, GrMockTexture(gpu, desc, isProtected, mipMapsStatus, texInfo)
, GrMockRenderTarget(gpu, desc, sampleCnt, isProtected, rtInfo) {
this->registerWithCacheWrapped(cacheble);
diff --git a/src/gpu/mtl/GrMtlRenderTarget.mm b/src/gpu/mtl/GrMtlRenderTarget.mm
index 123715b..4fd6104 100644
--- a/src/gpu/mtl/GrMtlRenderTarget.mm
+++ b/src/gpu/mtl/GrMtlRenderTarget.mm
@@ -21,8 +21,9 @@
id<MTLTexture> colorTexture,
id<MTLTexture> resolveTexture,
Wrapped)
- : GrSurface(gpu, desc, GrProtected::kNo)
- , GrRenderTarget(gpu, desc, sampleCnt, GrProtected::kNo)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, GrProtected::kNo)
+ , GrRenderTarget(
+ gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, sampleCnt, GrProtected::kNo)
, fColorTexture(colorTexture)
, fResolveTexture(resolveTexture) {
SkASSERT(sampleCnt > 1);
@@ -33,8 +34,8 @@
const GrSurfaceDesc& desc,
id<MTLTexture> colorTexture,
Wrapped)
- : GrSurface(gpu, desc, GrProtected::kNo)
- , GrRenderTarget(gpu, desc, 1, GrProtected::kNo)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, GrProtected::kNo)
+ , GrRenderTarget(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, 1, GrProtected::kNo)
, fColorTexture(colorTexture)
, fResolveTexture(nil) {
this->registerWithCacheWrapped(GrWrapCacheable::kNo);
@@ -46,8 +47,9 @@
int sampleCnt,
id<MTLTexture> colorTexture,
id<MTLTexture> resolveTexture)
- : GrSurface(gpu, desc, GrProtected::kNo)
- , GrRenderTarget(gpu, desc, sampleCnt, GrProtected::kNo)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, GrProtected::kNo)
+ , GrRenderTarget(
+ gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, sampleCnt, GrProtected::kNo)
, fColorTexture(colorTexture)
, fResolveTexture(resolveTexture) {
SkASSERT(sampleCnt > 1);
@@ -56,8 +58,8 @@
GrMtlRenderTarget::GrMtlRenderTarget(GrMtlGpu* gpu,
const GrSurfaceDesc& desc,
id<MTLTexture> colorTexture)
- : GrSurface(gpu, desc, GrProtected::kNo)
- , GrRenderTarget(gpu, desc, 1, GrProtected::kNo)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, GrProtected::kNo)
+ , GrRenderTarget(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, 1, GrProtected::kNo)
, fColorTexture(colorTexture)
, fResolveTexture(nil) {}
diff --git a/src/gpu/mtl/GrMtlTexture.mm b/src/gpu/mtl/GrMtlTexture.mm
index 6b27862..a55b066 100644
--- a/src/gpu/mtl/GrMtlTexture.mm
+++ b/src/gpu/mtl/GrMtlTexture.mm
@@ -20,8 +20,9 @@
const GrSurfaceDesc& desc,
id<MTLTexture> texture,
GrMipMapsStatus mipMapsStatus)
- : GrSurface(gpu, desc, GrProtected::kNo)
- , INHERITED(gpu, desc, GrProtected::kNo, GrTextureType::k2D, mipMapsStatus)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, GrProtected::kNo)
+ , INHERITED(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, GrProtected::kNo,
+ GrTextureType::k2D, mipMapsStatus)
, fTexture(texture) {
SkASSERT((GrMipMapsStatus::kNotAllocated == mipMapsStatus) == (1 == texture.mipmapLevelCount));
this->registerWithCache(budgeted);
@@ -34,8 +35,9 @@
GrMipMapsStatus mipMapsStatus,
GrWrapCacheable cacheable,
GrIOType ioType)
- : GrSurface(gpu, desc, GrProtected::kNo)
- , INHERITED(gpu, desc, GrProtected::kNo, GrTextureType::k2D, mipMapsStatus)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, GrProtected::kNo)
+ , INHERITED(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, GrProtected::kNo,
+ GrTextureType::k2D, mipMapsStatus)
, fTexture(texture) {
SkASSERT((GrMipMapsStatus::kNotAllocated == mipMapsStatus) == (1 == texture.mipmapLevelCount));
if (ioType == kRead_GrIOType) {
@@ -48,8 +50,9 @@
const GrSurfaceDesc& desc,
id<MTLTexture> texture,
GrMipMapsStatus mipMapsStatus)
- : GrSurface(gpu, desc, GrProtected::kNo)
- , INHERITED(gpu, desc, GrProtected::kNo, GrTextureType::k2D, mipMapsStatus)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, GrProtected::kNo)
+ , INHERITED(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, GrProtected::kNo,
+ GrTextureType::k2D, mipMapsStatus)
, fTexture(texture) {
SkASSERT((GrMipMapsStatus::kNotAllocated == mipMapsStatus) == (1 == texture.mipmapLevelCount));
}
diff --git a/src/gpu/mtl/GrMtlTextureRenderTarget.mm b/src/gpu/mtl/GrMtlTextureRenderTarget.mm
index 768b57d..593a970 100644
--- a/src/gpu/mtl/GrMtlTextureRenderTarget.mm
+++ b/src/gpu/mtl/GrMtlTextureRenderTarget.mm
@@ -20,7 +20,7 @@
id<MTLTexture> colorTexture,
id<MTLTexture> resolveTexture,
GrMipMapsStatus mipMapsStatus)
- : GrSurface(gpu, desc, GrProtected::kNo)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, GrProtected::kNo)
, GrMtlTexture(gpu, desc, resolveTexture, mipMapsStatus)
, GrMtlRenderTarget(gpu, desc, sampleCnt, colorTexture, resolveTexture) {
this->registerWithCache(budgeted);
@@ -31,7 +31,7 @@
const GrSurfaceDesc& desc,
id<MTLTexture> colorTexture,
GrMipMapsStatus mipMapsStatus)
- : GrSurface(gpu, desc, GrProtected::kNo)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, GrProtected::kNo)
, GrMtlTexture(gpu, desc, colorTexture, mipMapsStatus)
, GrMtlRenderTarget(gpu, desc, colorTexture) {
this->registerWithCache(budgeted);
@@ -44,7 +44,7 @@
id<MTLTexture> resolveTexture,
GrMipMapsStatus mipMapsStatus,
GrWrapCacheable cacheable)
- : GrSurface(gpu, desc, GrProtected::kNo)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, GrProtected::kNo)
, GrMtlTexture(gpu, desc, resolveTexture, mipMapsStatus)
, GrMtlRenderTarget(gpu, desc, sampleCnt, colorTexture, resolveTexture) {
this->registerWithCacheWrapped(cacheable);
@@ -55,7 +55,7 @@
id<MTLTexture> colorTexture,
GrMipMapsStatus mipMapsStatus,
GrWrapCacheable cacheable)
- : GrSurface(gpu, desc, GrProtected::kNo)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, GrProtected::kNo)
, GrMtlTexture(gpu, desc, colorTexture, mipMapsStatus)
, GrMtlRenderTarget(gpu, desc, colorTexture) {
this->registerWithCacheWrapped(cacheable);
diff --git a/src/gpu/vk/GrVkRenderTarget.cpp b/src/gpu/vk/GrVkRenderTarget.cpp
index b57e4d0..788362b 100644
--- a/src/gpu/vk/GrVkRenderTarget.cpp
+++ b/src/gpu/vk/GrVkRenderTarget.cpp
@@ -31,10 +31,10 @@
sk_sp<GrVkImageLayout> msaaLayout,
const GrVkImageView* colorAttachmentView,
const GrVkImageView* resolveAttachmentView)
- : GrSurface(gpu, desc, info.fProtected)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, info.fProtected)
, GrVkImage(info, std::move(layout), GrBackendObjectOwnership::kBorrowed)
// for the moment we only support 1:1 color to stencil
- , GrRenderTarget(gpu, desc, sampleCnt, info.fProtected)
+ , GrRenderTarget(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, sampleCnt, info.fProtected)
, fColorAttachmentView(colorAttachmentView)
, fMSAAImage(new GrVkImage(msaaInfo, std::move(msaaLayout),
GrBackendObjectOwnership::kOwned))
@@ -59,13 +59,13 @@
const GrVkImageView* colorAttachmentView,
const GrVkImageView* resolveAttachmentView,
GrBackendObjectOwnership ownership)
- : GrSurface(gpu, desc, info.fProtected)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, info.fProtected)
, GrVkImage(info, std::move(layout), ownership)
// for the moment we only support 1:1 color to stencil
- , GrRenderTarget(gpu, desc, sampleCnt, info.fProtected)
+ , GrRenderTarget(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, sampleCnt, info.fProtected)
, fColorAttachmentView(colorAttachmentView)
- , fMSAAImage(new GrVkImage(msaaInfo, std::move(msaaLayout),
- GrBackendObjectOwnership::kOwned))
+ , fMSAAImage(
+ new GrVkImage(msaaInfo, std::move(msaaLayout), GrBackendObjectOwnership::kOwned))
, fResolveAttachmentView(resolveAttachmentView)
, fFramebuffer(nullptr)
, fCachedSimpleRenderPass(nullptr) {
@@ -81,9 +81,9 @@
const GrVkImageInfo& info,
sk_sp<GrVkImageLayout> layout,
const GrVkImageView* colorAttachmentView)
- : GrSurface(gpu, desc, info.fProtected)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, info.fProtected)
, GrVkImage(info, std::move(layout), GrBackendObjectOwnership::kBorrowed)
- , GrRenderTarget(gpu, desc, 1, info.fProtected)
+ , GrRenderTarget(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, 1, info.fProtected)
, fColorAttachmentView(colorAttachmentView)
, fMSAAImage(nullptr)
, fResolveAttachmentView(nullptr)
@@ -101,9 +101,9 @@
sk_sp<GrVkImageLayout> layout,
const GrVkImageView* colorAttachmentView,
GrBackendObjectOwnership ownership)
- : GrSurface(gpu, desc, info.fProtected)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, info.fProtected)
, GrVkImage(info, std::move(layout), ownership)
- , GrRenderTarget(gpu, desc, 1, info.fProtected)
+ , GrRenderTarget(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, 1, info.fProtected)
, fColorAttachmentView(colorAttachmentView)
, fMSAAImage(nullptr)
, fResolveAttachmentView(nullptr)
@@ -118,9 +118,9 @@
sk_sp<GrVkImageLayout> layout,
const GrVkRenderPass* renderPass,
VkCommandBuffer secondaryCommandBuffer)
- : GrSurface(gpu, desc, info.fProtected)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, info.fProtected)
, GrVkImage(info, std::move(layout), GrBackendObjectOwnership::kBorrowed, true)
- , GrRenderTarget(gpu, desc, 1, info.fProtected)
+ , GrRenderTarget(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, 1, info.fProtected)
, fColorAttachmentView(nullptr)
, fMSAAImage(nullptr)
, fResolveAttachmentView(nullptr)
diff --git a/src/gpu/vk/GrVkTexture.cpp b/src/gpu/vk/GrVkTexture.cpp
index d30a3bd..d42af7b 100644
--- a/src/gpu/vk/GrVkTexture.cpp
+++ b/src/gpu/vk/GrVkTexture.cpp
@@ -25,9 +25,10 @@
sk_sp<GrVkImageLayout> layout,
const GrVkImageView* view,
GrMipMapsStatus mipMapsStatus)
- : GrSurface(gpu, desc, info.fProtected)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, info.fProtected)
, GrVkImage(info, std::move(layout), GrBackendObjectOwnership::kOwned)
- , INHERITED(gpu, desc, info.fProtected, GrTextureType::k2D, mipMapsStatus)
+ , INHERITED(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, info.fProtected,
+ GrTextureType::k2D, mipMapsStatus)
, fTextureView(view) {
SkASSERT((GrMipMapsStatus::kNotAllocated == mipMapsStatus) == (1 == info.fLevelCount));
this->registerWithCache(budgeted);
@@ -40,9 +41,10 @@
sk_sp<GrVkImageLayout> layout, const GrVkImageView* view,
GrMipMapsStatus mipMapsStatus, GrBackendObjectOwnership ownership,
GrWrapCacheable cacheable, GrIOType ioType)
- : GrSurface(gpu, desc, info.fProtected)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, info.fProtected)
, GrVkImage(info, std::move(layout), ownership)
- , INHERITED(gpu, desc, info.fProtected, GrTextureType::k2D, mipMapsStatus)
+ , INHERITED(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, info.fProtected,
+ GrTextureType::k2D, mipMapsStatus)
, fTextureView(view) {
SkASSERT((GrMipMapsStatus::kNotAllocated == mipMapsStatus) == (1 == info.fLevelCount));
if (ioType == kRead_GrIOType) {
@@ -59,9 +61,10 @@
const GrVkImageView* view,
GrMipMapsStatus mipMapsStatus,
GrBackendObjectOwnership ownership)
- : GrSurface(gpu, desc, info.fProtected)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, info.fProtected)
, GrVkImage(info, layout, ownership)
- , INHERITED(gpu, desc, info.fProtected, GrTextureType::k2D, mipMapsStatus)
+ , INHERITED(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, info.fProtected,
+ GrTextureType::k2D, mipMapsStatus)
, fTextureView(view) {
SkASSERT((GrMipMapsStatus::kNotAllocated == mipMapsStatus) == (1 == info.fLevelCount));
}
diff --git a/src/gpu/vk/GrVkTextureRenderTarget.cpp b/src/gpu/vk/GrVkTextureRenderTarget.cpp
index dc93aaa..2288db2 100644
--- a/src/gpu/vk/GrVkTextureRenderTarget.cpp
+++ b/src/gpu/vk/GrVkTextureRenderTarget.cpp
@@ -30,7 +30,7 @@
const GrVkImageView* colorAttachmentView,
const GrVkImageView* resolveAttachmentView,
GrMipMapsStatus mipMapsStatus)
- : GrSurface(gpu, desc, info.fProtected)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, info.fProtected)
, GrVkImage(info, layout, GrBackendObjectOwnership::kOwned)
, GrVkTexture(gpu, desc, info, layout, texView, mipMapsStatus,
GrBackendObjectOwnership::kOwned)
@@ -49,7 +49,7 @@
const GrVkImageView* texView,
const GrVkImageView* colorAttachmentView,
GrMipMapsStatus mipMapsStatus)
- : GrSurface(gpu, desc, info.fProtected)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, info.fProtected)
, GrVkImage(info, layout, GrBackendObjectOwnership::kOwned)
, GrVkTexture(gpu, desc, info, layout, texView, mipMapsStatus,
GrBackendObjectOwnership::kOwned)
@@ -71,7 +71,7 @@
GrMipMapsStatus mipMapsStatus,
GrBackendObjectOwnership ownership,
GrWrapCacheable cacheable)
- : GrSurface(gpu, desc, info.fProtected)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, info.fProtected)
, GrVkImage(info, layout, ownership)
, GrVkTexture(gpu, desc, info, layout, texView, mipMapsStatus, ownership)
, GrVkRenderTarget(gpu, desc, sampleCnt, info, layout, msaaInfo, std::move(msaaLayout),
@@ -89,7 +89,7 @@
GrMipMapsStatus mipMapsStatus,
GrBackendObjectOwnership ownership,
GrWrapCacheable cacheable)
- : GrSurface(gpu, desc, info.fProtected)
+ : GrSurface(gpu, {desc.fWidth, desc.fHeight}, desc.fConfig, info.fProtected)
, GrVkImage(info, layout, ownership)
, GrVkTexture(gpu, desc, info, layout, texView, mipMapsStatus, ownership)
, GrVkRenderTarget(gpu, desc, info, layout, colorAttachmentView, ownership) {