diff options
author | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-05 04:11:13 +0000 |
---|---|---|
committer | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-05 04:11:13 +0000 |
commit | 7706e5e3598efb51d021a64f34f2c2d3e390be6f (patch) | |
tree | 0f39b8c6076c80ed0efe9a0a71fcaed3ebdd1ab9 /chrome | |
parent | 9561ea774cff1ee6542d699d09099423d5c518be (diff) | |
download | chromium_src-7706e5e3598efb51d021a64f34f2c2d3e390be6f.zip chromium_src-7706e5e3598efb51d021a64f34f2c2d3e390be6f.tar.gz chromium_src-7706e5e3598efb51d021a64f34f2c2d3e390be6f.tar.bz2 |
Revert 35509 - linux: implement gpu plugin
Review URL: http://codereview.chromium.org/500132
TBR=piman@chromium.org
Review URL: http://codereview.chromium.org/525022
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35511 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rwxr-xr-x | chrome/chrome.gyp | 8 | ||||
-rwxr-xr-x | chrome/chrome_renderer.gypi | 10 | ||||
-rw-r--r-- | chrome/plugin/command_buffer_stub.cc | 8 | ||||
-rw-r--r-- | chrome/plugin/command_buffer_stub.h | 4 | ||||
-rw-r--r-- | chrome/renderer/command_buffer_proxy.cc | 10 |
5 files changed, 14 insertions, 26 deletions
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index ffd1ed9..d1ab06c 100755 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -450,6 +450,9 @@ # end up using this module as well. 'conditions': [ ['OS=="win"', { + 'dependencies': [ + '../gpu/gpu.gyp:command_buffer_service', + ], 'defines': [ '__STD_C', '_CRT_SECURE_NO_DEPRECATE', @@ -458,11 +461,6 @@ 'include_dirs': [ 'third_party/wtl/include', ], - }], - ['OS=="win" or (OS=="linux" and target_arch!="arm")', { - 'dependencies': [ - '../gpu/gpu.gyp:command_buffer_service', - ], 'sources': [ 'plugin/command_buffer_stub.cc', 'plugin/command_buffer_stub.h', diff --git a/chrome/chrome_renderer.gypi b/chrome/chrome_renderer.gypi index 40a066a..d9cc809 100755 --- a/chrome/chrome_renderer.gypi +++ b/chrome/chrome_renderer.gypi @@ -165,6 +165,10 @@ 'include_dirs': [ 'third_party/wtl/include', ], + 'sources': [ + 'renderer/command_buffer_proxy.cc', + 'renderer/command_buffer_proxy.h', + ], 'conditions': [ ['win_use_allocator_shim==1', { 'dependencies': [ @@ -176,12 +180,6 @@ }], ], }], - ['OS=="win" or (OS=="linux" and target_arch!="arm")', { - 'sources': [ - 'renderer/command_buffer_proxy.cc', - 'renderer/command_buffer_proxy.h', - ], - }], ], }, ], diff --git a/chrome/plugin/command_buffer_stub.cc b/chrome/plugin/command_buffer_stub.cc index 4a9dd5c..d7dbf9f 100644 --- a/chrome/plugin/command_buffer_stub.cc +++ b/chrome/plugin/command_buffer_stub.cc @@ -11,9 +11,9 @@ using gpu::Buffer; CommandBufferStub::CommandBufferStub(PluginChannel* channel, - gfx::PluginWindowHandle window) + gfx::NativeView view) : channel_(channel), - window_(window) { + view_(view) { route_id_ = channel->GenerateRouteID(); channel->AddRoute(route_id_, this, false); } @@ -54,7 +54,7 @@ void CommandBufferStub::OnInitialize(int32 size, Buffer buffer = command_buffer_->GetRingBuffer(); if (buffer.shared_memory) { processor_ = new gpu::GPUProcessor(command_buffer_.get()); - if (processor_->Initialize(window_)) { + if (processor_->Initialize(view_)) { command_buffer_->SetPutOffsetChangeCallback( NewCallback(processor_.get(), &gpu::GPUProcessor::ProcessCommands)); @@ -93,7 +93,7 @@ void CommandBufferStub::OnGetTransferBuffer( int32 id, base::SharedMemoryHandle* transfer_buffer, size_t* size) { - *transfer_buffer = base::SharedMemoryHandle(); + *transfer_buffer = 0; *size = 0; // Assume service is responsible for duplicating the handle to the calling diff --git a/chrome/plugin/command_buffer_stub.h b/chrome/plugin/command_buffer_stub.h index 4608d0e..c7d765e 100644 --- a/chrome/plugin/command_buffer_stub.h +++ b/chrome/plugin/command_buffer_stub.h @@ -21,7 +21,7 @@ class CommandBufferService; class CommandBufferStub : public IPC::Channel::Listener, public IPC::Message::Sender { public: - CommandBufferStub(PluginChannel* channel, gfx::PluginWindowHandle window); + CommandBufferStub(PluginChannel* channel, gfx::NativeView view); virtual ~CommandBufferStub(); @@ -50,7 +50,7 @@ class CommandBufferStub : public IPC::Channel::Listener, void OnGetErrorStatus(bool* error_status); scoped_refptr<PluginChannel> channel_; - gfx::PluginWindowHandle window_; + gfx::NativeView view_; int route_id_; scoped_ptr<gpu::CommandBufferService> command_buffer_; scoped_refptr<gpu::GPUProcessor> processor_; diff --git a/chrome/renderer/command_buffer_proxy.cc b/chrome/renderer/command_buffer_proxy.cc index 3b68cc2..b78fa84 100644 --- a/chrome/renderer/command_buffer_proxy.cc +++ b/chrome/renderer/command_buffer_proxy.cc @@ -153,20 +153,12 @@ Buffer CommandBufferProxy::GetTransferBuffer(int32 id) { } // Cache the transfer buffer shared memory object client side. -#if defined(OS_WIN) - // TODO(piman): Does Windows needs this version of the constructor ? It - // duplicates the handle, but I'm not sure why it is necessary - it was - // already duped by the CommandBufferStub. base::SharedMemory* shared_memory = new base::SharedMemory(handle, false, base::GetCurrentProcessHandle()); -#else - base::SharedMemory* shared_memory = - new base::SharedMemory(handle, false); -#endif // Map the shared memory on demand. if (!shared_memory->memory()) { - if (!shared_memory->Map(size)) { + if (!shared_memory->Map(shared_memory->max_size())) { delete shared_memory; return Buffer(); } |