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

Side by Side Diff: src/gpu/vk/GrVkImage.h

Issue 2146063008: Dont allocate a new image which already has mip levels, when regenerating vulkan mipmaps (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 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 unified diff | Download patch
« src/gpu/vk/GrVkGpu.cpp ('K') | « src/gpu/vk/GrVkGpu.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef GrVkImage_DEFINED 8 #ifndef GrVkImage_DEFINED
9 #define GrVkImage_DEFINED 9 #define GrVkImage_DEFINED
10 10
(...skipping 25 matching lines...) Expand all
36 fResource = new BorrowedResource(info.fImage, info.fAlloc, info.fIma geTiling); 36 fResource = new BorrowedResource(info.fImage, info.fAlloc, info.fIma geTiling);
37 } else { 37 } else {
38 fResource = new Resource(info.fImage, info.fAlloc, info.fImageTiling ); 38 fResource = new Resource(info.fImage, info.fAlloc, info.fImageTiling );
39 } 39 }
40 } 40 }
41 virtual ~GrVkImage(); 41 virtual ~GrVkImage();
42 42
43 VkImage image() const { return fInfo.fImage; } 43 VkImage image() const { return fInfo.fImage; }
44 const GrVkAlloc& alloc() const { return fInfo.fAlloc; } 44 const GrVkAlloc& alloc() const { return fInfo.fAlloc; }
45 VkFormat imageFormat() const { return fInfo.fFormat; } 45 VkFormat imageFormat() const { return fInfo.fFormat; }
46 uint32_t mipLevels() const { return fInfo.fLevelCount; }
46 const Resource* resource() const { return fResource; } 47 const Resource* resource() const { return fResource; }
47 bool isLinearTiled() const { 48 bool isLinearTiled() const {
48 return SkToBool(VK_IMAGE_TILING_LINEAR == fInfo.fImageTiling); 49 return SkToBool(VK_IMAGE_TILING_LINEAR == fInfo.fImageTiling);
49 } 50 }
50 51
51 VkImageLayout currentLayout() const { return fInfo.fImageLayout; } 52 VkImageLayout currentLayout() const { return fInfo.fImageLayout; }
52 53
53 void setImageLayout(const GrVkGpu* gpu, 54 void setImageLayout(const GrVkGpu* gpu,
54 VkImageLayout newLayout, 55 VkImageLayout newLayout,
55 VkAccessFlags dstAccessMask, 56 VkAccessFlags dstAccessMask,
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 private: 132 private:
132 void freeGPUData(const GrVkGpu* gpu) const override; 133 void freeGPUData(const GrVkGpu* gpu) const override;
133 }; 134 };
134 135
135 const Resource* fResource; 136 const Resource* fResource;
136 137
137 friend class GrVkRenderTarget; 138 friend class GrVkRenderTarget;
138 }; 139 };
139 140
140 #endif 141 #endif
OLDNEW
« src/gpu/vk/GrVkGpu.cpp ('K') | « src/gpu/vk/GrVkGpu.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698