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

Unified Diff: src/gpu/GrBufferAllocPool.cpp

Issue 1159713006: add context override of GeometryBufferMapThreshold (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: tweaks Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/GrBufferAllocPool.h ('k') | src/gpu/GrCaps.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrBufferAllocPool.cpp
diff --git a/src/gpu/GrBufferAllocPool.cpp b/src/gpu/GrBufferAllocPool.cpp
index db19a5b540a6cf01341acf5c8476531c5fe71ee3..6492527c0373eedb1ea67a3d5a03d24976747068 100644
--- a/src/gpu/GrBufferAllocPool.cpp
+++ b/src/gpu/GrBufferAllocPool.cpp
@@ -57,6 +57,7 @@ GrBufferAllocPool::GrBufferAllocPool(GrGpu* gpu,
*fPreallocBuffers.append() = buffer;
}
}
+ fGeometryBufferMapThreshold = gpu->caps()->geometryBufferMapThreshold();
}
GrBufferAllocPool::~GrBufferAllocPool() {
@@ -288,7 +289,7 @@ bool GrBufferAllocPool::createBlock(size_t requestSize) {
// threshold.
bool attemptMap = block.fBuffer->isCPUBacked();
if (!attemptMap && GrCaps::kNone_MapFlags != fGpu->caps()->mapBufferFlags()) {
- attemptMap = size > GR_GEOM_BUFFER_MAP_THRESHOLD;
+ attemptMap = size > fGeometryBufferMapThreshold;
}
if (attemptMap) {
@@ -332,7 +333,7 @@ void GrBufferAllocPool::flushCpuData(const BufferBlock& block, size_t flushSize)
VALIDATE(true);
if (GrCaps::kNone_MapFlags != fGpu->caps()->mapBufferFlags() &&
- flushSize > GR_GEOM_BUFFER_MAP_THRESHOLD) {
+ flushSize > fGeometryBufferMapThreshold) {
void* data = buffer->map();
if (data) {
memcpy(data, fBufferPtr, flushSize);
« no previous file with comments | « src/gpu/GrBufferAllocPool.h ('k') | src/gpu/GrCaps.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698