summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorgman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-13 20:06:09 +0000
committergman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-01-13 20:06:09 +0000
commita37dd5e0de9f43a27c777a9dde802219b4f0c684 (patch)
treef2d37118d240471ee5caad7daa4b6e8516f889e1 /gpu
parentc5ad3e107f28390f9a822df6a7008e3c52d3c017 (diff)
downloadchromium_src-a37dd5e0de9f43a27c777a9dde802219b4f0c684.zip
chromium_src-a37dd5e0de9f43a27c777a9dde802219b4f0c684.tar.gz
chromium_src-a37dd5e0de9f43a27c777a9dde802219b4f0c684.tar.bz2
Adds a sync to glFinish and SwapBuffers at the
GLES2Implementation level. You can still call these async from a gh GLES2Helper level. Review URL: http://codereview.chromium.org/545041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36160 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rwxr-xr-xgpu/command_buffer/build_gles2_cmd_buffer.py10
-rw-r--r--gpu/command_buffer/client/gles2_implementation.cc10
-rw-r--r--gpu/command_buffer/client/gles2_implementation_autogen.h8
3 files changed, 20 insertions, 8 deletions
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py
index 0c7ff36..4687c4d 100755
--- a/gpu/command_buffer/build_gles2_cmd_buffer.py
+++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -859,6 +859,7 @@ _FUNCTION_INFO = {
'cmd_args': 'GLenum mode, GLsizei count, GLenum type, GLuint index_offset',
},
'EnableVertexAttribArray': {'DecoderFunc': 'DoEnableVertexAttribArray'},
+ 'Finish': {'ImplFunc': False},
'FramebufferRenderbuffer': {'DecoderFunc': 'glFramebufferRenderbufferEXT'},
'FramebufferTexture2D': {'DecoderFunc': 'glFramebufferTexture2DEXT'},
'GenerateMipmap': {'DecoderFunc': 'glGenerateMipmapEXT'},
@@ -954,7 +955,11 @@ _FUNCTION_INFO = {
'cmd_args': 'GLuint indx, GLint size, GLenum type, GLboolean normalized, '
'GLsizei stride, GLuint offset',
},
- 'SwapBuffers': {'DecoderFunc': 'DoSwapBuffers', 'unit_test': False},
+ 'SwapBuffers': {
+ 'ImplFunc': False,
+ 'DecoderFunc': 'DoSwapBuffers',
+ 'unit_test': False,
+ },
}
@@ -1315,7 +1320,8 @@ TEST_F(GLES2DecoderTest, %(name)sInvalidArgs%(arg_index)d_%(value_index)d) {
def WriteGLES2ImplementationHeader(self, func, file):
"""Writes the GLES2 Implemention declaration."""
- if func.can_auto_generate:
+ impl_func = func.GetInfo('ImplFunc')
+ if func.can_auto_generate and (impl_func == None or impl_func == True):
file.Write("%s %s(%s) {\n" %
(func.return_type, func.original_name,
func.MakeTypedOriginalArgString("")))
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 0b1f341..032717d 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -66,6 +66,16 @@ void GLES2Implementation::DrawElements(
helper_->DrawElements(mode, count, type, ToGLuint(indices));
}
+void GLES2Implementation::Finish() {
+ helper_->Finish();
+ WaitForCmd();
+}
+
+void GLES2Implementation::SwapBuffers() {
+ helper_->SwapBuffers();
+ Finish();
+}
+
GLint GLES2Implementation::GetAttribLocation(
GLuint program, const char* name) {
helper_->GetAttribLocationImmediate(
diff --git a/gpu/command_buffer/client/gles2_implementation_autogen.h b/gpu/command_buffer/client/gles2_implementation_autogen.h
index bb7b253..2487f3d 100644
--- a/gpu/command_buffer/client/gles2_implementation_autogen.h
+++ b/gpu/command_buffer/client/gles2_implementation_autogen.h
@@ -199,9 +199,7 @@ void EnableVertexAttribArray(GLuint index) {
helper_->EnableVertexAttribArray(index);
}
-void Finish() {
- helper_->Finish();
-}
+void Finish();
void Flush() {
helper_->Flush();
@@ -652,9 +650,7 @@ void Viewport(GLint x, GLint y, GLsizei width, GLsizei height) {
helper_->Viewport(x, y, width, height);
}
-void SwapBuffers() {
- helper_->SwapBuffers();
-}
+void SwapBuffers();
#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_AUTOGEN_H_