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

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

Issue 1978573003: Add OpenGL context to Viewer. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase to ToT 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;
129 fMapPtr = nullptr; 130 fMapPtr = nullptr;
130 VALIDATE(); 131 VALIDATE();
131 } 132 }
132 133
133 void* GrVkBuffer::vkMap(const GrVkGpu* gpu) { 134 void* GrVkBuffer::vkMap(const GrVkGpu* gpu) {
134 VALIDATE(); 135 VALIDATE();
135 SkASSERT(!this->vkIsMapped()); 136 SkASSERT(!this->vkIsMapped());
136 137
137 if (!fResource->unique()) { 138 if (!fResource->unique()) {
138 // in use by the command buffer, so we need to create a new one 139 // 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
192 VK_CALL(gpu, UnmapMemory(gpu->device(), alloc())); 193 VK_CALL(gpu, UnmapMemory(gpu->device(), alloc()));
193 194
194 return true; 195 return true;
195 } 196 }
196 197
197 void GrVkBuffer::validate() const { 198 void GrVkBuffer::validate() const {
198 SkASSERT(!fResource || kVertex_Type == fDesc.fType || kIndex_Type == fDesc.f Type 199 SkASSERT(!fResource || kVertex_Type == fDesc.fType || kIndex_Type == fDesc.f Type
199 || kCopyRead_Type == fDesc.fType || kCopyWrite_Type == fDesc.fType 200 || kCopyRead_Type == fDesc.fType || kCopyWrite_Type == fDesc.fType
200 || kUniform_Type == fDesc.fType); 201 || kUniform_Type == fDesc.fType);
201 } 202 }
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