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

Side by Side Diff: src/gpu/GrGpu.cpp

Issue 1854283004: Track GL buffer state based on unique resource ID (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix for GR_GL_USE_BUFFER_DATA_NULL_HINT=0 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/GrGpu.h ('k') | src/gpu/GrResourceProvider.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 2010 Google Inc. 2 * Copyright 2010 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 8
9 #include "GrGpu.h" 9 #include "GrGpu.h"
10 10
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 if (!this->caps()->isConfigRenderable(desc.fConfig, desc.fSampleCnt > 0)) { 228 if (!this->caps()->isConfigRenderable(desc.fConfig, desc.fSampleCnt > 0)) {
229 return nullptr; 229 return nullptr;
230 } 230 }
231 int maxSize = this->caps()->maxTextureSize(); 231 int maxSize = this->caps()->maxTextureSize();
232 if (desc.fWidth > maxSize || desc.fHeight > maxSize) { 232 if (desc.fWidth > maxSize || desc.fHeight > maxSize) {
233 return nullptr; 233 return nullptr;
234 } 234 }
235 return this->onWrapBackendTextureAsRenderTarget(desc); 235 return this->onWrapBackendTextureAsRenderTarget(desc);
236 } 236 }
237 237
238 GrBuffer* GrGpu::createBuffer(GrBufferType type, size_t size, GrAccessPattern ac cessPattern) { 238 GrBuffer* GrGpu::createBuffer(size_t size, GrBufferType intendedType,
239 GrAccessPattern accessPattern) {
239 this->handleDirtyContext(); 240 this->handleDirtyContext();
240 GrBuffer* buffer = this->onCreateBuffer(type, size, accessPattern); 241 GrBuffer* buffer = this->onCreateBuffer(size, intendedType, accessPattern);
241 if (!this->caps()->reuseScratchBuffers()) { 242 if (!this->caps()->reuseScratchBuffers()) {
242 buffer->resourcePriv().removeScratchKey(); 243 buffer->resourcePriv().removeScratchKey();
243 } 244 }
244 return buffer; 245 return buffer;
245 } 246 }
246 247
247 void GrGpu::clear(const SkIRect& rect, 248 void GrGpu::clear(const SkIRect& rect,
248 GrColor color, 249 GrColor color,
249 GrRenderTarget* renderTarget) { 250 GrRenderTarget* renderTarget) {
250 SkASSERT(renderTarget); 251 SkASSERT(renderTarget);
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 int meshCount) { 481 int meshCount) {
481 if (primProc.numAttribs() > this->caps()->maxVertexAttributes()) { 482 if (primProc.numAttribs() > this->caps()->maxVertexAttributes()) {
482 fStats.incNumFailedDraws(); 483 fStats.incNumFailedDraws();
483 return false; 484 return false;
484 } 485 }
485 this->handleDirtyContext(); 486 this->handleDirtyContext();
486 487
487 this->onDraw(pipeline, primProc, meshes, meshCount); 488 this->onDraw(pipeline, primProc, meshes, meshCount);
488 return true; 489 return true;
489 } 490 }
OLDNEW
« no previous file with comments | « src/gpu/GrGpu.h ('k') | src/gpu/GrResourceProvider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698