diff options
author | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-02 19:39:27 +0000 |
---|---|---|
committer | gman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-02 19:39:27 +0000 |
commit | b0c8acf8a8b6f435510323c0c0435053301d1eed (patch) | |
tree | 42223477168aab89f02b55297a409d78e9eea667 /gpu | |
parent | 558e75cac7639875938c79af6dd415fed9683b22 (diff) | |
download | chromium_src-b0c8acf8a8b6f435510323c0c0435053301d1eed.zip chromium_src-b0c8acf8a8b6f435510323c0c0435053301d1eed.tar.gz chromium_src-b0c8acf8a8b6f435510323c0c0435053301d1eed.tar.bz2 |
Change the GLES2Implementation Flush and Finish functions
to emluate the GLES2 glFlush and glFinish more correctly.
I don't like the fact that the GLES2CmdHelper::Finish
autogeneated from glFinish overrides
CommandBufferHelper::Finish but I'm not sure I'm feeling
like making all those functions start with gl or something
and all the fixes required just to avoid that.
TEST=none
BUG=none
Review URL: http://codereview.chromium.org/561012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37863 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r-- | gpu/command_buffer/client/gles2_implementation.cc | 19 | ||||
-rw-r--r-- | gpu/command_buffer/client/gles2_implementation_autogen.h | 6 |
2 files changed, 17 insertions, 8 deletions
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc index 61639b8..e0cbb04 100644 --- a/gpu/command_buffer/client/gles2_implementation.cc +++ b/gpu/command_buffer/client/gles2_implementation.cc @@ -60,8 +60,7 @@ void GLES2Implementation::CopyResult(void* dst) { } void GLES2Implementation::WaitForCmd() { - int32 token = helper_->InsertToken(); - helper_->WaitForToken(token); + helper_->CommandBufferHelper::Finish(); } void GLES2Implementation::DrawElements( @@ -69,14 +68,26 @@ void GLES2Implementation::DrawElements( helper_->DrawElements(mode, count, type, ToGLuint(indices)); } +void GLES2Implementation::Flush() { + // Insert the cmd to call glFlush + helper_->Flush(); + // Flush our command buffer + // (tell the service to execute upto the flush cmd.) + helper_->CommandBufferHelper::Flush(); +} + void GLES2Implementation::Finish() { + // Insert the cmd to call glFinish helper_->Finish(); - WaitForCmd(); + // Flinish our command buffer + // (tell the service to execute upto the Finish cmd and wait for it to + // execute.) + helper_->CommandBufferHelper::Finish(); } void GLES2Implementation::SwapBuffers() { helper_->SwapBuffers(); - Finish(); + Flush(); } void GLES2Implementation::GetVertexAttribPointerv( diff --git a/gpu/command_buffer/client/gles2_implementation_autogen.h b/gpu/command_buffer/client/gles2_implementation_autogen.h index 2487f3d..2d13968 100644 --- a/gpu/command_buffer/client/gles2_implementation_autogen.h +++ b/gpu/command_buffer/client/gles2_implementation_autogen.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -201,9 +201,7 @@ void EnableVertexAttribArray(GLuint index) { void Finish(); -void Flush() { - helper_->Flush(); -} +void Flush(); void FramebufferRenderbuffer( GLenum target, GLenum attachment, GLenum renderbuffertarget, |