summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--content/common/gpu/client/command_buffer_proxy_impl.cc2
-rw-r--r--content/common/gpu/client/command_buffer_proxy_impl.h6
-rw-r--r--content/common/gpu/client/gpu_channel_host.cc5
-rw-r--r--content/common/gpu/client/gpu_channel_host.h10
-rw-r--r--content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc7
-rw-r--r--content/common/gpu/gpu_channel.cc7
-rw-r--r--content/common/gpu/gpu_messages.h4
7 files changed, 26 insertions, 15 deletions
diff --git a/content/common/gpu/client/command_buffer_proxy_impl.cc b/content/common/gpu/client/command_buffer_proxy_impl.cc
index 49cb0a3..61f8922 100644
--- a/content/common/gpu/client/command_buffer_proxy_impl.cc
+++ b/content/common/gpu/client/command_buffer_proxy_impl.cc
@@ -419,7 +419,7 @@ bool CommandBufferProxyImpl::SignalSyncPoint(uint32 sync_point,
bool CommandBufferProxyImpl::GenerateMailboxNames(
unsigned num,
- std::vector<std::string>* names) {
+ std::vector<gpu::Mailbox>* names) {
return channel_->GenerateMailboxNames(num, names);
}
diff --git a/content/common/gpu/client/command_buffer_proxy_impl.h b/content/common/gpu/client/command_buffer_proxy_impl.h
index 3d75a3f..ff50fcf 100644
--- a/content/common/gpu/client/command_buffer_proxy_impl.h
+++ b/content/common/gpu/client/command_buffer_proxy_impl.h
@@ -29,6 +29,10 @@ namespace base {
class SharedMemory;
}
+namespace gpu {
+struct Mailbox;
+}
+
namespace content {
class GpuChannelHost;
@@ -106,7 +110,7 @@ class CommandBufferProxyImpl
// GL_texture_mailbox_CHROMIUM. Unlike genMailboxCHROMIUM, this IPC is
// handled only on the GPU process' IO thread, and so is not effectively
// a finish.
- bool GenerateMailboxNames(unsigned num, std::vector<std::string>* names);
+ bool GenerateMailboxNames(unsigned num, std::vector<gpu::Mailbox>* names);
// Sends an IPC message with the new state of surface visibility.
bool SetSurfaceVisible(bool visible);
diff --git a/content/common/gpu/client/gpu_channel_host.cc b/content/common/gpu/client/gpu_channel_host.cc
index 31108b8..d5bb6b3 100644
--- a/content/common/gpu/client/gpu_channel_host.cc
+++ b/content/common/gpu/client/gpu_channel_host.cc
@@ -12,6 +12,7 @@
#include "content/common/gpu/client/command_buffer_proxy_impl.h"
#include "content/common/gpu/gpu_messages.h"
#include "googleurl/src/gurl.h"
+#include "gpu/command_buffer/common/mailbox.h"
#include "ipc/ipc_sync_message_filter.h"
#if defined(OS_WIN)
@@ -275,7 +276,7 @@ base::SharedMemoryHandle GpuChannelHost::ShareToGpuProcess(
}
bool GpuChannelHost::GenerateMailboxNames(unsigned num,
- std::vector<std::string>* names) {
+ std::vector<gpu::Mailbox>* names) {
TRACE_EVENT0("gpu", "GenerateMailboxName");
AutoLock lock(context_lock_);
@@ -300,7 +301,7 @@ bool GpuChannelHost::GenerateMailboxNames(unsigned num,
}
void GpuChannelHost::OnGenerateMailboxNamesReply(
- const std::vector<std::string>& names) {
+ const std::vector<gpu::Mailbox>& names) {
TRACE_EVENT0("gpu", "OnGenerateMailboxNamesReply");
AutoLock lock(context_lock_);
diff --git a/content/common/gpu/client/gpu_channel_host.h b/content/common/gpu/client/gpu_channel_host.h
index 13fce10..9f55d5a 100644
--- a/content/common/gpu/client/gpu_channel_host.h
+++ b/content/common/gpu/client/gpu_channel_host.h
@@ -37,6 +37,10 @@ namespace base {
class MessageLoopProxy;
}
+namespace gpu {
+struct Mailbox;
+}
+
namespace IPC {
class SyncMessageFilter;
}
@@ -170,7 +174,7 @@ class GpuChannelHost : public IPC::Sender,
// GL_texture_mailbox_CHROMIUM. Unlike genMailboxCHROMIUM, this IPC is
// handled only on the GPU process' IO thread, and so is not effectively
// a finish.
- bool GenerateMailboxNames(unsigned num, std::vector<std::string>* names);
+ bool GenerateMailboxNames(unsigned num, std::vector<gpu::Mailbox>* names);
// Reserve one unused transfer buffer ID.
int32 ReserveTransferBufferId();
@@ -180,7 +184,7 @@ class GpuChannelHost : public IPC::Sender,
virtual ~GpuChannelHost();
// Message handlers.
- void OnGenerateMailboxNamesReply(const std::vector<std::string>& names);
+ void OnGenerateMailboxNamesReply(const std::vector<gpu::Mailbox>& names);
// A filter used internally to route incoming messages from the IO thread
// to the correct message loop.
@@ -235,7 +239,7 @@ class GpuChannelHost : public IPC::Sender,
scoped_refptr<IPC::SyncMessageFilter> sync_filter_;
// A pool of valid mailbox names.
- std::vector<std::string> mailbox_name_pool_;
+ std::vector<gpu::Mailbox> mailbox_name_pool_;
// Transfer buffer IDs are allocated in sequence.
base::AtomicSequenceNumber next_transfer_buffer_id_;
diff --git a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
index e227a00..cfdac6b 100644
--- a/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
+++ b/content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.cc
@@ -27,13 +27,14 @@
#include "content/common/gpu/gpu_process_launch_causes.h"
#include "content/public/common/content_constants.h"
#include "content/public/common/content_switches.h"
+#include "gpu/GLES2/gl2extchromium.h"
#include "gpu/command_buffer/client/gles2_cmd_helper.h"
#include "gpu/command_buffer/client/gles2_implementation.h"
#include "gpu/command_buffer/client/gles2_lib.h"
#include "gpu/command_buffer/client/gles2_trace_implementation.h"
#include "gpu/command_buffer/client/transfer_buffer.h"
#include "gpu/command_buffer/common/constants.h"
-#include "gpu/GLES2/gl2extchromium.h"
+#include "gpu/command_buffer/common/mailbox.h"
#include "gpu/ipc/command_buffer_proxy.h"
#include "webkit/gpu/gl_bindings_skia_cmd_buffer.h"
@@ -1615,9 +1616,9 @@ DELEGATE_TO_GL_1(waitSyncPoint, WaitSyncPointCHROMIUM, GLuint)
void WebGraphicsContext3DCommandBufferImpl::genMailboxCHROMIUM(
WGC3Dbyte* name) {
- std::vector<std::string> names(1);
+ std::vector<gpu::Mailbox> names(1);
if (command_buffer_->GenerateMailboxNames(1, &names))
- memcpy(name, names[0].c_str(), GL_MAILBOX_SIZE_CHROMIUM);
+ memcpy(name, names[0].name, GL_MAILBOX_SIZE_CHROMIUM);
else
synthesizeGLError(GL_OUT_OF_MEMORY);
}
diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc
index 62d85e9..5aea4b5 100644
--- a/content/common/gpu/gpu_channel.cc
+++ b/content/common/gpu/gpu_channel.cc
@@ -25,6 +25,7 @@
#include "content/common/gpu/sync_point_manager.h"
#include "content/public/common/content_switches.h"
#include "crypto/hmac.h"
+#include "gpu/command_buffer/common/mailbox.h"
#include "gpu/command_buffer/service/image_manager.h"
#include "gpu/command_buffer/service/mailbox_manager.h"
#include "gpu/command_buffer/service/gpu_scheduler.h"
@@ -106,7 +107,7 @@ class MailboxMessageFilter : public IPC::ChannelProxy::MessageFilter {
}
// Message handlers.
- void OnGenerateMailboxNames(unsigned num, std::vector<std::string>* result) {
+ void OnGenerateMailboxNames(unsigned num, std::vector<gpu::Mailbox>* result) {
TRACE_EVENT1("gpu", "OnGenerateMailboxNames", "num", num);
result->resize(num);
@@ -121,12 +122,12 @@ class MailboxMessageFilter : public IPC::ChannelProxy::MessageFilter {
sizeof(name) / 2);
DCHECK(success);
- (*result)[i].assign(name, sizeof(name));
+ (*result)[i].SetName(reinterpret_cast<int8*>(name));
}
}
void OnGenerateMailboxNamesAsync(unsigned num) {
- std::vector<std::string> names;
+ std::vector<gpu::Mailbox> names;
OnGenerateMailboxNames(num, &names);
Send(new GpuChannelMsg_GenerateMailboxNamesReply(names));
}
diff --git a/content/common/gpu/gpu_messages.h b/content/common/gpu/gpu_messages.h
index 56863cd..feef8e8 100644
--- a/content/common/gpu/gpu_messages.h
+++ b/content/common/gpu/gpu_messages.h
@@ -420,7 +420,7 @@ IPC_SYNC_MESSAGE_CONTROL1_0(GpuChannelMsg_DestroyCommandBuffer,
// Generates n new unique mailbox names synchronously.
IPC_SYNC_MESSAGE_CONTROL1_1(GpuChannelMsg_GenerateMailboxNames,
unsigned, /* num */
- std::vector<std::string> /* mailbox_names */)
+ std::vector<gpu::Mailbox> /* mailbox_names */)
// Generates n new unique mailbox names asynchronously.
IPC_MESSAGE_CONTROL1(GpuChannelMsg_GenerateMailboxNamesAsync,
@@ -428,7 +428,7 @@ IPC_MESSAGE_CONTROL1(GpuChannelMsg_GenerateMailboxNamesAsync,
// Reply to GpuChannelMsg_GenerateMailboxNamesAsync.
IPC_MESSAGE_CONTROL1(GpuChannelMsg_GenerateMailboxNamesReply,
- std::vector<std::string> /* mailbox_names */)
+ std::vector<gpu::Mailbox> /* mailbox_names */)
#if defined(OS_ANDROID)
// Register the StreamTextureProxy class with the GPU process, so that