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

Side by Side Diff: src/gpu/vk/GrVkTextureRenderTarget.cpp

Issue 2448593002: Remove SkAutoTUnref and SkAutoTDelete from public includes. (Closed)
Patch Set: And Vulcan. Created 4 years, 1 month 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
« no previous file with comments | « src/gpu/vk/GrVkTextureRenderTarget.h ('k') | src/image/SkImage_Gpu.h » ('j') | 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 #include "GrVkTextureRenderTarget.h" 8 #include "GrVkTextureRenderTarget.h"
9 9
10 #include "GrRenderTargetPriv.h" 10 #include "GrRenderTargetPriv.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 } 128 }
129 129
130 GrVkTextureRenderTarget* trt = Create(gpu, desc, info, budgeted, GrVkImage:: kNot_Wrapped); 130 GrVkTextureRenderTarget* trt = Create(gpu, desc, info, budgeted, GrVkImage:: kNot_Wrapped);
131 if (!trt) { 131 if (!trt) {
132 GrVkImage::DestroyImageInfo(gpu, &info); 132 GrVkImage::DestroyImageInfo(gpu, &info);
133 } 133 }
134 134
135 return trt; 135 return trt;
136 } 136 }
137 137
138 GrVkTextureRenderTarget* 138 sk_sp<GrVkTextureRenderTarget>
139 GrVkTextureRenderTarget::CreateWrappedTextureRenderTarget(GrVkGpu* gpu, 139 GrVkTextureRenderTarget::MakeWrappedTextureRenderTarget(GrVkGpu* gpu,
140 const GrSurfaceDesc& d esc, 140 const GrSurfaceDesc& des c,
141 GrWrapOwnership owners hip, 141 GrWrapOwnership ownershi p,
142 const GrVkImageInfo* i nfo) { 142 const GrVkImageInfo* inf o) {
143 SkASSERT(info); 143 SkASSERT(info);
144 // Wrapped textures require both image and allocation (because they can be m apped) 144 // Wrapped textures require both image and allocation (because they can be m apped)
145 SkASSERT(VK_NULL_HANDLE != info->fImage && VK_NULL_HANDLE != info->fAlloc.fM emory); 145 SkASSERT(VK_NULL_HANDLE != info->fImage && VK_NULL_HANDLE != info->fAlloc.fM emory);
146 146
147 GrVkImage::Wrapped wrapped = kBorrow_GrWrapOwnership == ownership ? GrVkImag e::kBorrowed_Wrapped 147 GrVkImage::Wrapped wrapped = kBorrow_GrWrapOwnership == ownership ? GrVkImag e::kBorrowed_Wrapped
148 : GrVkImag e::kAdopted_Wrapped; 148 : GrVkImag e::kAdopted_Wrapped;
149 149
150 GrVkTextureRenderTarget* trt = Create(gpu, desc, *info, SkBudgeted::kNo, wra pped); 150 return sk_sp<GrVkTextureRenderTarget>(Create(gpu, desc, *info, SkBudgeted::k No, wrapped));
151
152 return trt;
153 } 151 }
154 152
155 bool GrVkTextureRenderTarget::updateForMipmap(GrVkGpu* gpu, const GrVkImageInfo& newInfo) { 153 bool GrVkTextureRenderTarget::updateForMipmap(GrVkGpu* gpu, const GrVkImageInfo& newInfo) {
156 VkFormat pixelFormat; 154 VkFormat pixelFormat;
157 GrPixelConfigToVkFormat(fDesc.fConfig, &pixelFormat); 155 GrPixelConfigToVkFormat(fDesc.fConfig, &pixelFormat);
158 if (fDesc.fSampleCnt) { 156 if (fDesc.fSampleCnt) {
159 const GrVkImageView* resolveAttachmentView = 157 const GrVkImageView* resolveAttachmentView =
160 GrVkImageView::Create(gpu, 158 GrVkImageView::Create(gpu,
161 newInfo.fImage, 159 newInfo.fImage,
162 pixelFormat, 160 pixelFormat,
(...skipping 14 matching lines...) Expand all
177 return false; 175 return false;
178 } 176 }
179 fColorAttachmentView->unref(gpu); 177 fColorAttachmentView->unref(gpu);
180 fColorAttachmentView = colorAttachmentView; 178 fColorAttachmentView = colorAttachmentView;
181 } 179 }
182 180
183 this->createFramebuffer(gpu); 181 this->createFramebuffer(gpu);
184 return true; 182 return true;
185 } 183 }
186 184
OLDNEW
« no previous file with comments | « src/gpu/vk/GrVkTextureRenderTarget.h ('k') | src/image/SkImage_Gpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698