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

Side by Side Diff: src/gpu/GrBufferAllocPool.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/GrBuffer.h ('k') | src/gpu/GrGpu.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 "GrBufferAllocPool.h" 9 #include "GrBufferAllocPool.h"
10 #include "GrBuffer.h" 10 #include "GrBuffer.h"
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 buffer->updateData(fBufferPtr, flushSize); 312 buffer->updateData(fBufferPtr, flushSize);
313 VALIDATE(true); 313 VALIDATE(true);
314 } 314 }
315 315
316 GrBuffer* GrBufferAllocPool::getBuffer(size_t size) { 316 GrBuffer* GrBufferAllocPool::getBuffer(size_t size) {
317 317
318 GrResourceProvider* rp = fGpu->getContext()->resourceProvider(); 318 GrResourceProvider* rp = fGpu->getContext()->resourceProvider();
319 319
320 // Shouldn't have to use this flag (https://bug.skia.org/4156) 320 // Shouldn't have to use this flag (https://bug.skia.org/4156)
321 static const uint32_t kFlags = GrResourceProvider::kNoPendingIO_Flag; 321 static const uint32_t kFlags = GrResourceProvider::kNoPendingIO_Flag;
322 return rp->createBuffer(fBufferType, size, kDynamic_GrAccessPattern, kFlags) ; 322 return rp->createBuffer(size, fBufferType, kDynamic_GrAccessPattern, kFlags) ;
323 } 323 }
324 324
325 //////////////////////////////////////////////////////////////////////////////// 325 ////////////////////////////////////////////////////////////////////////////////
326 326
327 GrVertexBufferAllocPool::GrVertexBufferAllocPool(GrGpu* gpu) 327 GrVertexBufferAllocPool::GrVertexBufferAllocPool(GrGpu* gpu)
328 : GrBufferAllocPool(gpu, kVertex_GrBufferType, MIN_VERTEX_BUFFER_SIZE) { 328 : GrBufferAllocPool(gpu, kVertex_GrBufferType, MIN_VERTEX_BUFFER_SIZE) {
329 } 329 }
330 330
331 void* GrVertexBufferAllocPool::makeSpace(size_t vertexSize, 331 void* GrVertexBufferAllocPool::makeSpace(size_t vertexSize,
332 int vertexCount, 332 int vertexCount,
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 size_t offset = 0; // assign to suppress warning 365 size_t offset = 0; // assign to suppress warning
366 void* ptr = INHERITED::makeSpace(indexCount * sizeof(uint16_t), 366 void* ptr = INHERITED::makeSpace(indexCount * sizeof(uint16_t),
367 sizeof(uint16_t), 367 sizeof(uint16_t),
368 buffer, 368 buffer,
369 &offset); 369 &offset);
370 370
371 SkASSERT(0 == offset % sizeof(uint16_t)); 371 SkASSERT(0 == offset % sizeof(uint16_t));
372 *startIndex = static_cast<int>(offset / sizeof(uint16_t)); 372 *startIndex = static_cast<int>(offset / sizeof(uint16_t));
373 return ptr; 373 return ptr;
374 } 374 }
OLDNEW
« no previous file with comments | « src/gpu/GrBuffer.h ('k') | src/gpu/GrGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698