summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorgman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-12 23:29:40 +0000
committergman@chromium.org <gman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-12 23:29:40 +0000
commit503b3a2ed9be72b3697f1c02cdc7efd29fec987a (patch)
treef715ec00989bded6c3bdb3919cace05a7d33fc05 /webkit
parent6e6f8836c975eebd3620974c3de6d564967821e9 (diff)
downloadchromium_src-503b3a2ed9be72b3697f1c02cdc7efd29fec987a.zip
chromium_src-503b3a2ed9be72b3697f1c02cdc7efd29fec987a.tar.gz
chromium_src-503b3a2ed9be72b3697f1c02cdc7efd29fec987a.tar.bz2
Revert "Revert 113479 - Revert "Revert 113250 - Add CommandBuffer::SetGetBuffer""
This reverts commit 84677847c10d0319d8d996aea9b310add85c0bd3. TEST=ran browser tests on OSX BUG=103989 TBR=apatrick@chromiu.org Review URL: http://codereview.chromium.org/8919014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114114 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc10
-rw-r--r--webkit/plugins/ppapi/ppb_graphics_3d_impl.cc13
-rw-r--r--webkit/plugins/ppapi/ppb_graphics_3d_impl.h5
3 files changed, 17 insertions, 11 deletions
diff --git a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
index 9daaa74..dd1db2e 100644
--- a/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
+++ b/webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.cc
@@ -86,6 +86,7 @@ class GLInProcessContext : public base::SupportsWeakPtr<GLInProcessContext> {
~GLInProcessContext();
void PumpCommands();
+ bool GetBufferChanged(int32 transfer_buffer_id);
// Create a GLInProcessContext that renders directly to a view. The view and
// the associated window must not be destroyed until the returned
@@ -311,6 +312,10 @@ void GLInProcessContext::PumpCommands() {
CHECK(state.error == ::gpu::error::kNoError);
}
+bool GLInProcessContext::GetBufferChanged(int32 transfer_buffer_id) {
+ return gpu_scheduler_->SetGetBuffer(transfer_buffer_id);
+}
+
uint32 GLInProcessContext::GetParentTextureId() {
return parent_texture_id_;
}
@@ -457,7 +462,7 @@ bool GLInProcessContext::Initialize(bool onscreen,
}
command_buffer_.reset(new CommandBufferService);
- if (!command_buffer_->Initialize(kCommandBufferSize)) {
+ if (!command_buffer_->Initialize()) {
LOG(ERROR) << "Could not initialize command buffer.";
Destroy();
return false;
@@ -523,6 +528,9 @@ bool GLInProcessContext::Initialize(bool onscreen,
command_buffer_->SetPutOffsetChangeCallback(
base::Bind(&GLInProcessContext::PumpCommands, base::Unretained(this)));
+ command_buffer_->SetGetBufferChangeCallback(
+ base::Bind(
+ &GLInProcessContext::GetBufferChanged, base::Unretained(this)));
// Create the GLES2 helper, which writes the command buffer protocol.
gles2_helper_.reset(new GLES2CmdHelper(command_buffer_.get()));
diff --git a/webkit/plugins/ppapi/ppb_graphics_3d_impl.cc b/webkit/plugins/ppapi/ppb_graphics_3d_impl.cc
index a9a811b..87b25a1 100644
--- a/webkit/plugins/ppapi/ppb_graphics_3d_impl.cc
+++ b/webkit/plugins/ppapi/ppb_graphics_3d_impl.cc
@@ -88,14 +88,13 @@ PPB_Graphics3D_API* PPB_Graphics3D_Impl::AsPPB_Graphics3D_API() {
return this;
}
-PP_Bool PPB_Graphics3D_Impl::InitCommandBuffer(int32_t size) {
- return PP_FromBool(GetCommandBuffer()->Initialize(size));
+PP_Bool PPB_Graphics3D_Impl::InitCommandBuffer() {
+ return PP_FromBool(GetCommandBuffer()->Initialize());
}
-PP_Bool PPB_Graphics3D_Impl::GetRingBuffer(int* shm_handle,
- uint32_t* shm_size) {
- gpu::Buffer buffer = GetCommandBuffer()->GetRingBuffer();
- return ShmToHandle(buffer.shared_memory, buffer.size, shm_handle, shm_size);
+PP_Bool PPB_Graphics3D_Impl::SetGetBuffer(int32_t transfer_buffer_id) {
+ GetCommandBuffer()->SetGetBuffer(transfer_buffer_id);
+ return PP_TRUE;
}
PP_Graphics3DTrustedState PPB_Graphics3D_Impl::GetState() {
@@ -192,7 +191,7 @@ bool PPB_Graphics3D_Impl::Init(PP_Resource share_context,
return false;
gpu::CommandBuffer* command_buffer = GetCommandBuffer();
- if (!command_buffer->Initialize(kCommandBufferSize))
+ if (!command_buffer->Initialize())
return false;
return CreateGLES2Impl(kCommandBufferSize, kTransferBufferSize);
diff --git a/webkit/plugins/ppapi/ppb_graphics_3d_impl.h b/webkit/plugins/ppapi/ppb_graphics_3d_impl.h
index 728f58a..088b2f9 100644
--- a/webkit/plugins/ppapi/ppb_graphics_3d_impl.h
+++ b/webkit/plugins/ppapi/ppb_graphics_3d_impl.h
@@ -29,9 +29,8 @@ class PPB_Graphics3D_Impl : public ::ppapi::Resource,
virtual ::ppapi::thunk::PPB_Graphics3D_API* AsPPB_Graphics3D_API() OVERRIDE;
// PPB_Graphics3D_API trusted implementation.
- virtual PP_Bool InitCommandBuffer(int32_t size) OVERRIDE;
- virtual PP_Bool GetRingBuffer(int* shm_handle,
- uint32_t* shm_size) OVERRIDE;
+ virtual PP_Bool InitCommandBuffer() OVERRIDE;
+ virtual PP_Bool SetGetBuffer(int32_t transfer_buffer_id) OVERRIDE;
virtual PP_Graphics3DTrustedState GetState() OVERRIDE;
virtual int32_t CreateTransferBuffer(uint32_t size) OVERRIDE;
virtual PP_Bool DestroyTransferBuffer(int32_t id) OVERRIDE;