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

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

Issue 2018933004: Add offset to memory allocations (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix tests Created 4 years, 6 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
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 "GrVkTexture.h" 8 #include "GrVkTexture.h"
9 #include "GrVkGpu.h" 9 #include "GrVkGpu.h"
10 #include "GrVkImageView.h" 10 #include "GrVkImageView.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 76
77 return new GrVkTexture(gpu, budgeted, desc, info, imageView); 77 return new GrVkTexture(gpu, budgeted, desc, info, imageView);
78 } 78 }
79 79
80 GrVkTexture* GrVkTexture::CreateWrappedTexture(GrVkGpu* gpu, 80 GrVkTexture* GrVkTexture::CreateWrappedTexture(GrVkGpu* gpu,
81 const GrSurfaceDesc& desc, 81 const GrSurfaceDesc& desc,
82 GrWrapOwnership ownership, 82 GrWrapOwnership ownership,
83 const GrVkImageInfo* info) { 83 const GrVkImageInfo* info) {
84 SkASSERT(info); 84 SkASSERT(info);
85 // Wrapped textures require both image and allocation (because they can be m apped) 85 // Wrapped textures require both image and allocation (because they can be m apped)
86 SkASSERT(VK_NULL_HANDLE != info->fImage && VK_NULL_HANDLE != info->fAlloc); 86 SkASSERT(VK_NULL_HANDLE != info->fImage && VK_NULL_HANDLE != info->fAlloc.fM emory);
87 87
88 const GrVkImageView* imageView = GrVkImageView::Create(gpu, info->fImage, in fo->fFormat, 88 const GrVkImageView* imageView = GrVkImageView::Create(gpu, info->fImage, in fo->fFormat,
89 GrVkImageView::kColor _Type, 89 GrVkImageView::kColor _Type,
90 info->fLevelCount); 90 info->fLevelCount);
91 if (!imageView) { 91 if (!imageView) {
92 return nullptr; 92 return nullptr;
93 } 93 }
94 94
95 GrVkImage::Wrapped wrapped = kBorrow_GrWrapOwnership == ownership ? GrVkImag e::kBorrowed_Wrapped 95 GrVkImage::Wrapped wrapped = kBorrow_GrWrapOwnership == ownership ? GrVkImag e::kBorrowed_Wrapped
96 : GrVkImag e::kAdopted_Wrapped; 96 : GrVkImag e::kAdopted_Wrapped;
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 fLinearTextureView = nullptr; 216 fLinearTextureView = nullptr;
217 } 217 }
218 218
219 this->setNewResource(info.fImage, info.fAlloc); 219 this->setNewResource(info.fImage, info.fAlloc);
220 fTextureView = textureView; 220 fTextureView = textureView;
221 fInfo = info; 221 fInfo = info;
222 this->texturePriv().setMaxMipMapLevel(mipLevels); 222 this->texturePriv().setMaxMipMapLevel(mipLevels);
223 223
224 return true; 224 return true;
225 } 225 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698