summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-08 03:08:01 +0000
committerpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-08 03:08:01 +0000
commitb096d03b3a3c42789371afde33de83b8b9c2f131 (patch)
treef59685dff742251844f4a56f26dfe2f026d628ed /ppapi
parent26eee511db49e180162ce56f99dc330488140192 (diff)
downloadchromium_src-b096d03b3a3c42789371afde33de83b8b9c2f131.zip
chromium_src-b096d03b3a3c42789371afde33de83b8b9c2f131.tar.gz
chromium_src-b096d03b3a3c42789371afde33de83b8b9c2f131.tar.bz2
Move InsertSyncPoint to GLES2Interface
This is needed to allow Pepper to use mailboxes rather than parenting to integrate with the compositor. BUG=164095 Review URL: https://chromiumcodereview.appspot.com/12581004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186869 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/proxy/ppapi_command_buffer_proxy.cc9
-rw-r--r--ppapi/proxy/ppapi_command_buffer_proxy.h1
-rw-r--r--ppapi/proxy/ppapi_messages.h3
-rw-r--r--ppapi/proxy/ppb_graphics_3d_proxy.cc19
-rw-r--r--ppapi/proxy/ppb_graphics_3d_proxy.h2
-rw-r--r--ppapi/thunk/ppb_graphics_3d_api.h2
6 files changed, 36 insertions, 0 deletions
diff --git a/ppapi/proxy/ppapi_command_buffer_proxy.cc b/ppapi/proxy/ppapi_command_buffer_proxy.cc
index dff891e..98c2353 100644
--- a/ppapi/proxy/ppapi_command_buffer_proxy.cc
+++ b/ppapi/proxy/ppapi_command_buffer_proxy.cc
@@ -226,6 +226,15 @@ void PpapiCommandBufferProxy::SetContextLostReason(
NOTREACHED();
}
+uint32 PpapiCommandBufferProxy::InsertSyncPoint() {
+ uint32 sync_point = 0;
+ if (last_state_.error == gpu::error::kNoError) {
+ Send(new PpapiHostMsg_PPBGraphics3D_InsertSyncPoint(
+ ppapi::API_ID_PPB_GRAPHICS_3D, resource_, &sync_point));
+ }
+ return sync_point;
+}
+
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 365203d..eef8d12 100644
--- a/ppapi/proxy/ppapi_command_buffer_proxy.h
+++ b/ppapi/proxy/ppapi_command_buffer_proxy.h
@@ -51,6 +51,7 @@ class PPAPI_PROXY_EXPORT PpapiCommandBufferProxy : public CommandBufferProxy {
virtual void SetToken(int32 token);
virtual void SetParseError(gpu::error::Error error);
virtual void SetContextLostReason(gpu::error::ContextLostReason reason);
+ virtual uint32 InsertSyncPoint();
private:
bool Send(IPC::Message* msg);
diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h
index 1019514..4e9c0e2 100644
--- a/ppapi/proxy/ppapi_messages.h
+++ b/ppapi/proxy/ppapi_messages.h
@@ -849,6 +849,9 @@ IPC_SYNC_MESSAGE_ROUTED2_1(PpapiHostMsg_PPBGraphics3D_GetTransferBuffer,
ppapi::proxy::SerializedHandle /* transfer_buffer */)
IPC_MESSAGE_ROUTED1(PpapiHostMsg_PPBGraphics3D_SwapBuffers,
ppapi::HostResource /* graphics_3d */)
+IPC_SYNC_MESSAGE_ROUTED1_1(PpapiHostMsg_PPBGraphics3D_InsertSyncPoint,
+ ppapi::HostResource /* context */,
+ uint32 /* sync_point */)
// PPB_ImageData.
IPC_SYNC_MESSAGE_ROUTED4_3(PpapiHostMsg_PPBImageData_Create,
diff --git a/ppapi/proxy/ppb_graphics_3d_proxy.cc b/ppapi/proxy/ppb_graphics_3d_proxy.cc
index a6f6745..11db5a1 100644
--- a/ppapi/proxy/ppb_graphics_3d_proxy.cc
+++ b/ppapi/proxy/ppb_graphics_3d_proxy.cc
@@ -175,6 +175,10 @@ class Graphics3D::LockingCommandBuffer : public gpu::CommandBuffer {
MaybeLock lock(need_to_lock_);
gpu_command_buffer_->SetContextLostReason(reason);
}
+ virtual uint32 InsertSyncPoint() OVERRIDE {
+ MaybeLock lock(need_to_lock_);
+ return gpu_command_buffer_->InsertSyncPoint();
+ }
// Weak pointer - see class Graphics3D for the scopted_ptr.
gpu::CommandBuffer* gpu_command_buffer_;
@@ -248,6 +252,11 @@ PP_Graphics3DTrustedState Graphics3D::FlushSyncFast(int32_t put_offset,
return GetErrorState();
}
+uint32_t Graphics3D::InsertSyncPoint() {
+ NOTREACHED();
+ return 0;
+}
+
gpu::CommandBuffer* Graphics3D::GetCommandBuffer() {
return locking_command_buffer_.get();
}
@@ -360,6 +369,8 @@ bool PPB_Graphics3D_Proxy::OnMessageReceived(const IPC::Message& msg) {
OnMsgGetTransferBuffer)
IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBGraphics3D_SwapBuffers,
OnMsgSwapBuffers)
+ IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBGraphics3D_InsertSyncPoint,
+ OnMsgInsertSyncPoint)
#endif // !defined(OS_NACL)
IPC_MESSAGE_HANDLER(PpapiMsg_PPBGraphics3D_SwapBuffersACK,
@@ -489,6 +500,14 @@ void PPB_Graphics3D_Proxy::OnMsgSwapBuffers(const HostResource& context) {
if (enter.succeeded())
enter.SetResult(enter.object()->SwapBuffers(enter.callback()));
}
+
+void PPB_Graphics3D_Proxy::OnMsgInsertSyncPoint(const HostResource& context,
+ uint32* sync_point) {
+ *sync_point = 0;
+ EnterHostFromHostResource<PPB_Graphics3D_API> enter(context);
+ if (enter.succeeded())
+ *sync_point = enter.object()->InsertSyncPoint();
+}
#endif // !defined(OS_NACL)
void PPB_Graphics3D_Proxy::OnMsgSwapBuffersACK(const HostResource& resource,
diff --git a/ppapi/proxy/ppb_graphics_3d_proxy.h b/ppapi/proxy/ppb_graphics_3d_proxy.h
index 493c489..f07d2c4 100644
--- a/ppapi/proxy/ppb_graphics_3d_proxy.h
+++ b/ppapi/proxy/ppb_graphics_3d_proxy.h
@@ -46,6 +46,7 @@ class Graphics3D : public PPB_Graphics3D_Shared {
virtual PP_Graphics3DTrustedState FlushSyncFast(
int32_t put_offset,
int32_t last_known_get) OVERRIDE;
+ virtual uint32_t InsertSyncPoint() OVERRIDE;
private:
class LockingCommandBuffer;
@@ -105,6 +106,7 @@ class PPB_Graphics3D_Proxy : public InterfaceProxy {
int32 id,
ppapi::proxy::SerializedHandle* transfer_buffer);
void OnMsgSwapBuffers(const HostResource& context);
+ void OnMsgInsertSyncPoint(const HostResource& context, uint32* sync_point);
// Renderer->plugin message handlers.
void OnMsgSwapBuffersACK(const HostResource& context,
int32_t pp_error);
diff --git a/ppapi/thunk/ppb_graphics_3d_api.h b/ppapi/thunk/ppb_graphics_3d_api.h
index 76197b1..4c7dbe6 100644
--- a/ppapi/thunk/ppb_graphics_3d_api.h
+++ b/ppapi/thunk/ppb_graphics_3d_api.h
@@ -53,6 +53,8 @@ class PPAPI_THUNK_EXPORT PPB_Graphics3D_API {
GLenum type,
GLenum access) = 0;
virtual void UnmapTexSubImage2DCHROMIUM(const void* mem) = 0;
+
+ virtual uint32_t InsertSyncPoint() = 0;
};
} // namespace thunk