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

Unified Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 11415223: gpu: Allow BufferData size=0 for pixel transfer buffer objects. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/gles2_implementation.cc
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 30389fa281a582810a0a090650730048c1a4c846..794d46fcf1eb3f37035554aa556583ac5cda17a6 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -1197,10 +1197,6 @@ void GLES2Implementation::ShaderSource(
void GLES2Implementation::BufferDataHelper(
GLenum target, GLsizeiptr size, const void* data, GLenum usage) {
- if (size == 0) {
greggman 2012/11/30 09:13:15 this removal I understand
- return;
- }
-
if (size < 0) {
SetGLError(GL_INVALID_VALUE, "glBufferData", "size < 0");
return;
@@ -1222,11 +1218,17 @@ void GLES2Implementation::BufferDataHelper(
buffer_tracker_->RemoveBuffer(buffer_id);
}
- // Create new buffer.
- buffer = buffer_tracker_->CreateBuffer(buffer_id, size);
- GPU_DCHECK(buffer);
- if (data)
- memcpy(buffer->address(), data, size);
+ if (size) {
greggman 2012/11/30 09:13:15 this addition I don't understand. It seems like yo
reveman 2012/11/30 09:30:33 Yes, I think you're right. I might need to update
+ // Create new buffer.
+ buffer = buffer_tracker_->CreateBuffer(buffer_id, size);
+ GPU_DCHECK(buffer);
+ if (data)
+ memcpy(buffer->address(), data, size);
+ }
+ return;
+ }
+
+ if (size == 0) {
return;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698