diff options
author | 2011-07-01 15:21:59 +0000 | |
---|---|---|
committer | 2011-07-01 15:21:59 +0000 | |
commit | 9ae4429f9d3ab837ff9352261271974715cabb8a (patch) | |
tree | 7806bad5226d837fac6fc19ea4064ebcd40e5225 /gpu/include | |
parent | ee435122d7dcb9cd4be4524004b0de282c42848b (diff) |
Don't send NULL buffer data hint in chrome
Review URL: http://codereview.appspot.com/4657067/
git-svn-id: http://skia.googlecode.com/svn/trunk@1778 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gpu/include')
-rw-r--r-- | gpu/include/GrGLConfig.h | 14 | ||||
-rw-r--r-- | gpu/include/GrGLConfig_chrome.h | 4 |
2 files changed, 18 insertions, 0 deletions
diff --git a/gpu/include/GrGLConfig.h b/gpu/include/GrGLConfig.h index b4ca78cee5..e59fe553cf 100644 --- a/gpu/include/GrGLConfig.h +++ b/gpu/include/GrGLConfig.h @@ -65,6 +65,16 @@ * Setting this build flag enables this behavior. GR_GL_NO_CONSTANT_ATTRIBUTES * must not be set since this uses constant attributes for the matrices. * Defaults to 0. + * + * GR_GL_USE_BUFFER_DATA_NULL_HINT: When specifing new data for a vertex/index + * buffer that replaces old data Ganesh can give a hint to the driver that the + * previous data will not be used in future draws like this: + * glBufferData(GL_..._BUFFER, size, NULL, usage); //<--hint, NULL means + * glBufferSubData(GL_..._BUFFER, 0, lessThanSize, data) // old data can't be + * // used again. + * However, this can cause a performance decrease on Chrome cmd buffer because + * it will create a new allocation and memset the whole thing to zero (for + * security reasons). Defaults to 1 (enabled). */ #if !defined(GR_GL_LOG_CALLS) @@ -91,6 +101,10 @@ #define GR_GL_ATTRIBUTE_MATRICES 0 #endif +#if !defined(GR_GL_USE_BUFFER_DATA_NULL_HINT) + #define GR_GL_USE_BUFFER_DATA_NULL_HINT 1 +#endif + #if(GR_GL_NO_CONSTANT_ATTRIBUTES) && (GR_GL_ATTRIBUTE_MATRICES) #error "Cannot combine GR_GL_NO_CONSTANT_ATTRIBUTES and GR_GL_ATTRIBUTE_MATRICES" #endif diff --git a/gpu/include/GrGLConfig_chrome.h b/gpu/include/GrGLConfig_chrome.h index 738e80186b..9c25cb254a 100644 --- a/gpu/include/GrGLConfig_chrome.h +++ b/gpu/include/GrGLConfig_chrome.h @@ -10,4 +10,8 @@ // ANGLE creates a temp VB for vertex attributes not specified per-vertex. #define GR_GL_NO_CONSTANT_ATTRIBUTES GR_WIN32_BUILD +// cmd buffer allocates memory and memsets it to zero when it sees glBufferData +// with NULL. +#define GR_GL_USE_BUFFER_DATA_NULL_HINT 0 + #endif |