aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-13 15:31:11 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-13 15:31:11 +0000
commit306b2ce0e22e6e906bbe73f339725dc3748e6499 (patch)
tree276320e107dbcf4d2c480f8a619f8a58992edf96 /src/gpu
parentbb51fabc99ab7958d9bd1c60bbc55b3ab61d981e (diff)
Use stream usage for dynamic vertex data.
R=robertphillips@google.com Review URL: https://codereview.chromium.org/12799005 git-svn-id: http://skia.googlecode.com/svn/trunk@8129 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu')
-rw-r--r--src/gpu/gl/GrGLBufferImpl.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gpu/gl/GrGLBufferImpl.cpp b/src/gpu/gl/GrGLBufferImpl.cpp
index 04c90725ae..6867e1383d 100644
--- a/src/gpu/gl/GrGLBufferImpl.cpp
+++ b/src/gpu/gl/GrGLBufferImpl.cpp
@@ -16,6 +16,10 @@
#define VALIDATE() do {} while(false)
#endif
+// GL_STREAM_DRAW triggers an optimization in Chromium's GPU process where a client's vertex buffer
+// objects are implemented as client-side-arrays on tile-deferred architectures.
+#define DYNAMIC_USAGE_PARAM GR_GL_STREAM_DRAW
+
GrGLBufferImpl::GrGLBufferImpl(GrGpuGL* gpu, const Desc& desc, GrGLenum bufferType)
: fDesc(desc)
, fBufferType(bufferType)
@@ -76,7 +80,7 @@ void* GrGLBufferImpl::lock(GrGpuGL* gpu) {
GL_CALL(gpu, BufferData(fBufferType,
fDesc.fSizeInBytes,
NULL,
- fDesc.fDynamic ? GR_GL_DYNAMIC_DRAW : GR_GL_STATIC_DRAW));
+ fDesc.fDynamic ? DYNAMIC_USAGE_PARAM : GR_GL_STATIC_DRAW));
GR_GL_CALL_RET(gpu->glInterface(),
fLockPtr,
MapBuffer(fBufferType, GR_GL_WRITE_ONLY));
@@ -111,7 +115,7 @@ bool GrGLBufferImpl::updateData(GrGpuGL* gpu, const void* src, size_t srcSizeInB
return true;
}
this->bind(gpu);
- GrGLenum usage = fDesc.fDynamic ? GR_GL_DYNAMIC_DRAW : GR_GL_STATIC_DRAW;
+ GrGLenum usage = fDesc.fDynamic ? DYNAMIC_USAGE_PARAM : GR_GL_STATIC_DRAW;
#if GR_GL_USE_BUFFER_DATA_NULL_HINT
if (fDesc.fSizeInBytes == srcSizeInBytes) {