diff options
author | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-25 22:08:35 +0000 |
---|---|---|
committer | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-25 22:08:35 +0000 |
commit | 6217d397bf501ec1ec5b7270d493006badd4d87a (patch) | |
tree | fce6c8e9c15b79bab29a9535ce9929dd9d53735b /gpu/command_buffer/client | |
parent | 21dedcc12d21ccb288244249522d77bc074c501e (diff) | |
download | chromium_src-6217d397bf501ec1ec5b7270d493006badd4d87a.zip chromium_src-6217d397bf501ec1ec5b7270d493006badd4d87a.tar.gz chromium_src-6217d397bf501ec1ec5b7270d493006badd4d87a.tar.bz2 |
Calling OpenGL from the renderer process
- Added ability for renderer processes to render to a real window (Windows only so far).
- Added ability to create offscreen frame buffer objects that can be resized later.
- OpenGL context can have a "parent" context that can access its last swapped back buffer through a texture ID.
- Moved code to establish GPU channel from RenderWidget to RenderThread.
- Changed way service size command buffer object lifetimes are managed.
TEST=trybot and visual verification that OpenGL can clear the browser window to magenta.
BUG=none
Review URL: http://codereview.chromium.org/1136006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42679 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu/command_buffer/client')
-rw-r--r-- | gpu/command_buffer/client/cmd_buffer_helper_test.cc | 7 | ||||
-rw-r--r-- | gpu/command_buffer/client/fenced_allocator_test.cc | 7 | ||||
-rw-r--r-- | gpu/command_buffer/client/gles2_demo.cc | 10 | ||||
-rw-r--r-- | gpu/command_buffer/client/gles2_implementation.h | 2 |
4 files changed, 15 insertions, 11 deletions
diff --git a/gpu/command_buffer/client/cmd_buffer_helper_test.cc b/gpu/command_buffer/client/cmd_buffer_helper_test.cc index ffb8137..d754f5b 100644 --- a/gpu/command_buffer/client/cmd_buffer_helper_test.cc +++ b/gpu/command_buffer/client/cmd_buffer_helper_test.cc @@ -51,12 +51,12 @@ class CommandBufferHelperTest : public testing::Test { 0, api_mock_.get()); - scoped_refptr<GPUProcessor> gpu_processor(new GPUProcessor( + gpu_processor_.reset(new GPUProcessor( command_buffer_.get(), NULL, parser_, 1)); command_buffer_->SetPutOffsetChangeCallback(NewCallback( - gpu_processor.get(), &GPUProcessor::ProcessCommands)); + gpu_processor_.get(), &GPUProcessor::ProcessCommands)); - api_mock_->set_engine(gpu_processor.get()); + api_mock_->set_engine(gpu_processor_.get()); helper_.reset(new CommandBufferHelper(command_buffer_.get())); helper_->Initialize(); @@ -132,6 +132,7 @@ class CommandBufferHelperTest : public testing::Test { MessageLoop message_loop_; scoped_ptr<AsyncAPIMock> api_mock_; scoped_ptr<CommandBufferService> command_buffer_; + scoped_ptr<GPUProcessor> gpu_processor_; CommandParser* parser_; scoped_ptr<CommandBufferHelper> helper_; Sequence sequence_; diff --git a/gpu/command_buffer/client/fenced_allocator_test.cc b/gpu/command_buffer/client/fenced_allocator_test.cc index c47f355..8dc1b780 100644 --- a/gpu/command_buffer/client/fenced_allocator_test.cc +++ b/gpu/command_buffer/client/fenced_allocator_test.cc @@ -52,12 +52,12 @@ class BaseFencedAllocatorTest : public testing::Test { 0, api_mock_.get()); - scoped_refptr<GPUProcessor> gpu_processor(new GPUProcessor( + gpu_processor_.reset(new GPUProcessor( command_buffer_.get(), NULL, parser_, INT_MAX)); command_buffer_->SetPutOffsetChangeCallback(NewCallback( - gpu_processor.get(), &GPUProcessor::ProcessCommands)); + gpu_processor_.get(), &GPUProcessor::ProcessCommands)); - api_mock_->set_engine(gpu_processor.get()); + api_mock_->set_engine(gpu_processor_.get()); helper_.reset(new CommandBufferHelper(command_buffer_.get())); helper_->Initialize(); @@ -76,6 +76,7 @@ class BaseFencedAllocatorTest : public testing::Test { MessageLoop message_loop_; scoped_ptr<AsyncAPIMock> api_mock_; scoped_ptr<CommandBufferService> command_buffer_; + scoped_ptr<GPUProcessor> gpu_processor_; CommandParser* parser_; scoped_ptr<CommandBufferHelper> helper_; }; diff --git a/gpu/command_buffer/client/gles2_demo.cc b/gpu/command_buffer/client/gles2_demo.cc index 41c42b1..6035042 100644 --- a/gpu/command_buffer/client/gles2_demo.cc +++ b/gpu/command_buffer/client/gles2_demo.cc @@ -54,14 +54,16 @@ bool GLES2Demo::Setup(void* hwnd, int32 size) { if (!command_buffer->Initialize(size)) return NULL; - scoped_refptr<GPUProcessor> gpu_processor( - new GPUProcessor(command_buffer.get())); - if (!gpu_processor->Initialize(reinterpret_cast<HWND>(hwnd))) { + GPUProcessor* gpu_processor = new GPUProcessor(command_buffer.get()); + if (!gpu_processor->Initialize(reinterpret_cast<HWND>(hwnd), + NULL, + gfx::Size(), + 0)) { return NULL; } command_buffer->SetPutOffsetChangeCallback( - NewCallback(gpu_processor.get(), &GPUProcessor::ProcessCommands)); + NewCallback(gpu_processor, &GPUProcessor::ProcessCommands)); GLES2CmdHelper* helper = new GLES2CmdHelper(command_buffer.get()); if (!helper->Initialize()) { diff --git a/gpu/command_buffer/client/gles2_implementation.h b/gpu/command_buffer/client/gles2_implementation.h index c1ee9c6..fd98686 100644 --- a/gpu/command_buffer/client/gles2_implementation.h +++ b/gpu/command_buffer/client/gles2_implementation.h @@ -43,13 +43,13 @@ class GLES2Implementation { // this file instead of having to edit some template or the code generator. #include "../client/gles2_implementation_autogen.h" - private: // Makes a set of Ids for glGen___ functions. void MakeIds(GLsizei n, GLuint* ids); // Frees a set of Ids for glDelete___ functions. void FreeIds(GLsizei n, const GLuint* ids); + private: // Gets the shared memory id for the result buffer. uint32 result_shm_id() const { return transfer_buffer_id_; |