summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-23 21:43:50 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-23 21:43:50 +0000
commit40e93e58ffd857435bfd509772a621efea1e8746 (patch)
tree733bbccc8eb4dc8c227dacdc9db303e4ffee351c
parent94d557e93368624bad52722bb4c093d4ac5cc1b9 (diff)
downloadchromium_src-40e93e58ffd857435bfd509772a621efea1e8746.zip
chromium_src-40e93e58ffd857435bfd509772a621efea1e8746.tar.gz
chromium_src-40e93e58ffd857435bfd509772a621efea1e8746.tar.bz2
Refactored ggl::SwapBuffers to take the GGL context as an argument.
It was using the context made current with ggl::MakeCurrent before. The new design is more consistent with other SwapBuffers implementations. Already reviewed in a previous CL: http://codereview.chromium.org/2802007/show TEST=try BUG=none TBR=vangelis@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50649 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/renderer/ggl/ggl.cc3
-rw-r--r--chrome/renderer/ggl/ggl.h2
-rw-r--r--chrome/renderer/webgles2context_impl.cc2
-rw-r--r--chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc2
4 files changed, 4 insertions, 5 deletions
diff --git a/chrome/renderer/ggl/ggl.cc b/chrome/renderer/ggl/ggl.cc
index d925fe2..152888f 100644
--- a/chrome/renderer/ggl/ggl.cc
+++ b/chrome/renderer/ggl/ggl.cc
@@ -319,9 +319,8 @@ Context* GetCurrentContext() {
#endif
}
-bool SwapBuffers() {
+bool SwapBuffers(Context* context) {
#if defined(ENABLE_GPU)
- Context* context = GetCurrentContext();
if (!context)
return false;
diff --git a/chrome/renderer/ggl/ggl.h b/chrome/renderer/ggl/ggl.h
index cd02c1f..76bbfcb 100644
--- a/chrome/renderer/ggl/ggl.h
+++ b/chrome/renderer/ggl/ggl.h
@@ -70,7 +70,7 @@ Context* GetCurrentContext();
// last call. For an offscreen context, resolve everything that has been
// rendered since the last call to a copy that can be accessed by the parent
// context.
-bool SwapBuffers();
+bool SwapBuffers(Context* context);
// Destroy the given GGL context.
bool DestroyContext(Context* context);
diff --git a/chrome/renderer/webgles2context_impl.cc b/chrome/renderer/webgles2context_impl.cc
index 374ea13..994d750 100644
--- a/chrome/renderer/webgles2context_impl.cc
+++ b/chrome/renderer/webgles2context_impl.cc
@@ -72,7 +72,7 @@ bool WebGLES2ContextImpl::destroy() {
}
bool WebGLES2ContextImpl::swapBuffers() {
- return ggl::SwapBuffers();
+ return ggl::SwapBuffers(context_);
}
#endif // defined(ENABLE_GPU)
diff --git a/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc b/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc
index 2f91cce..c691b46 100644
--- a/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc
+++ b/chrome/renderer/webgraphicscontext3d_command_buffer_impl.cc
@@ -90,7 +90,7 @@ void WebGraphicsContext3DCommandBufferImpl::reshape(int width, int height) {
// Force a SwapBuffers to get the framebuffer to resize, even though
// we aren't directly rendering from the back buffer yet.
- ggl::SwapBuffers();
+ ggl::SwapBuffers(context_);
#ifdef FLIP_FRAMEBUFFER_VERTICALLY
scanline_.reset(new uint8[width * 4]);