diff options
author | boliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-31 21:00:59 +0000 |
---|---|---|
committer | boliu@chromium.org <boliu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-31 21:00:59 +0000 |
commit | cffe9fc32aa73f36a6c8c445f0c8a9bb646aa789 (patch) | |
tree | 275714626fa73861880956fa0ef72861afc5476f /content | |
parent | f9ac67759c31da2ed8e1d8e2e2295908451a63c5 (diff) | |
download | chromium_src-cffe9fc32aa73f36a6c8c445f0c8a9bb646aa789.zip chromium_src-cffe9fc32aa73f36a6c8c445f0c8a9bb646aa789.tar.gz chromium_src-cffe9fc32aa73f36a6c8c445f0c8a9bb646aa789.tar.bz2 |
Release context to force GL state restore before draw
Eventually when we no longer have MakeCurrent calls outside of
draw, we will move this release to the end of draw to make it
more "correct".
BUG=230195
Review URL: https://chromiumcodereview.appspot.com/15715023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@203471 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/android/in_process/synchronous_compositor_output_surface.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/content/browser/android/in_process/synchronous_compositor_output_surface.cc b/content/browser/android/in_process/synchronous_compositor_output_surface.cc index cb8ab2a..d5876e4 100644 --- a/content/browser/android/in_process/synchronous_compositor_output_surface.cc +++ b/content/browser/android/in_process/synchronous_compositor_output_surface.cc @@ -23,6 +23,7 @@ #include "ui/gfx/rect_conversions.h" #include "ui/gfx/skia_util.h" #include "ui/gfx/transform.h" +#include "ui/gl/gl_context.h" #include "webkit/common/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h" using webkit::gpu::WebGraphicsContext3DInProcessCommandBufferImpl; @@ -183,6 +184,15 @@ bool SynchronousCompositorOutputSurface::DemandDrawHw( gfx::Rect damage_area) { DCHECK(CalledOnValidThread()); DCHECK(client_); + DCHECK(context3d()); + + // Force a GL state restore next time a GLContextVirtual is made current. + // TODO(boliu): Move this to the end of this function after we have fixed + // all cases of MakeCurrent calls outside of draws. Tracked in + // crbug.com/239856. + gfx::GLContext* current_context = gfx::GLContext::GetCurrent(); + if (current_context) + current_context->ReleaseCurrent(NULL); did_swap_buffer_ = false; |