summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/proxy/ppapi_command_buffer_proxy.cc17
-rw-r--r--ppapi/proxy/ppapi_command_buffer_proxy.h45
-rw-r--r--ppapi/proxy/ppb_graphics_3d_proxy.cc4
-rw-r--r--ppapi/proxy/ppb_graphics_3d_proxy.h4
-rw-r--r--ppapi/shared_impl/ppb_graphics_3d_shared.cc3
-rw-r--r--ppapi/shared_impl/ppb_graphics_3d_shared.h2
6 files changed, 56 insertions, 19 deletions
diff --git a/ppapi/proxy/ppapi_command_buffer_proxy.cc b/ppapi/proxy/ppapi_command_buffer_proxy.cc
index 88528f2..d748678 100644
--- a/ppapi/proxy/ppapi_command_buffer_proxy.cc
+++ b/ppapi/proxy/ppapi_command_buffer_proxy.cc
@@ -204,6 +204,23 @@ uint32 PpapiCommandBufferProxy::InsertSyncPoint() {
return sync_point;
}
+bool PpapiCommandBufferProxy::SupportsGpuMemoryBuffer() {
+ return false;
+}
+
+gfx::GpuMemoryBuffer* PpapiCommandBufferProxy::CreateGpuMemoryBuffer(
+ size_t width,
+ size_t height,
+ unsigned internalformat,
+ int32* id) {
+ NOTREACHED();
+ return NULL;
+}
+
+void PpapiCommandBufferProxy::DestroyGpuMemoryBuffer(int32 id) {
+ NOTREACHED();
+}
+
bool PpapiCommandBufferProxy::Send(IPC::Message* msg) {
DCHECK(last_state_.error == gpu::error::kNoError);
diff --git a/ppapi/proxy/ppapi_command_buffer_proxy.h b/ppapi/proxy/ppapi_command_buffer_proxy.h
index 6ea6f65..603ea36 100644
--- a/ppapi/proxy/ppapi_command_buffer_proxy.h
+++ b/ppapi/proxy/ppapi_command_buffer_proxy.h
@@ -8,6 +8,7 @@
#include "base/callback.h"
#include "base/containers/hash_tables.h"
#include "gpu/command_buffer/common/command_buffer.h"
+#include "gpu/command_buffer/common/gpu_control.h"
#include "ppapi/proxy/ppapi_proxy_export.h"
#include "ppapi/shared_impl/host_resource.h"
@@ -20,28 +21,40 @@ namespace proxy {
class ProxyChannel;
-class PPAPI_PROXY_EXPORT PpapiCommandBufferProxy : public gpu::CommandBuffer {
+class PPAPI_PROXY_EXPORT PpapiCommandBufferProxy
+ : public gpu::CommandBuffer,
+ public gpu::GpuControl {
public:
PpapiCommandBufferProxy(const HostResource& resource,
ProxyChannel* channel);
virtual ~PpapiCommandBufferProxy();
// gpu::CommandBuffer implementation:
- virtual bool Initialize();
- virtual State GetState();
- virtual State GetLastState();
- virtual int32 GetLastToken();
- virtual void Flush(int32 put_offset);
- virtual State FlushSync(int32 put_offset, int32 last_known_get);
- virtual void SetGetBuffer(int32 transfer_buffer_id);
- virtual void SetGetOffset(int32 get_offset);
- virtual gpu::Buffer CreateTransferBuffer(size_t size, int32* id);
- virtual void DestroyTransferBuffer(int32 id);
- virtual gpu::Buffer GetTransferBuffer(int32 id);
- virtual void SetToken(int32 token);
- virtual void SetParseError(gpu::error::Error error);
- virtual void SetContextLostReason(gpu::error::ContextLostReason reason);
- virtual uint32 InsertSyncPoint();
+ virtual bool Initialize() OVERRIDE;
+ virtual State GetState() OVERRIDE;
+ virtual State GetLastState() OVERRIDE;
+ virtual int32 GetLastToken() OVERRIDE;
+ virtual void Flush(int32 put_offset) OVERRIDE;
+ virtual State FlushSync(int32 put_offset, int32 last_known_get) OVERRIDE;
+ virtual void SetGetBuffer(int32 transfer_buffer_id) OVERRIDE;
+ virtual void SetGetOffset(int32 get_offset) OVERRIDE;
+ virtual gpu::Buffer CreateTransferBuffer(size_t size, int32* id) OVERRIDE;
+ virtual void DestroyTransferBuffer(int32 id) OVERRIDE;
+ virtual gpu::Buffer GetTransferBuffer(int32 id) OVERRIDE;
+ virtual void SetToken(int32 token) OVERRIDE;
+ virtual void SetParseError(gpu::error::Error error) OVERRIDE;
+ virtual void SetContextLostReason(gpu::error::ContextLostReason reason)
+ OVERRIDE;
+ virtual uint32 InsertSyncPoint() OVERRIDE;
+
+ // gpu::GpuControl implementation:
+ virtual bool SupportsGpuMemoryBuffer() OVERRIDE;
+ virtual gfx::GpuMemoryBuffer* CreateGpuMemoryBuffer(
+ size_t width,
+ size_t height,
+ unsigned internalformat,
+ int32* id) OVERRIDE;
+ virtual void DestroyGpuMemoryBuffer(int32 id) OVERRIDE;
private:
bool Send(IPC::Message* msg);
diff --git a/ppapi/proxy/ppb_graphics_3d_proxy.cc b/ppapi/proxy/ppb_graphics_3d_proxy.cc
index 204466b..ba988fd22 100644
--- a/ppapi/proxy/ppb_graphics_3d_proxy.cc
+++ b/ppapi/proxy/ppb_graphics_3d_proxy.cc
@@ -245,6 +245,10 @@ gpu::CommandBuffer* Graphics3D::GetCommandBuffer() {
return locking_command_buffer_.get();
}
+gpu::GpuControl* Graphics3D::GetGpuControl() {
+ return command_buffer_.get();
+}
+
int32 Graphics3D::DoSwapBuffers() {
// gles2_impl()->SwapBuffers() results in CommandBuffer calls, and we already
// have the proxy lock.
diff --git a/ppapi/proxy/ppb_graphics_3d_proxy.h b/ppapi/proxy/ppb_graphics_3d_proxy.h
index ffda80c..8f6b40f 100644
--- a/ppapi/proxy/ppb_graphics_3d_proxy.h
+++ b/ppapi/proxy/ppb_graphics_3d_proxy.h
@@ -24,6 +24,7 @@ class HostResource;
namespace proxy {
class SerializedHandle;
+class PpapiCommandBufferProxy;
class Graphics3D : public PPB_Graphics3D_Shared {
public:
@@ -52,12 +53,13 @@ class Graphics3D : public PPB_Graphics3D_Shared {
// PPB_Graphics3D_Shared overrides.
virtual gpu::CommandBuffer* GetCommandBuffer() OVERRIDE;
+ virtual gpu::GpuControl* GetGpuControl() OVERRIDE;
virtual int32 DoSwapBuffers() OVERRIDE;
virtual void PushAlreadyLocked() OVERRIDE;
virtual void PopAlreadyLocked() OVERRIDE;
int num_already_locked_calls_;
- scoped_ptr<gpu::CommandBuffer> command_buffer_;
+ scoped_ptr<PpapiCommandBufferProxy> command_buffer_;
scoped_ptr<LockingCommandBuffer> locking_command_buffer_;
DISALLOW_COPY_AND_ASSIGN(Graphics3D);
diff --git a/ppapi/shared_impl/ppb_graphics_3d_shared.cc b/ppapi/shared_impl/ppb_graphics_3d_shared.cc
index e24a13c..1f412d8 100644
--- a/ppapi/shared_impl/ppb_graphics_3d_shared.cc
+++ b/ppapi/shared_impl/ppb_graphics_3d_shared.cc
@@ -129,8 +129,7 @@ bool PPB_Graphics3D_Shared::CreateGLES2Impl(
share_gles2 ? share_gles2->share_group() : NULL,
transfer_buffer_.get(),
true,
- NULL // Do not use GpuMemoryBuffers.
- ));
+ GetGpuControl()));
if (!gles2_impl_->Initialize(
transfer_buffer_size,
diff --git a/ppapi/shared_impl/ppb_graphics_3d_shared.h b/ppapi/shared_impl/ppb_graphics_3d_shared.h
index 482cb4c..c51c99b 100644
--- a/ppapi/shared_impl/ppb_graphics_3d_shared.h
+++ b/ppapi/shared_impl/ppb_graphics_3d_shared.h
@@ -15,6 +15,7 @@
namespace gpu {
class CommandBuffer;
+class GpuControl;
class TransferBuffer;
namespace gles2 {
class GLES2CmdHelper;
@@ -85,6 +86,7 @@ class PPAPI_SHARED_EXPORT PPB_Graphics3D_Shared
virtual ~PPB_Graphics3D_Shared();
virtual gpu::CommandBuffer* GetCommandBuffer() = 0;
+ virtual gpu::GpuControl* GetGpuControl() = 0;
virtual int32 DoSwapBuffers() = 0;
bool HasPendingSwap() const;