Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Unified Diff: src/gpu/vk/GrVkRenderTarget.h

Issue 1974983002: Refactor Vulkan image, texture, RTs so that create and getter handles match. (Closed) Base URL: https://skia.googlesource.com/skia.git@fixLayerVersion
Patch Set: nits Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/vk/GrVkPipelineState.cpp ('k') | src/gpu/vk/GrVkRenderTarget.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkRenderTarget.h
diff --git a/src/gpu/vk/GrVkRenderTarget.h b/src/gpu/vk/GrVkRenderTarget.h
index 8c720aef86b061b7d999babf19017e53e358ee17..accc677806194ec5fa432ebec50c2e8d1e8c5f4d 100644
--- a/src/gpu/vk/GrVkRenderTarget.h
+++ b/src/gpu/vk/GrVkRenderTarget.h
@@ -20,7 +20,7 @@ class GrVkGpu;
class GrVkImageView;
class GrVkStencilAttachment;
-struct GrVkTextureInfo;
+struct GrVkImageInfo;
#ifdef SK_BUILD_FOR_WIN
// Windows gives bogus warnings about inheriting asTexture/asRenderTarget via dominance.
@@ -35,15 +35,20 @@ public:
static GrVkRenderTarget* CreateWrappedRenderTarget(GrVkGpu*, const GrSurfaceDesc&,
GrWrapOwnership,
- const GrVkTextureInfo*);
+ const GrVkImageInfo*);
~GrVkRenderTarget() override;
const GrVkFramebuffer* framebuffer() const { return fFramebuffer; }
const GrVkImageView* colorAttachmentView() const { return fColorAttachmentView; }
- const GrVkImage::Resource* msaaImageResource() const { return fMSAAImageResource; }
+ const GrVkResource* msaaImageResource() const {
+ if (fMSAAImage) {
+ return fMSAAImage->fResource;
+ }
+ return nullptr;
+ }
const GrVkImageView* resolveAttachmentView() const { return fResolveAttachmentView; }
- const GrVkImage::Resource* stencilImageResource() const;
+ const GrVkResource* stencilImageResource() const;
const GrVkImageView* stencilAttachmentView() const;
const GrVkRenderPass* simpleRenderPass() const { return fCachedSimpleRenderPass; }
@@ -67,33 +72,18 @@ public:
protected:
GrVkRenderTarget(GrVkGpu* gpu,
- SkBudgeted,
const GrSurfaceDesc& desc,
- const GrVkImage::Resource* imageResource,
- const GrVkImage::Resource* msaaImageResource,
+ const GrVkImageInfo& info,
+ const GrVkImageInfo& msaaInfo,
const GrVkImageView* colorAttachmentView,
- const GrVkImageView* resolveAttachmentView);
+ const GrVkImageView* resolveAttachmentView,
+ GrVkImage::Wrapped wrapped);
GrVkRenderTarget(GrVkGpu* gpu,
const GrSurfaceDesc& desc,
- const GrVkImage::Resource* imageResource,
- const GrVkImage::Resource* msaaImageResource,
+ const GrVkImageInfo& info,
const GrVkImageView* colorAttachmentView,
- const GrVkImageView* resolveAttachmentView);
-
- GrVkRenderTarget(GrVkGpu* gpu,
- SkBudgeted,
- const GrSurfaceDesc& desc,
- const GrVkImage::Resource* imageResource,
- const GrVkImageView* colorAttachmentView);
-
- GrVkRenderTarget(GrVkGpu* gpu,
- const GrSurfaceDesc& desc,
- const GrVkImage::Resource* imageResource,
- const GrVkImageView* colorAttachmentView);
-
- static GrVkRenderTarget* Create(GrVkGpu*, SkBudgeted, const GrSurfaceDesc&,
- const GrVkImage::Resource* imageResource);
+ GrVkImage::Wrapped wrapped);
GrVkGpu* getVkGpu() const;
@@ -110,6 +100,25 @@ protected:
}
private:
+ GrVkRenderTarget(GrVkGpu* gpu,
+ SkBudgeted,
+ const GrSurfaceDesc& desc,
+ const GrVkImageInfo& info,
+ const GrVkImageInfo& msaaInfo,
+ const GrVkImageView* colorAttachmentView,
+ const GrVkImageView* resolveAttachmentView,
+ GrVkImage::Wrapped wrapped);
+
+ GrVkRenderTarget(GrVkGpu* gpu,
+ SkBudgeted,
+ const GrSurfaceDesc& desc,
+ const GrVkImageInfo& info,
+ const GrVkImageView* colorAttachmentView,
+ GrVkImage::Wrapped wrapped);
+
+ static GrVkRenderTarget* Create(GrVkGpu*, SkBudgeted, const GrSurfaceDesc&,
+ const GrVkImageInfo&, GrVkImage::Wrapped wrapped);
+
bool completeStencilAttachment() override;
void createFramebuffer(GrVkGpu* gpu);
@@ -119,7 +128,7 @@ private:
const GrVkFramebuffer* fFramebuffer;
const GrVkImageView* fColorAttachmentView;
- const GrVkImage::Resource* fMSAAImageResource;
+ GrVkImage* fMSAAImage;
const GrVkImageView* fResolveAttachmentView;
int fColorValuesPerPixel;
« no previous file with comments | « src/gpu/vk/GrVkPipelineState.cpp ('k') | src/gpu/vk/GrVkRenderTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698