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

Side by Side Diff: src/gpu/gl/GrGLBuffer.cpp

Issue 1862043002: Refactor to separate backend object lifecycle and GpuResource budget decision (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix unrelated GrBuffer::onGpuMemorySize() lack of override keyword compile error Created 4 years, 8 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 | « src/gpu/GrTexture.cpp ('k') | src/gpu/gl/GrGLGpu.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 2016 Google Inc. 2 * Copyright 2016 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 "GrGLBuffer.h" 8 #include "GrGLBuffer.h"
9 #include "GrGLGpu.h" 9 #include "GrGLGpu.h"
10 #include "SkTraceMemoryDump.h" 10 #include "SkTraceMemoryDump.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 fUsage)); 121 fUsage));
122 if (CHECK_ALLOC_ERROR(gpu->glInterface()) != GR_GL_NO_ERROR) { 122 if (CHECK_ALLOC_ERROR(gpu->glInterface()) != GR_GL_NO_ERROR) {
123 GL_CALL(DeleteBuffers(1, &fBufferID)); 123 GL_CALL(DeleteBuffers(1, &fBufferID));
124 fBufferID = 0; 124 fBufferID = 0;
125 } else { 125 } else {
126 fGLSizeInBytes = fSizeInBytes; 126 fGLSizeInBytes = fSizeInBytes;
127 } 127 }
128 } 128 }
129 } 129 }
130 VALIDATE(); 130 VALIDATE();
131 this->registerWithCache(); 131 this->registerWithCache(SkBudgeted::kYes);
132 } 132 }
133 133
134 inline GrGLGpu* GrGLBuffer::glGpu() const { 134 inline GrGLGpu* GrGLBuffer::glGpu() const {
135 SkASSERT(!this->wasDestroyed()); 135 SkASSERT(!this->wasDestroyed());
136 return static_cast<GrGLGpu*>(this->getGpu()); 136 return static_cast<GrGLGpu*>(this->getGpu());
137 } 137 }
138 138
139 inline const GrGLCaps& GrGLBuffer::glCaps() const { 139 inline const GrGLCaps& GrGLBuffer::glCaps() const {
140 return this->glGpu()->glCaps(); 140 return this->glGpu()->glCaps();
141 } 141 }
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 317
318 void GrGLBuffer::validate() const { 318 void GrGLBuffer::validate() const {
319 // The following assert isn't valid when the buffer has been abandoned: 319 // The following assert isn't valid when the buffer has been abandoned:
320 // SkASSERT((0 == fDesc.fID) == (fCPUData)); 320 // SkASSERT((0 == fDesc.fID) == (fCPUData));
321 SkASSERT(0 != fBufferID || 0 == fGLSizeInBytes); 321 SkASSERT(0 != fBufferID || 0 == fGLSizeInBytes);
322 SkASSERT(nullptr == fMapPtr || fCPUData || fGLSizeInBytes <= fSizeInBytes); 322 SkASSERT(nullptr == fMapPtr || fCPUData || fGLSizeInBytes <= fSizeInBytes);
323 SkASSERT(nullptr == fCPUData || nullptr == fMapPtr || fCPUData == fMapPtr); 323 SkASSERT(nullptr == fCPUData || nullptr == fMapPtr || fCPUData == fMapPtr);
324 } 324 }
325 325
326 #endif 326 #endif
OLDNEW
« no previous file with comments | « src/gpu/GrTexture.cpp ('k') | src/gpu/gl/GrGLGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698