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

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

Issue 1862043002: Refactor to separate backend object lifecycle and GpuResource budget decision (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix unrelated GrBuffer::onGpuMemorySize() lack of override keyword compile error Created 4 years, 8 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/GrVkTexture.cpp ('k') | src/gpu/vk/GrVkTextureRenderTarget.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkTextureRenderTarget.h
diff --git a/src/gpu/vk/GrVkTextureRenderTarget.h b/src/gpu/vk/GrVkTextureRenderTarget.h
index f2580ebf51803a8e5dbd8778a3516d488595a917..e888397cddbbaa036fceb2471e48ec3b9b1b8e73 100644
--- a/src/gpu/vk/GrVkTextureRenderTarget.h
+++ b/src/gpu/vk/GrVkTextureRenderTarget.h
@@ -24,13 +24,13 @@ struct GrVkTextureInfo;
class GrVkTextureRenderTarget: public GrVkTexture, public GrVkRenderTarget {
public:
- static GrVkTextureRenderTarget* CreateNewTextureRenderTarget(GrVkGpu*, const GrSurfaceDesc&,
- GrGpuResource::LifeCycle,
+ static GrVkTextureRenderTarget* CreateNewTextureRenderTarget(GrVkGpu*, SkBudgeted,
+ const GrSurfaceDesc&,
const GrVkImage::ImageDesc&);
static GrVkTextureRenderTarget* CreateWrappedTextureRenderTarget(GrVkGpu*,
const GrSurfaceDesc&,
- GrGpuResource::LifeCycle,
+ GrWrapOwnership,
VkFormat,
const GrVkTextureInfo*);
@@ -47,38 +47,68 @@ protected:
private:
GrVkTextureRenderTarget(GrVkGpu* gpu,
+ SkBudgeted budgeted,
const GrSurfaceDesc& desc,
- GrGpuResource::LifeCycle lifeCycle,
const GrVkImage::Resource* imageResource,
const GrVkImageView* texView,
const GrVkImage::Resource* msaaResource,
const GrVkImageView* colorAttachmentView,
const GrVkImageView* resolveAttachmentView)
- : GrSurface(gpu, lifeCycle, desc)
+ : GrSurface(gpu, desc)
, GrVkImage(imageResource)
- , GrVkTexture(gpu, desc, lifeCycle, imageResource, texView, GrVkTexture::kDerived)
- , GrVkRenderTarget(gpu, desc, lifeCycle, imageResource, msaaResource, colorAttachmentView,
- resolveAttachmentView, GrVkRenderTarget::kDerived) {
- this->registerWithCache();
+ , GrVkTexture(gpu, desc, imageResource, texView)
+ , GrVkRenderTarget(gpu, desc, imageResource, msaaResource, colorAttachmentView,
+ resolveAttachmentView) {
+ this->registerWithCache(budgeted);
}
GrVkTextureRenderTarget(GrVkGpu* gpu,
+ SkBudgeted budgeted,
const GrSurfaceDesc& desc,
- GrGpuResource::LifeCycle lifeCycle,
const GrVkImage::Resource* imageResource,
const GrVkImageView* texView,
const GrVkImageView* colorAttachmentView)
- : GrSurface(gpu, lifeCycle, desc)
+ : GrSurface(gpu, desc)
, GrVkImage(imageResource)
- , GrVkTexture(gpu, desc, lifeCycle, imageResource, texView, GrVkTexture::kDerived)
- , GrVkRenderTarget(gpu, desc, lifeCycle, imageResource, colorAttachmentView,
- GrVkRenderTarget::kDerived) {
- this->registerWithCache();
+ , GrVkTexture(gpu, desc, imageResource, texView)
+ , GrVkRenderTarget(gpu, desc, imageResource, colorAttachmentView) {
+ this->registerWithCache(budgeted);
+ }
+ enum Wrapped { kWrapped };
+ GrVkTextureRenderTarget(GrVkGpu* gpu,
+ Wrapped,
+ const GrSurfaceDesc& desc,
+ const GrVkImage::Resource* imageResource,
+ const GrVkImageView* texView,
+ const GrVkImage::Resource* msaaResource,
+ const GrVkImageView* colorAttachmentView,
+ const GrVkImageView* resolveAttachmentView)
+ : GrSurface(gpu, desc)
+ , GrVkImage(imageResource)
+ , GrVkTexture(gpu, desc, imageResource, texView)
+ , GrVkRenderTarget(gpu, desc, imageResource, msaaResource, colorAttachmentView,
+ resolveAttachmentView) {
+ this->registerWithCacheWrapped();
+ }
+
+ GrVkTextureRenderTarget(GrVkGpu* gpu,
+ Wrapped,
+ const GrSurfaceDesc& desc,
+ const GrVkImage::Resource* imageResource,
+ const GrVkImageView* texView,
+ const GrVkImageView* colorAttachmentView)
+ : GrSurface(gpu, desc)
+ , GrVkImage(imageResource)
+ , GrVkTexture(gpu, desc, imageResource, texView)
+ , GrVkRenderTarget(gpu, desc, imageResource, colorAttachmentView) {
+ this->registerWithCacheWrapped();
}
- static GrVkTextureRenderTarget* Create(GrVkGpu*, const GrSurfaceDesc&,
- GrGpuResource::LifeCycle,
- VkFormat format,
+ template <typename ResourceType>
+ static GrVkTextureRenderTarget* Create(GrVkGpu*,
+ ResourceType,
+ const GrSurfaceDesc&,
+ VkFormat,
const GrVkImage::Resource* imageResource);
// GrGLRenderTarget accounts for the texture's memory and any MSAA renderbuffer's memory.
« no previous file with comments | « src/gpu/vk/GrVkTexture.cpp ('k') | src/gpu/vk/GrVkTextureRenderTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698