aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrBufferAllocPool.cpp
diff options
context:
space:
mode:
authorGravatar joshualitt <joshualitt@chromium.org>2015-05-29 06:46:47 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-05-29 06:46:47 -0700
commit7224c866321e4222ef452fc0c73ae05283a2227c (patch)
tree4f413c7e679c7a4fd04c966ca6d6b8298e18c349 /src/gpu/GrBufferAllocPool.cpp
parente800657f2f8a42863481f5a4d7b0d698ecd94e4c (diff)
add context override of GeometryBufferMapThreshold
Diffstat (limited to 'src/gpu/GrBufferAllocPool.cpp')
-rw-r--r--src/gpu/GrBufferAllocPool.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gpu/GrBufferAllocPool.cpp b/src/gpu/GrBufferAllocPool.cpp
index db19a5b540..6492527c03 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);