diff options
author | antonm@chromium.org <antonm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-12 13:37:32 +0000 |
---|---|---|
committer | antonm@chromium.org <antonm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-12 13:37:32 +0000 |
commit | 82642bb1c9402e67e46e0a48bdc075fd505fa36d (patch) | |
tree | cdbf1eea862acdbc63634ba23e3a8b921bbf72bf /gpu | |
parent | cc12116ee5640dcca9507900f259ed6d6ed4542b (diff) | |
download | chromium_src-82642bb1c9402e67e46e0a48bdc075fd505fa36d.zip chromium_src-82642bb1c9402e67e46e0a48bdc075fd505fa36d.tar.gz chromium_src-82642bb1c9402e67e46e0a48bdc075fd505fa36d.tar.bz2 |
Revert "Reland 85013 - Split GLContext::Create*GLContext into GLSurface::Create*GLSurface plus a
surface type independent GLContext::CreateGLContext".
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85124 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r-- | gpu/command_buffer/client/gles2_demo.cc | 4 | ||||
-rw-r--r-- | gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc | 2 | ||||
-rw-r--r-- | gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h | 2 | ||||
-rw-r--r-- | gpu/command_buffer/service/gpu_scheduler_linux.cc | 22 | ||||
-rw-r--r-- | gpu/command_buffer/service/gpu_scheduler_mac.cc | 17 | ||||
-rw-r--r-- | gpu/command_buffer/service/gpu_scheduler_win.cc | 26 | ||||
-rw-r--r-- | gpu/demos/framework/main_exe.cc | 4 |
7 files changed, 22 insertions, 55 deletions
diff --git a/gpu/command_buffer/client/gles2_demo.cc b/gpu/command_buffer/client/gles2_demo.cc index 78768dd..54a3b89 100644 --- a/gpu/command_buffer/client/gles2_demo.cc +++ b/gpu/command_buffer/client/gles2_demo.cc @@ -25,7 +25,7 @@ #include "gpu/command_buffer/client/gles2_lib.h" #include "gpu/command_buffer/client/gles2_demo_c.h" #include "gpu/command_buffer/client/gles2_demo_cc.h" -#include "ui/gfx/gl/gl_surface.h" +#include "ui/gfx/gl/gl_context.h" using base::SharedMemory; using gpu::Buffer; @@ -212,7 +212,7 @@ int main(int argc, char** argv) { base::AtExitManager at_exit_manager; MessageLoopForUI message_loop; - gfx::GLSurface::InitializeOneOff(); + gfx::GLContext::InitializeOneOff(); GLES2Demo* demo = new GLES2Demo(); 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 40cb373..f302aa3 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.cc @@ -126,7 +126,7 @@ void GLES2DecoderTestBase::InitDecoder( shared_memory_id_ = kSharedMemoryId; shared_memory_base_ = buffer.ptr; - context_ = new gfx::GLContextStub; + context_ = new gfx::StubGLContext; context_->SetSize(gfx::Size(kBackBufferWidth, kBackBufferHeight)); decoder_.reset(GLES2Decoder::Create(group_.get())); diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h index 72a5e71..2d027f7 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h +++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h @@ -255,7 +255,7 @@ class GLES2DecoderTestBase : public testing::Test { // Use StrictMock to make 100% sure we know how GL will be called. scoped_ptr< ::testing::StrictMock< ::gfx::MockGLInterface> > gl_; - gfx::GLContextStub* context_; + gfx::StubGLContext* context_; scoped_ptr<GLES2Decoder> decoder_; GLuint client_buffer_id_; diff --git a/gpu/command_buffer/service/gpu_scheduler_linux.cc b/gpu/command_buffer/service/gpu_scheduler_linux.cc index 265c976..48ed470 100644 --- a/gpu/command_buffer/service/gpu_scheduler_linux.cc +++ b/gpu/command_buffer/service/gpu_scheduler_linux.cc @@ -4,7 +4,6 @@ #include "gpu/command_buffer/service/gpu_scheduler.h" #include "ui/gfx/gl/gl_context.h" -#include "ui/gfx/gl/gl_surface.h" using ::base::SharedMemory; @@ -30,28 +29,19 @@ bool GpuScheduler::Initialize( DCHECK(parent_context); } - // Create either a view or pbuffer based GLSurface. - scoped_ptr<gfx::GLSurface> surface; + // Create either a view or pbuffer based GLContext. + scoped_ptr<gfx::GLContext> context; if (window) { DCHECK(!parent_handle); - surface.reset(gfx::GLSurface::CreateViewGLSurface(window)); + // TODO(apatrick): support multisampling. + context.reset(gfx::GLContext::CreateViewGLContext(window, false)); } else { - surface.reset(gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1))); + context.reset(gfx::GLContext::CreateOffscreenGLContext(parent_context)); } - if (!surface.get()) { - LOG(ERROR) << "GpuScheduler::Initialize failed.\n"; - Destroy(); - return false; - } - - // Create a GLContext and attach the surface. - scoped_ptr<gfx::GLContext> context( - gfx::GLContext::CreateGLContext(surface.release(), parent_context)); if (!context.get()) { - LOG(ERROR) << "CreateGLContext failed.\n"; - Destroy(); + LOG(ERROR) << "GpuScheduler::Initialize failed"; return false; } diff --git a/gpu/command_buffer/service/gpu_scheduler_mac.cc b/gpu/command_buffer/service/gpu_scheduler_mac.cc index 717230c..f89bfb5 100644 --- a/gpu/command_buffer/service/gpu_scheduler_mac.cc +++ b/gpu/command_buffer/service/gpu_scheduler_mac.cc @@ -4,7 +4,6 @@ #include "gpu/command_buffer/service/gpu_scheduler.h" #include "ui/gfx/gl/gl_context.h" -#include "ui/gfx/gl/gl_surface.h" using ::base::SharedMemory; @@ -29,22 +28,10 @@ bool GpuScheduler::Initialize( DCHECK(parent_context); } - scoped_ptr<gfx::GLSurface> surface( - gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1))); - if (!surface.get()) { - LOG(ERROR) << "CreateOffscreenGLSurface failed.\n"; - Destroy(); - return false; - } - - // Create a GLContext and attach the surface. scoped_ptr<gfx::GLContext> context( - gfx::GLContext::CreateGLContext(surface.release(), parent_context)); - if (!context.get()) { - LOG(ERROR) << "CreateGLContext failed.\n"; - Destroy(); + gfx::GLContext::CreateOffscreenGLContext(parent_context)); + if (!context.get()) return false; - } // On Mac OS X since we can not render on-screen we don't even // attempt to create a view based GLContext. The only difference diff --git a/gpu/command_buffer/service/gpu_scheduler_win.cc b/gpu/command_buffer/service/gpu_scheduler_win.cc index 7a874a2..23c8782 100644 --- a/gpu/command_buffer/service/gpu_scheduler_win.cc +++ b/gpu/command_buffer/service/gpu_scheduler_win.cc @@ -6,7 +6,6 @@ #include "gpu/command_buffer/service/gpu_scheduler.h" #include "ui/gfx/gl/gl_context.h" -#include "ui/gfx/gl/gl_surface.h" using ::base::SharedMemory; @@ -31,28 +30,19 @@ bool GpuScheduler::Initialize( DCHECK(parent_context); } - // Create either a view or pbuffer based GLSurface. - scoped_ptr<gfx::GLSurface> surface; + // Create either a view or pbuffer based GLContext. + scoped_ptr<gfx::GLContext> context; if (window) { - surface.reset(gfx::GLSurface::CreateViewGLSurface(window)); - } else { - surface.reset(gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1))); - } + DCHECK(!parent_context); - if (!surface.get()) { - LOG(ERROR) << "GpuScheduler::Initialize failed.\n"; - Destroy(); - return false; + // TODO(apatrick): support multisampling. + context.reset(gfx::GLContext::CreateViewGLContext(window, false)); + } else { + context.reset(gfx::GLContext::CreateOffscreenGLContext(parent_context)); } - // Create a GLContext and attach the surface. - scoped_ptr<gfx::GLContext> context( - gfx::GLContext::CreateGLContext(surface.release(), parent_context)); - if (!context.get()) { - LOG(ERROR) << "CreateGLContext failed.\n"; - Destroy(); + if (!context.get()) return false; - } return InitializeCommon(context.release(), size, diff --git a/gpu/demos/framework/main_exe.cc b/gpu/demos/framework/main_exe.cc index 0c54804..93fc51e 100644 --- a/gpu/demos/framework/main_exe.cc +++ b/gpu/demos/framework/main_exe.cc @@ -6,7 +6,7 @@ #include "base/command_line.h" #include "base/logging.h" #include "gpu/demos/framework/window.h" -#include "ui/gfx/gl/gl_surface.h" +#include "ui/gfx/gl/gl_context.h" #if defined(OS_LINUX) #include <gtk/gtk.h> @@ -28,7 +28,7 @@ int main(int argc, char** argv) { CommandLine::Init(argc, argv); - gfx::GLSurface::InitializeOneOff(); + gfx::GLContext::InitializeOneOff(); gpu::demos::Window window; CHECK(window.Init(kWindowWidth, kWindowHeight)); |