diff options
author | mazda@chromium.org <mazda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-10 16:53:25 +0000 |
---|---|---|
committer | mazda@chromium.org <mazda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-04-10 16:53:25 +0000 |
commit | 3349dcf407b0d41d1b540de15f721ed247cbf550 (patch) | |
tree | 496e6feb9957ed6c3c1ebe7e1d2657c6e5c423af /gpu | |
parent | 970b68c5c7d24f444633a2f3fbe0465cfb863081 (diff) | |
download | chromium_src-3349dcf407b0d41d1b540de15f721ed247cbf550.zip chromium_src-3349dcf407b0d41d1b540de15f721ed247cbf550.tar.gz chromium_src-3349dcf407b0d41d1b540de15f721ed247cbf550.tar.bz2 |
Revert 131177 - aura: Change shared context to be offscreen for arm
This change causes Chrome OS to get stuck in the login screen on Lumpy and Stumpy, so it is reverted for now.
BUG=chrome-os-partner:8831
TEST=Manually checked that I can log in successfully
ARM drivers don't like to have 2 EGLSurface on the same Window. So we need to
make the UI shared context offscren.
This also requires the image transport surface to be an "offscreen" GLSurface (a
pbuffer), however the GLES2Decoder needs to be "onscreen" (i.e. it calls
SwapBuffers on the surface instead managing the offscreen buffers itself).
So this decouples the 2 notions of "offscreen".
BUG=chrome-os-partner:8284
TEST=gpu_unittests. Aura chrome --ui-use-gpu-process with poster circle and webgl on tegra, lumpy, desktop GL. Desktop chrome with poster circle and webgl.
Review URL: http://codereview.chromium.org/10007034
TBR=piman@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10031036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131559 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r-- | gpu/command_buffer/service/gles2_cmd_decoder.cc | 52 | ||||
-rw-r--r-- | gpu/command_buffer/service/gles2_cmd_decoder.h | 4 | ||||
-rw-r--r-- | gpu/command_buffer/service/gles2_cmd_decoder_mock.h | 3 | ||||
-rw-r--r-- | gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc | 2 | ||||
-rw-r--r-- | gpu/demos/framework/window.cc | 1 | ||||
-rw-r--r-- | gpu/gles2_conform_support/egl/display.cc | 1 |
6 files changed, 28 insertions, 35 deletions
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index b70ebfc..0a90ec2 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc @@ -471,7 +471,6 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>, // Overridden from GLES2Decoder. virtual bool Initialize(const scoped_refptr<gfx::GLSurface>& surface, const scoped_refptr<gfx::GLContext>& context, - bool offscreen, const gfx::Size& size, const DisallowedFeatures& disallowed_features, const char* allowed_extensions, @@ -1914,7 +1913,6 @@ GLES2DecoderImpl::~GLES2DecoderImpl() { bool GLES2DecoderImpl::Initialize( const scoped_refptr<gfx::GLSurface>& surface, const scoped_refptr<gfx::GLContext>& context, - bool offscreen, const gfx::Size& size, const DisallowedFeatures& disallowed_features, const char* allowed_extensions, @@ -2033,7 +2031,7 @@ bool GLES2DecoderImpl::Initialize( glGetIntegerv(GL_STENCIL_BITS, &v); back_buffer_has_stencil_ = attrib_parser.stencil_size_ != 0 && v > 0; - if (offscreen) { + if (surface_->IsOffscreen()) { if (attrib_parser.samples_ > 0 && attrib_parser.sample_buffers_ > 0 && (context_->HasExtension("GL_EXT_framebuffer_multisample") || context_->HasExtension("GL_ANGLE_framebuffer_multisample"))) { @@ -7612,30 +7610,32 @@ error::Error GLES2DecoderImpl::HandleSwapBuffers( ScopedResolvedFrameBufferBinder binder(this, true, false); return error::kNoError; } else { - ScopedFrameBufferBinder binder(this, - offscreen_target_frame_buffer_->id()); - - if (offscreen_target_buffer_preserved_) { - // Copy the target frame buffer to the saved offscreen texture. - offscreen_saved_color_texture_->Copy( - offscreen_saved_color_texture_->size(), - offscreen_saved_color_format_); - } else { - // Flip the textures in the parent context via the texture manager. - if (!!offscreen_saved_color_texture_info_.get()) - offscreen_saved_color_texture_info_-> - SetServiceId(offscreen_target_color_texture_->id()); - - offscreen_saved_color_texture_.swap(offscreen_target_color_texture_); - offscreen_target_frame_buffer_->AttachRenderTexture( - offscreen_target_color_texture_.get()); - } + if (surface_->IsOffscreen()) { + ScopedFrameBufferBinder binder(this, + offscreen_target_frame_buffer_->id()); - // Ensure the side effects of the copy are visible to the parent - // context. There is no need to do this for ANGLE because it uses a - // single D3D device for all contexts. - if (!IsAngle()) - glFlush(); + if (offscreen_target_buffer_preserved_) { + // Copy the target frame buffer to the saved offscreen texture. + offscreen_saved_color_texture_->Copy( + offscreen_saved_color_texture_->size(), + offscreen_saved_color_format_); + } else { + // Flip the textures in the parent context via the texture manager. + if (!!offscreen_saved_color_texture_info_.get()) + offscreen_saved_color_texture_info_-> + SetServiceId(offscreen_target_color_texture_->id()); + + offscreen_saved_color_texture_.swap(offscreen_target_color_texture_); + offscreen_target_frame_buffer_->AttachRenderTexture( + offscreen_target_color_texture_.get()); + } + + // Ensure the side effects of the copy are visible to the parent + // context. There is no need to do this for ANGLE because it uses a + // single D3D device for all contexts. + if (!IsAngle()) + glFlush(); + } return error::kNoError; } } else { diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.h b/gpu/command_buffer/service/gles2_cmd_decoder.h index 69be3ed..1d1277b 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder.h @@ -87,9 +87,6 @@ class GPU_EXPORT GLES2Decoder : public CommonDecoder { // Parameters: // surface: the GL surface to render to. // context: the GL context to render to. - // offscreen: whether to make the context offscreen or not. When FBO 0 is - // bound, offscreen contexts render to an internal buffer, onscreen ones - // to the surface. // size: the size if the GL context is offscreen. // allowed_extensions: A string in the same format as // glGetString(GL_EXTENSIONS) that lists the extensions this context @@ -98,7 +95,6 @@ class GPU_EXPORT GLES2Decoder : public CommonDecoder { // true if successful. virtual bool Initialize(const scoped_refptr<gfx::GLSurface>& surface, const scoped_refptr<gfx::GLContext>& context, - bool offscreen, const gfx::Size& size, const DisallowedFeatures& disallowed_features, const char* allowed_extensions, diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_mock.h b/gpu/command_buffer/service/gles2_cmd_decoder_mock.h index 649cb46..4b2d13d 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_mock.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_mock.h @@ -32,10 +32,9 @@ class MockGLES2Decoder : public GLES2Decoder { MockGLES2Decoder(); virtual ~MockGLES2Decoder(); - MOCK_METHOD7(Initialize, + MOCK_METHOD6(Initialize, bool(const scoped_refptr<gfx::GLSurface>& surface, const scoped_refptr<gfx::GLContext>& context, - bool offscreen, const gfx::Size& size, const DisallowedFeatures& disallowed_features, const char* allowed_extensions, diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc index 3fb44a3..5754406 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc @@ -199,7 +199,7 @@ void GLES2DecoderTestBase::InitDecoder( decoder_.reset(GLES2Decoder::Create(group_.get())); decoder_->set_log_synthesized_gl_errors(false); decoder_->Initialize( - surface_, context_, false, surface_->GetSize(), DisallowedFeatures(), + surface_, context_, surface_->GetSize(), DisallowedFeatures(), NULL, attribs); decoder_->set_engine(engine_.get()); diff --git a/gpu/demos/framework/window.cc b/gpu/demos/framework/window.cc index 35b6ea9..d5cd3cf 100644 --- a/gpu/demos/framework/window.cc +++ b/gpu/demos/framework/window.cc @@ -94,7 +94,6 @@ bool Window::CreateRenderContext(gfx::AcceleratedWidget hwnd) { std::vector<int32> attribs; if (!decoder_->Initialize(surface_.get(), context_.get(), - surface_->IsOffscreen(), gfx::Size(), gpu::gles2::DisallowedFeatures(), NULL, diff --git a/gpu/gles2_conform_support/egl/display.cc b/gpu/gles2_conform_support/egl/display.cc index bc07fae..d3dbc08 100644 --- a/gpu/gles2_conform_support/egl/display.cc +++ b/gpu/gles2_conform_support/egl/display.cc @@ -112,7 +112,6 @@ EGLSurface Display::CreateWindowSurface(EGLConfig config, std::vector<int32> attribs; if (!decoder_->Initialize(gl_surface_.get(), gl_context_.get(), - gl_surface_->IsOffscreen(), gfx::Size(), gpu::gles2::DisallowedFeatures(), NULL, |