summaryrefslogtreecommitdiffstats
path: root/gpu
diff options
context:
space:
mode:
authorpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-27 01:29:51 +0000
committerpiman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-27 01:29:51 +0000
commit840a7e465bf6de0c40e1240b8fff7ef121f1f964 (patch)
tree58a110e62cc4f41e0f3b5c420580306360c1513f /gpu
parent7c97f8cec3686136ad08b583d1596f25c713e3ce (diff)
downloadchromium_src-840a7e465bf6de0c40e1240b8fff7ef121f1f964.zip
chromium_src-840a7e465bf6de0c40e1240b8fff7ef121f1f964.tar.gz
chromium_src-840a7e465bf6de0c40e1240b8fff7ef121f1f964.tar.bz2
Make WaitSyncPoint go through command buffers.
BUG=178305 Review URL: https://chromiumcodereview.appspot.com/12330129 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@184820 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'gpu')
-rw-r--r--gpu/GLES2/extensions/CHROMIUM/CHROMIUM_sync_point.txt73
-rw-r--r--gpu/GLES2/gl2chromium_autogen.h1
-rw-r--r--gpu/GLES2/gl2extchromium.h11
-rwxr-xr-xgpu/command_buffer/build_gles2_cmd_buffer.py6
-rw-r--r--gpu/command_buffer/client/gles2_c_lib_autogen.h5
-rw-r--r--gpu/command_buffer/client/gles2_cmd_helper_autogen.h8
-rw-r--r--gpu/command_buffer/client/gles2_implementation_autogen.h2
-rw-r--r--gpu/command_buffer/client/gles2_implementation_impl_autogen.h7
-rw-r--r--gpu/command_buffer/client/gles2_implementation_unittest_autogen.h11
-rw-r--r--gpu/command_buffer/client/gles2_interface_autogen.h1
-rw-r--r--gpu/command_buffer/client/gles2_interface_stub_autogen.h1
-rw-r--r--gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h2
-rw-r--r--gpu/command_buffer/client/gles2_trace_implementation_autogen.h1
-rw-r--r--gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h5
-rw-r--r--gpu/command_buffer/cmd_buffer_functions.txt1
-rw-r--r--gpu/command_buffer/common/gles2_cmd_format_autogen.h34
-rw-r--r--gpu/command_buffer/common/gles2_cmd_format_test_autogen.h13
-rw-r--r--gpu/command_buffer/common/gles2_cmd_ids_autogen.h1
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc17
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.h6
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_mock.h2
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h2
22 files changed, 210 insertions, 0 deletions
diff --git a/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_sync_point.txt b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_sync_point.txt
new file mode 100644
index 0000000..bc8665a
--- /dev/null
+++ b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_sync_point.txt
@@ -0,0 +1,73 @@
+Name
+
+ CHROMIUM_sync_point
+
+Name Strings
+
+ GL_CHROMIUM_sync_point
+
+Version
+
+ Last Modifed Date: February 25, 2013
+
+Dependencies
+
+ OpenGL ES 2.0 is required.
+
+Overview
+
+ This extension allows a client to order operations between contexts.
+
+ This extension implements a small subset of ARB_sync, with weaker
+ guarantees. In particular it doesn't ensure commands are actually executed
+ by the server, it only guarantees submission order.
+
+ It does however guarantee operation order with respect to
+ ConsumeTextureCHROMIUM and ProduceTextureCHROMIUM from
+ CHROMIUM_texture_mailbox, if present.
+
+Issues
+
+ None
+
+New Tokens
+
+ None
+
+New Procedures and Functions
+
+ The command
+
+ uint InsertSyncPointCHROMIUM()
+
+ creates a sync point and inserts it into the stream of commands for the
+ current context. The sync point acts as a fence, which is signaled when
+ previous commands have been submitted to the server, or when the context is
+ destroyed, whichever happens first. The sync point name is returned. The
+ sync point is implicitly deleted when it becomes signaled. The sync point
+ namespace is shared between all contexts on the same server, including other
+ context groups.
+
+
+ The command
+
+ void WaitSyncPointCHROMIUM(uint sync_point)
+
+ causes the current context to stop submitting commands until the specified
+ sync point becomes signaled. This is implemented as a server-side wait.
+ <sync_point> is the name of the sync point to wait for. If <sync_point>
+ isn't a valid sync point returned by InsertSyncPointCHROMIUM, or if the sync
+ point has already been deleted, the command is equivalent to a no-op and no
+ error is generated.
+
+Errors
+
+ None.
+
+New State
+
+ None.
+
+Revision History
+
+ 2/25/2013 Documented the extension
diff --git a/gpu/GLES2/gl2chromium_autogen.h b/gpu/GLES2/gl2chromium_autogen.h
index 88bf547..bda7202 100644
--- a/gpu/GLES2/gl2chromium_autogen.h
+++ b/gpu/GLES2/gl2chromium_autogen.h
@@ -221,6 +221,7 @@
#define glAsyncTexImage2DCHROMIUM GLES2_GET_FUN(AsyncTexImage2DCHROMIUM)
#define glDiscardFramebufferEXT GLES2_GET_FUN(DiscardFramebufferEXT)
#define glLoseContextCHROMIUM GLES2_GET_FUN(LoseContextCHROMIUM)
+#define glWaitSyncPointCHROMIUM GLES2_GET_FUN(WaitSyncPointCHROMIUM)
#endif // GPU_GLES2_GL2CHROMIUM_AUTOGEN_H_
diff --git a/gpu/GLES2/gl2extchromium.h b/gpu/GLES2/gl2extchromium.h
index 0dd021d..6609fd4 100644
--- a/gpu/GLES2/gl2extchromium.h
+++ b/gpu/GLES2/gl2extchromium.h
@@ -443,6 +443,17 @@ typedef void (GL_APIENTRYP PFNGLGETPROGRAMINFOCHROMIUMPROC) (
#define GL_CHROMIUM_front_buffer_cached 1
#endif /* GL_CHROMIUM_front_buffer_cached */
+/* GL_CHROMIUM_sync_point */
+#ifndef GL_CHROMIUM_sync_point
+#define GL_CHROMIUM_sync_point 1
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL GLuint GL_APIENTRY glInsertSyncPointCHROMIUM();
+GL_APICALL void GL_APIENTRY glWaitSyncPointCHROMIUM(GLuint sync_point);
+#endif
+typedef GLuint (GL_APIENTRYP PFNGLINSERTSYNCPOINTCHROMIUMPROC) ();
+typedef void (GL_APIENTRYP PFNGLWAITSYNCPOINTCHROMIUMPROC) (GLuint sync_point);
+#endif /* GL_CHROMIUM_sync_point */
+
#ifdef __cplusplus
}
#endif
diff --git a/gpu/command_buffer/build_gles2_cmd_buffer.py b/gpu/command_buffer/build_gles2_cmd_buffer.py
index f2cf609..c610dc7 100755
--- a/gpu/command_buffer/build_gles2_cmd_buffer.py
+++ b/gpu/command_buffer/build_gles2_cmd_buffer.py
@@ -2313,6 +2313,12 @@ _FUNCTION_INFO = {
'extension': True,
'chromium': True,
},
+ 'WaitSyncPointCHROMIUM': {
+ 'type': 'Custom',
+ 'impl_func': True,
+ 'extension': True,
+ 'chromium': True,
+ },
}
diff --git a/gpu/command_buffer/client/gles2_c_lib_autogen.h b/gpu/command_buffer/client/gles2_c_lib_autogen.h
index dff3135..80a4d23 100644
--- a/gpu/command_buffer/client/gles2_c_lib_autogen.h
+++ b/gpu/command_buffer/client/gles2_c_lib_autogen.h
@@ -718,6 +718,9 @@ void GLES2DiscardFramebufferEXT(
void GLES2LoseContextCHROMIUM(GLenum current, GLenum other) {
gles2::GetGLContext()->LoseContextCHROMIUM(current, other);
}
+void GLES2WaitSyncPointCHROMIUM(GLuint sync_point) {
+ gles2::GetGLContext()->WaitSyncPointCHROMIUM(sync_point);
+}
namespace gles2 {
@@ -1053,6 +1056,8 @@ NameToFunc g_gles2_function_table[] = {
glDiscardFramebufferEXT), },
{ "glLoseContextCHROMIUM", reinterpret_cast<GLES2FunctionPointer>(
glLoseContextCHROMIUM), },
+ { "glWaitSyncPointCHROMIUM", reinterpret_cast<GLES2FunctionPointer>(
+ glWaitSyncPointCHROMIUM), },
{ NULL, NULL, },
};
diff --git a/gpu/command_buffer/client/gles2_cmd_helper_autogen.h b/gpu/command_buffer/client/gles2_cmd_helper_autogen.h
index 18cf105..3aa64a1 100644
--- a/gpu/command_buffer/client/gles2_cmd_helper_autogen.h
+++ b/gpu/command_buffer/client/gles2_cmd_helper_autogen.h
@@ -1987,5 +1987,13 @@
}
}
+ void WaitSyncPointCHROMIUM(GLuint sync_point) {
+ gles2::WaitSyncPointCHROMIUM* c =
+ GetCmdSpace<gles2::WaitSyncPointCHROMIUM>();
+ if (c) {
+ c->Init(sync_point);
+ }
+ }
+
#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_CMD_HELPER_AUTOGEN_H_
diff --git a/gpu/command_buffer/client/gles2_implementation_autogen.h b/gpu/command_buffer/client/gles2_implementation_autogen.h
index efaaa28..febcaf4 100644
--- a/gpu/command_buffer/client/gles2_implementation_autogen.h
+++ b/gpu/command_buffer/client/gles2_implementation_autogen.h
@@ -524,5 +524,7 @@ virtual void DiscardFramebufferEXT(
virtual void LoseContextCHROMIUM(GLenum current, GLenum other) OVERRIDE;
+virtual void WaitSyncPointCHROMIUM(GLuint sync_point) OVERRIDE;
+
#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_AUTOGEN_H_
diff --git a/gpu/command_buffer/client/gles2_implementation_impl_autogen.h b/gpu/command_buffer/client/gles2_implementation_impl_autogen.h
index 9f93010..b2f7014e 100644
--- a/gpu/command_buffer/client/gles2_implementation_impl_autogen.h
+++ b/gpu/command_buffer/client/gles2_implementation_impl_autogen.h
@@ -1696,5 +1696,12 @@ void GLES2Implementation::LoseContextCHROMIUM(GLenum current, GLenum other) {
CheckGLError();
}
+void GLES2Implementation::WaitSyncPointCHROMIUM(GLuint sync_point) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glWaitSyncPointCHROMIUM(" << sync_point << ")"); // NOLINT
+ helper_->WaitSyncPointCHROMIUM(sync_point);
+ CheckGLError();
+}
+
#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_IMPL_AUTOGEN_H_
diff --git a/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h b/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h
index a63c284..78a74eb 100644
--- a/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h
+++ b/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h
@@ -1786,5 +1786,16 @@ TEST_F(GLES2ImplementationTest, LoseContextCHROMIUM) {
gl_->LoseContextCHROMIUM(1, 2);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
+
+TEST_F(GLES2ImplementationTest, WaitSyncPointCHROMIUM) {
+ struct Cmds {
+ WaitSyncPointCHROMIUM cmd;
+ };
+ Cmds expected;
+ expected.cmd.Init(1);
+
+ gl_->WaitSyncPointCHROMIUM(1);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_IMPLEMENTATION_UNITTEST_AUTOGEN_H_
diff --git a/gpu/command_buffer/client/gles2_interface_autogen.h b/gpu/command_buffer/client/gles2_interface_autogen.h
index f295bdf..b84dd71 100644
--- a/gpu/command_buffer/client/gles2_interface_autogen.h
+++ b/gpu/command_buffer/client/gles2_interface_autogen.h
@@ -302,5 +302,6 @@ virtual void AsyncTexImage2DCHROMIUM(
virtual void DiscardFramebufferEXT(
GLenum target, GLsizei count, const GLenum* attachments) = 0;
virtual void LoseContextCHROMIUM(GLenum current, GLenum other) = 0;
+virtual void WaitSyncPointCHROMIUM(GLuint sync_point) = 0;
#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_INTERFACE_AUTOGEN_H_
diff --git a/gpu/command_buffer/client/gles2_interface_stub_autogen.h b/gpu/command_buffer/client/gles2_interface_stub_autogen.h
index 80e5607..3c1c669 100644
--- a/gpu/command_buffer/client/gles2_interface_stub_autogen.h
+++ b/gpu/command_buffer/client/gles2_interface_stub_autogen.h
@@ -334,5 +334,6 @@ virtual void AsyncTexImage2DCHROMIUM(
virtual void DiscardFramebufferEXT(
GLenum target, GLsizei count, const GLenum* attachments) OVERRIDE;
virtual void LoseContextCHROMIUM(GLenum current, GLenum other) OVERRIDE;
+virtual void WaitSyncPointCHROMIUM(GLuint sync_point) OVERRIDE;
#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_INTERFACE_STUB_AUTOGEN_H_
diff --git a/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h b/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h
index bc55938..dce39c0 100644
--- a/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h
+++ b/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h
@@ -630,5 +630,7 @@ void GLES2InterfaceStub::DiscardFramebufferEXT(
void GLES2InterfaceStub::LoseContextCHROMIUM(
GLenum /* current */, GLenum /* other */) {
}
+void GLES2InterfaceStub::WaitSyncPointCHROMIUM(GLuint /* sync_point */) {
+}
#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_INTERFACE_STUB_IMPL_AUTOGEN_H_
diff --git a/gpu/command_buffer/client/gles2_trace_implementation_autogen.h b/gpu/command_buffer/client/gles2_trace_implementation_autogen.h
index 8c77e50..46cbdcc 100644
--- a/gpu/command_buffer/client/gles2_trace_implementation_autogen.h
+++ b/gpu/command_buffer/client/gles2_trace_implementation_autogen.h
@@ -334,5 +334,6 @@ virtual void AsyncTexImage2DCHROMIUM(
virtual void DiscardFramebufferEXT(
GLenum target, GLsizei count, const GLenum* attachments) OVERRIDE;
virtual void LoseContextCHROMIUM(GLenum current, GLenum other) OVERRIDE;
+virtual void WaitSyncPointCHROMIUM(GLuint sync_point) OVERRIDE;
#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_TRACE_IMPLEMENTATION_AUTOGEN_H_
diff --git a/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h b/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h
index 0c889f9..8aff42a 100644
--- a/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h
+++ b/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h
@@ -1164,5 +1164,10 @@ void GLES2TraceImplementation::LoseContextCHROMIUM(
gl_->LoseContextCHROMIUM(current, other);
}
+void GLES2TraceImplementation::WaitSyncPointCHROMIUM(GLuint sync_point) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::WaitSyncPointCHROMIUM");
+ gl_->WaitSyncPointCHROMIUM(sync_point);
+}
+
#endif // GPU_COMMAND_BUFFER_CLIENT_GLES2_TRACE_IMPLEMENTATION_IMPL_AUTOGEN_H_
diff --git a/gpu/command_buffer/cmd_buffer_functions.txt b/gpu/command_buffer/cmd_buffer_functions.txt
index 2664631..2ad875a 100644
--- a/gpu/command_buffer/cmd_buffer_functions.txt
+++ b/gpu/command_buffer/cmd_buffer_functions.txt
@@ -207,5 +207,6 @@ GL_APICALL void GL_APIENTRY glAsyncTexSubImage2DCHROMIUM (GLenumTextureT
GL_APICALL void GL_APIENTRY glAsyncTexImage2DCHROMIUM (GLenumTextureTarget target, GLint level, GLintTextureInternalFormat internalformat, GLsizei width, GLsizei height, GLintTextureBorder border, GLenumTextureFormat format, GLenumPixelType type, const void* pixels);
GL_APICALL void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei count, const GLenum* attachments);
GL_APICALL void GL_APIENTRY glLoseContextCHROMIUM (GLenum current, GLenum other);
+GL_APICALL void GL_APIENTRY glWaitSyncPointCHROMIUM (GLuint sync_point);
diff --git a/gpu/command_buffer/common/gles2_cmd_format_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_autogen.h
index ca9c90b..dea5003 100644
--- a/gpu/command_buffer/common/gles2_cmd_format_autogen.h
+++ b/gpu/command_buffer/common/gles2_cmd_format_autogen.h
@@ -10868,6 +10868,40 @@ COMPILE_ASSERT(offsetof(LoseContextCHROMIUM, current) == 4,
COMPILE_ASSERT(offsetof(LoseContextCHROMIUM, other) == 8,
OffsetOf_LoseContextCHROMIUM_other_not_8);
+struct WaitSyncPointCHROMIUM {
+ typedef WaitSyncPointCHROMIUM ValueType;
+ static const CommandId kCmdId = kWaitSyncPointCHROMIUM;
+ static const cmd::ArgFlags kArgFlags = cmd::kFixed;
+
+ static uint32 ComputeSize() {
+ return static_cast<uint32>(sizeof(ValueType)); // NOLINT
+ }
+
+ void SetHeader() {
+ header.SetCmd<ValueType>();
+ }
+
+ void Init(GLuint _sync_point) {
+ SetHeader();
+ sync_point = _sync_point;
+ }
+
+ void* Set(void* cmd, GLuint _sync_point) {
+ static_cast<ValueType*>(cmd)->Init(_sync_point);
+ return NextCmdAddress<ValueType>(cmd);
+ }
+
+ gpu::CommandHeader header;
+ uint32 sync_point;
+};
+
+COMPILE_ASSERT(sizeof(WaitSyncPointCHROMIUM) == 8,
+ Sizeof_WaitSyncPointCHROMIUM_is_not_8);
+COMPILE_ASSERT(offsetof(WaitSyncPointCHROMIUM, header) == 0,
+ OffsetOf_WaitSyncPointCHROMIUM_header_not_0);
+COMPILE_ASSERT(offsetof(WaitSyncPointCHROMIUM, sync_point) == 4,
+ OffsetOf_WaitSyncPointCHROMIUM_sync_point_not_4);
+
#endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_AUTOGEN_H_
diff --git a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
index 80a2768..d45d9a2 100644
--- a/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
+++ b/gpu/command_buffer/common/gles2_cmd_format_test_autogen.h
@@ -4379,5 +4379,18 @@ TEST_F(GLES2FormatTest, LoseContextCHROMIUM) {
next_cmd, sizeof(cmd));
}
+TEST_F(GLES2FormatTest, WaitSyncPointCHROMIUM) {
+ WaitSyncPointCHROMIUM& cmd = *GetBufferAs<WaitSyncPointCHROMIUM>();
+ void* next_cmd = cmd.Set(
+ &cmd,
+ static_cast<GLuint>(11));
+ EXPECT_EQ(static_cast<uint32>(WaitSyncPointCHROMIUM::kCmdId),
+ cmd.header.command);
+ EXPECT_EQ(sizeof(cmd), cmd.header.size * 4u);
+ EXPECT_EQ(static_cast<GLuint>(11), cmd.sync_point);
+ CheckBytesWrittenMatchesExpectedSize(
+ next_cmd, sizeof(cmd));
+}
+
#endif // GPU_COMMAND_BUFFER_COMMON_GLES2_CMD_FORMAT_TEST_AUTOGEN_H_
diff --git a/gpu/command_buffer/common/gles2_cmd_ids_autogen.h b/gpu/command_buffer/common/gles2_cmd_ids_autogen.h
index 13f6170..6e96efd 100644
--- a/gpu/command_buffer/common/gles2_cmd_ids_autogen.h
+++ b/gpu/command_buffer/common/gles2_cmd_ids_autogen.h
@@ -248,6 +248,7 @@
OP(DiscardFramebufferEXT) /* 491 */ \
OP(DiscardFramebufferEXTImmediate) /* 492 */ \
OP(LoseContextCHROMIUM) /* 493 */ \
+ OP(WaitSyncPointCHROMIUM) /* 494 */ \
enum CommandId {
kStartPoint = cmd::kLastCommonId, // All GLES2 commands start after this.
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 5b0fc8f..90f18ff 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -583,6 +583,8 @@ class GLES2DecoderImpl : public GLES2Decoder {
const base::Callback<void(gfx::Size)>& callback) OVERRIDE;
virtual void SetMsgCallback(const MsgCallback& callback) OVERRIDE;
+ virtual void SetWaitSyncPointCallback(
+ const WaitSyncPointCallback& callback) OVERRIDE;
virtual void SetStreamTextureManager(StreamTextureManager* manager) OVERRIDE;
@@ -1660,6 +1662,7 @@ class GLES2DecoderImpl : public GLES2Decoder {
base::Callback<void(gfx::Size)> resize_callback_;
MsgCallback msg_callback_;
+ WaitSyncPointCallback wait_sync_point_callback_;
StreamTextureManager* stream_texture_manager_;
scoped_ptr<gfx::AsyncPixelTransferDelegate> async_pixel_transfer_delegate_;
@@ -3007,6 +3010,11 @@ void GLES2DecoderImpl::SetMsgCallback(const MsgCallback& callback) {
msg_callback_ = callback;
}
+void GLES2DecoderImpl::SetWaitSyncPointCallback(
+ const WaitSyncPointCallback& callback) {
+ wait_sync_point_callback_ = callback;
+}
+
void GLES2DecoderImpl::SetStreamTextureManager(StreamTextureManager* manager) {
stream_texture_manager_ = manager;
}
@@ -9065,6 +9073,15 @@ error::Error GLES2DecoderImpl::HandleLoseContextCHROMIUM(
return error::kLostContext;
}
+error::Error GLES2DecoderImpl::HandleWaitSyncPointCHROMIUM(
+ uint32 immediate_data_size, const gles2::WaitSyncPointCHROMIUM& c) {
+ if (wait_sync_point_callback_.is_null())
+ return error::kNoError;
+
+ return wait_sync_point_callback_.Run(c.sync_point) ?
+ error::kNoError : error::kDeferCommandUntilLater;
+}
+
bool GLES2DecoderImpl::GenQueriesEXTHelper(
GLsizei n, const GLuint* client_ids) {
for (GLsizei ii = 0; ii < n; ++ii) {
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.h b/gpu/command_buffer/service/gles2_cmd_decoder.h
index 33b3831..498a9a9 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.h
@@ -53,6 +53,7 @@ class GPU_EXPORT GLES2Decoder : public base::SupportsWeakPtr<GLES2Decoder>,
public:
typedef error::Error Error;
typedef base::Callback<void(int32 id, const std::string& msg)> MsgCallback;
+ typedef base::Callback<bool(uint32 id)> WaitSyncPointCallback;
// Creates a decoder.
static GLES2Decoder* Create(ContextGroup* group);
@@ -201,6 +202,11 @@ class GPU_EXPORT GLES2Decoder : public base::SupportsWeakPtr<GLES2Decoder>,
// A callback for messages from the decoder.
virtual void SetMsgCallback(const MsgCallback& callback) = 0;
+ // Sets the callback for waiting on a sync point. The callback returns the
+ // scheduling status (i.e. true if the channel is still scheduled).
+ virtual void SetWaitSyncPointCallback(
+ const WaitSyncPointCallback& callback) = 0;
+
virtual uint32 GetTextureUploadCount() = 0;
virtual base::TimeDelta GetTotalTextureUploadTime() = 0;
virtual base::TimeDelta GetTotalProcessingCommandsTime() = 0;
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_mock.h b/gpu/command_buffer/service/gles2_cmd_decoder_mock.h
index c452454..3a21025 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_mock.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_mock.h
@@ -89,6 +89,8 @@ class MockGLES2Decoder : public GLES2Decoder {
bool is_texture_immutable));
MOCK_METHOD0(GetGLError, uint32());
MOCK_METHOD1(SetMsgCallback, void(const MsgCallback& callback));
+ MOCK_METHOD1(SetWaitSyncPointCallback,
+ void(const WaitSyncPointCallback& callback));
MOCK_METHOD0(GetTextureUploadCount, uint32());
MOCK_METHOD0(GetTotalTextureUploadTime, base::TimeDelta());
MOCK_METHOD0(GetTotalProcessingCommandsTime, base::TimeDelta());
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h
index f644348..a8399c6 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h
+++ b/gpu/command_buffer/service/gles2_cmd_decoder_unittest_3_autogen.h
@@ -68,5 +68,7 @@
// TODO(gman): DiscardFramebufferEXTImmediate
// TODO(gman): LoseContextCHROMIUM
+// TODO(gman): WaitSyncPointCHROMIUM
+
#endif // GPU_COMMAND_BUFFER_SERVICE_GLES2_CMD_DECODER_UNITTEST_3_AUTOGEN_H_