summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rwxr-xr-xchrome/chrome.gyp8
-rwxr-xr-xchrome/chrome_renderer.gypi10
-rw-r--r--chrome/plugin/command_buffer_stub.cc8
-rw-r--r--chrome/plugin/command_buffer_stub.h4
-rw-r--r--chrome/renderer/command_buffer_proxy.cc10
5 files changed, 26 insertions, 14 deletions
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index ab54446..903c39c 100755
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -451,9 +451,6 @@
# end up using this module as well.
'conditions': [
['OS=="win"', {
- 'dependencies': [
- '../gpu/gpu.gyp:command_buffer_service',
- ],
'defines': [
'__STD_C',
'_CRT_SECURE_NO_DEPRECATE',
@@ -462,6 +459,11 @@
'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 d9cc809..40a066a 100755
--- a/chrome/chrome_renderer.gypi
+++ b/chrome/chrome_renderer.gypi
@@ -165,10 +165,6 @@
'include_dirs': [
'third_party/wtl/include',
],
- 'sources': [
- 'renderer/command_buffer_proxy.cc',
- 'renderer/command_buffer_proxy.h',
- ],
'conditions': [
['win_use_allocator_shim==1', {
'dependencies': [
@@ -180,6 +176,12 @@
}],
],
}],
+ ['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 d7dbf9f..4a9dd5c 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::NativeView view)
+ gfx::PluginWindowHandle window)
: channel_(channel),
- view_(view) {
+ window_(window) {
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(view_)) {
+ if (processor_->Initialize(window_)) {
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 = 0;
+ *transfer_buffer = base::SharedMemoryHandle();
*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 c7d765e..4608d0e 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::NativeView view);
+ CommandBufferStub(PluginChannel* channel, gfx::PluginWindowHandle window);
virtual ~CommandBufferStub();
@@ -50,7 +50,7 @@ class CommandBufferStub : public IPC::Channel::Listener,
void OnGetErrorStatus(bool* error_status);
scoped_refptr<PluginChannel> channel_;
- gfx::NativeView view_;
+ gfx::PluginWindowHandle window_;
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 b78fa84..3b68cc2 100644
--- a/chrome/renderer/command_buffer_proxy.cc
+++ b/chrome/renderer/command_buffer_proxy.cc
@@ -153,12 +153,20 @@ 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(shared_memory->max_size())) {
+ if (!shared_memory->Map(size)) {
delete shared_memory;
return Buffer();
}