Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(146)

Unified Diff: gpu/command_buffer/client/gles2_implementation_impl_autogen.h

Issue 859043005: Add Sync related APIs to GPU command buffer: Part I (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make win bots happy Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gpu/command_buffer/client/gles2_implementation_impl_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 25cd1cc979944e7c2b7569cf81b3aa2d695084a5..65e38b1c8e6e73c67ca0c5f2052668731f39eee8 100644
--- a/gpu/command_buffer/client/gles2_implementation_impl_autogen.h
+++ b/gpu/command_buffer/client/gles2_implementation_impl_autogen.h
@@ -546,6 +546,14 @@ void GLES2Implementation::DeleteSamplers(GLsizei n, const GLuint* samplers) {
CheckGLError();
}
+void GLES2Implementation::DeleteSync(GLsync sync) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDeleteSync(" << sync << ")");
+ GPU_CLIENT_DCHECK(sync != 0);
+ DeleteSyncHelper(sync);
+ CheckGLError();
+}
+
void GLES2Implementation::DeleteShader(GLuint shader) {
GPU_CLIENT_SINGLE_THREAD_CHECK();
GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDeleteShader(" << shader << ")");
@@ -631,6 +639,27 @@ void GLES2Implementation::DetachShader(GLuint program, GLuint shader) {
CheckGLError();
}
+GLsync GLES2Implementation::FenceSync(GLenum condition, GLbitfield flags) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glFenceSync("
+ << GLES2Util::GetStringSyncCondition(condition) << ", "
+ << flags << ")");
+ if (condition != 0x9117) {
+ SetGLError(GL_INVALID_ENUM, "glFenceSync", "condition GL_INVALID_ENUM");
+ return 0;
+ }
+ if (flags != 0) {
+ SetGLError(GL_INVALID_VALUE, "glFenceSync", "flags GL_INVALID_VALUE");
+ return 0;
+ }
+ GLuint client_id;
+ GetIdHandler(id_namespaces::kSyncs)->MakeIds(this, 0, 1, &client_id);
+ helper_->FenceSync(client_id);
+ GPU_CLIENT_LOG("returned " << client_id);
+ CheckGLError();
+ return reinterpret_cast<GLsync>(client_id);
+}
+
void GLES2Implementation::FramebufferRenderbuffer(GLenum target,
GLenum attachment,
GLenum renderbuffertarget,
@@ -1463,6 +1492,24 @@ GLboolean GLES2Implementation::IsShader(GLuint shader) {
return result_value;
}
+GLboolean GLES2Implementation::IsSync(GLsync sync) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ TRACE_EVENT0("gpu", "GLES2Implementation::IsSync");
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glIsSync(" << sync << ")");
+ typedef cmds::IsSync::Result Result;
+ Result* result = GetResultAs<Result*>();
+ if (!result) {
+ return GL_FALSE;
+ }
+ *result = 0;
+ helper_->IsSync(ToGLuint(sync), GetResultShmId(), GetResultShmOffset());
+ WaitForCmd();
+ GLboolean result_value = *result != 0;
+ GPU_CLIENT_LOG("returned " << result_value);
+ CheckGLError();
+ return result_value;
+}
+
GLboolean GLES2Implementation::IsTexture(GLuint texture) {
GPU_CLIENT_SINGLE_THREAD_CHECK();
TRACE_EVENT0("gpu", "GLES2Implementation::IsTexture");
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation_autogen.h ('k') | gpu/command_buffer/client/gles2_implementation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698