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

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

Issue 1990893002: Revert of Add OpenGL context to Viewer. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | tools/viewer/Viewer.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 "GrVkBuffer.h" 8 #include "GrVkBuffer.h"
9 #include "GrVkGpu.h" 9 #include "GrVkGpu.h"
10 #include "GrVkMemory.h" 10 #include "GrVkMemory.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 void GrVkBuffer::vkRelease(const GrVkGpu* gpu) { 119 void GrVkBuffer::vkRelease(const GrVkGpu* gpu) {
120 VALIDATE(); 120 VALIDATE();
121 fResource->unref(gpu); 121 fResource->unref(gpu);
122 fResource = nullptr; 122 fResource = nullptr;
123 fMapPtr = nullptr; 123 fMapPtr = nullptr;
124 VALIDATE(); 124 VALIDATE();
125 } 125 }
126 126
127 void GrVkBuffer::vkAbandon() { 127 void GrVkBuffer::vkAbandon() {
128 fResource->unrefAndAbandon(); 128 fResource->unrefAndAbandon();
129 fResource = nullptr;
130 fMapPtr = nullptr; 129 fMapPtr = nullptr;
131 VALIDATE(); 130 VALIDATE();
132 } 131 }
133 132
134 void* GrVkBuffer::vkMap(const GrVkGpu* gpu) { 133 void* GrVkBuffer::vkMap(const GrVkGpu* gpu) {
135 VALIDATE(); 134 VALIDATE();
136 SkASSERT(!this->vkIsMapped()); 135 SkASSERT(!this->vkIsMapped());
137 136
138 if (!fResource->unique()) { 137 if (!fResource->unique()) {
139 // in use by the command buffer, so we need to create a new one 138 // in use by the command buffer, so we need to create a new one
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 VK_CALL(gpu, UnmapMemory(gpu->device(), alloc())); 192 VK_CALL(gpu, UnmapMemory(gpu->device(), alloc()));
194 193
195 return true; 194 return true;
196 } 195 }
197 196
198 void GrVkBuffer::validate() const { 197 void GrVkBuffer::validate() const {
199 SkASSERT(!fResource || kVertex_Type == fDesc.fType || kIndex_Type == fDesc.f Type 198 SkASSERT(!fResource || kVertex_Type == fDesc.fType || kIndex_Type == fDesc.f Type
200 || kCopyRead_Type == fDesc.fType || kCopyWrite_Type == fDesc.fType 199 || kCopyRead_Type == fDesc.fType || kCopyWrite_Type == fDesc.fType
201 || kUniform_Type == fDesc.fType); 200 || kUniform_Type == fDesc.fType);
202 } 201 }
OLDNEW
« no previous file with comments | « no previous file | tools/viewer/Viewer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698