summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer/client
diff options
context:
space:
mode:
Diffstat (limited to 'gpu/command_buffer/client')
-rw-r--r--gpu/command_buffer/client/gles2_c_lib_autogen.h106
-rw-r--r--gpu/command_buffer/client/gles2_cmd_helper_autogen.h119
-rw-r--r--gpu/command_buffer/client/gles2_implementation.cc163
-rw-r--r--gpu/command_buffer/client/gles2_implementation.h2
-rw-r--r--gpu/command_buffer/client/gles2_implementation_autogen.h41
-rw-r--r--gpu/command_buffer/client/gles2_implementation_impl_autogen.h117
-rw-r--r--gpu/command_buffer/client/gles2_implementation_unittest_autogen.h132
-rw-r--r--gpu/command_buffer/client/gles2_interface_autogen.h30
-rw-r--r--gpu/command_buffer/client/gles2_interface_stub_autogen.h28
-rw-r--r--gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h54
-rw-r--r--gpu/command_buffer/client/gles2_trace_implementation_autogen.h28
-rw-r--r--gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h93
-rw-r--r--gpu/command_buffer/client/share_group.cc32
-rw-r--r--gpu/command_buffer/client/share_group.h32
14 files changed, 977 insertions, 0 deletions
diff --git a/gpu/command_buffer/client/gles2_c_lib_autogen.h b/gpu/command_buffer/client/gles2_c_lib_autogen.h
index 4f96672a..4e304c1 100644
--- a/gpu/command_buffer/client/gles2_c_lib_autogen.h
+++ b/gpu/command_buffer/client/gles2_c_lib_autogen.h
@@ -1410,6 +1410,59 @@ void GLES2MatrixLoadfCHROMIUM(GLenum matrixMode, const GLfloat* m) {
void GLES2MatrixLoadIdentityCHROMIUM(GLenum matrixMode) {
gles2::GetGLContext()->MatrixLoadIdentityCHROMIUM(matrixMode);
}
+GLuint GLES2GenPathsCHROMIUM(GLsizei range) {
+ return gles2::GetGLContext()->GenPathsCHROMIUM(range);
+}
+void GLES2DeletePathsCHROMIUM(GLuint path, GLsizei range) {
+ gles2::GetGLContext()->DeletePathsCHROMIUM(path, range);
+}
+GLboolean GLES2IsPathCHROMIUM(GLuint path) {
+ return gles2::GetGLContext()->IsPathCHROMIUM(path);
+}
+void GLES2PathCommandsCHROMIUM(GLuint path,
+ GLsizei numCommands,
+ const GLubyte* commands,
+ GLsizei numCoords,
+ GLenum coordType,
+ const GLvoid* coords) {
+ gles2::GetGLContext()->PathCommandsCHROMIUM(path, numCommands, commands,
+ numCoords, coordType, coords);
+}
+void GLES2PathParameterfCHROMIUM(GLuint path, GLenum pname, GLfloat value) {
+ gles2::GetGLContext()->PathParameterfCHROMIUM(path, pname, value);
+}
+void GLES2PathParameteriCHROMIUM(GLuint path, GLenum pname, GLint value) {
+ gles2::GetGLContext()->PathParameteriCHROMIUM(path, pname, value);
+}
+void GLES2PathStencilFuncCHROMIUM(GLenum func, GLint ref, GLuint mask) {
+ gles2::GetGLContext()->PathStencilFuncCHROMIUM(func, ref, mask);
+}
+void GLES2StencilFillPathCHROMIUM(GLuint path, GLenum fillMode, GLuint mask) {
+ gles2::GetGLContext()->StencilFillPathCHROMIUM(path, fillMode, mask);
+}
+void GLES2StencilStrokePathCHROMIUM(GLuint path, GLint reference, GLuint mask) {
+ gles2::GetGLContext()->StencilStrokePathCHROMIUM(path, reference, mask);
+}
+void GLES2CoverFillPathCHROMIUM(GLuint path, GLenum coverMode) {
+ gles2::GetGLContext()->CoverFillPathCHROMIUM(path, coverMode);
+}
+void GLES2CoverStrokePathCHROMIUM(GLuint path, GLenum coverMode) {
+ gles2::GetGLContext()->CoverStrokePathCHROMIUM(path, coverMode);
+}
+void GLES2StencilThenCoverFillPathCHROMIUM(GLuint path,
+ GLenum fillMode,
+ GLuint mask,
+ GLenum coverMode) {
+ gles2::GetGLContext()->StencilThenCoverFillPathCHROMIUM(path, fillMode, mask,
+ coverMode);
+}
+void GLES2StencilThenCoverStrokePathCHROMIUM(GLuint path,
+ GLint reference,
+ GLuint mask,
+ GLenum coverMode) {
+ gles2::GetGLContext()->StencilThenCoverStrokePathCHROMIUM(path, reference,
+ mask, coverMode);
+}
GLenum GLES2GetGraphicsResetStatusKHR() {
return gles2::GetGLContext()->GetGraphicsResetStatusKHR();
}
@@ -2648,6 +2701,59 @@ extern const NameToFunc g_gles2_function_table[] = {
reinterpret_cast<GLES2FunctionPointer>(glMatrixLoadIdentityCHROMIUM),
},
{
+ "glGenPathsCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glGenPathsCHROMIUM),
+ },
+ {
+ "glDeletePathsCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glDeletePathsCHROMIUM),
+ },
+ {
+ "glIsPathCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glIsPathCHROMIUM),
+ },
+ {
+ "glPathCommandsCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glPathCommandsCHROMIUM),
+ },
+ {
+ "glPathParameterfCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glPathParameterfCHROMIUM),
+ },
+ {
+ "glPathParameteriCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glPathParameteriCHROMIUM),
+ },
+ {
+ "glPathStencilFuncCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glPathStencilFuncCHROMIUM),
+ },
+ {
+ "glStencilFillPathCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glStencilFillPathCHROMIUM),
+ },
+ {
+ "glStencilStrokePathCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glStencilStrokePathCHROMIUM),
+ },
+ {
+ "glCoverFillPathCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glCoverFillPathCHROMIUM),
+ },
+ {
+ "glCoverStrokePathCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glCoverStrokePathCHROMIUM),
+ },
+ {
+ "glStencilThenCoverFillPathCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(glStencilThenCoverFillPathCHROMIUM),
+ },
+ {
+ "glStencilThenCoverStrokePathCHROMIUM",
+ reinterpret_cast<GLES2FunctionPointer>(
+ glStencilThenCoverStrokePathCHROMIUM),
+ },
+ {
"glGetGraphicsResetStatusKHR",
reinterpret_cast<GLES2FunctionPointer>(glGetGraphicsResetStatusKHR),
},
diff --git a/gpu/command_buffer/client/gles2_cmd_helper_autogen.h b/gpu/command_buffer/client/gles2_cmd_helper_autogen.h
index ce32148..abf4902 100644
--- a/gpu/command_buffer/client/gles2_cmd_helper_autogen.h
+++ b/gpu/command_buffer/client/gles2_cmd_helper_autogen.h
@@ -2833,6 +2833,125 @@ void MatrixLoadIdentityCHROMIUM(GLenum matrixMode) {
}
}
+void GenPathsCHROMIUM(GLuint first_client_id, GLsizei range) {
+ gles2::cmds::GenPathsCHROMIUM* c =
+ GetCmdSpace<gles2::cmds::GenPathsCHROMIUM>();
+ if (c) {
+ c->Init(first_client_id, range);
+ }
+}
+
+void DeletePathsCHROMIUM(GLuint first_client_id, GLsizei range) {
+ gles2::cmds::DeletePathsCHROMIUM* c =
+ GetCmdSpace<gles2::cmds::DeletePathsCHROMIUM>();
+ if (c) {
+ c->Init(first_client_id, range);
+ }
+}
+
+void IsPathCHROMIUM(GLuint path,
+ uint32_t result_shm_id,
+ uint32_t result_shm_offset) {
+ gles2::cmds::IsPathCHROMIUM* c = GetCmdSpace<gles2::cmds::IsPathCHROMIUM>();
+ if (c) {
+ c->Init(path, result_shm_id, result_shm_offset);
+ }
+}
+
+void PathCommandsCHROMIUM(GLuint path,
+ GLsizei numCommands,
+ uint32_t commands_shm_id,
+ uint32_t commands_shm_offset,
+ GLsizei numCoords,
+ GLenum coordType,
+ uint32_t coords_shm_id,
+ uint32_t coords_shm_offset) {
+ gles2::cmds::PathCommandsCHROMIUM* c =
+ GetCmdSpace<gles2::cmds::PathCommandsCHROMIUM>();
+ if (c) {
+ c->Init(path, numCommands, commands_shm_id, commands_shm_offset, numCoords,
+ coordType, coords_shm_id, coords_shm_offset);
+ }
+}
+
+void PathParameterfCHROMIUM(GLuint path, GLenum pname, GLfloat value) {
+ gles2::cmds::PathParameterfCHROMIUM* c =
+ GetCmdSpace<gles2::cmds::PathParameterfCHROMIUM>();
+ if (c) {
+ c->Init(path, pname, value);
+ }
+}
+
+void PathParameteriCHROMIUM(GLuint path, GLenum pname, GLint value) {
+ gles2::cmds::PathParameteriCHROMIUM* c =
+ GetCmdSpace<gles2::cmds::PathParameteriCHROMIUM>();
+ if (c) {
+ c->Init(path, pname, value);
+ }
+}
+
+void PathStencilFuncCHROMIUM(GLenum func, GLint ref, GLuint mask) {
+ gles2::cmds::PathStencilFuncCHROMIUM* c =
+ GetCmdSpace<gles2::cmds::PathStencilFuncCHROMIUM>();
+ if (c) {
+ c->Init(func, ref, mask);
+ }
+}
+
+void StencilFillPathCHROMIUM(GLuint path, GLenum fillMode, GLuint mask) {
+ gles2::cmds::StencilFillPathCHROMIUM* c =
+ GetCmdSpace<gles2::cmds::StencilFillPathCHROMIUM>();
+ if (c) {
+ c->Init(path, fillMode, mask);
+ }
+}
+
+void StencilStrokePathCHROMIUM(GLuint path, GLint reference, GLuint mask) {
+ gles2::cmds::StencilStrokePathCHROMIUM* c =
+ GetCmdSpace<gles2::cmds::StencilStrokePathCHROMIUM>();
+ if (c) {
+ c->Init(path, reference, mask);
+ }
+}
+
+void CoverFillPathCHROMIUM(GLuint path, GLenum coverMode) {
+ gles2::cmds::CoverFillPathCHROMIUM* c =
+ GetCmdSpace<gles2::cmds::CoverFillPathCHROMIUM>();
+ if (c) {
+ c->Init(path, coverMode);
+ }
+}
+
+void CoverStrokePathCHROMIUM(GLuint path, GLenum coverMode) {
+ gles2::cmds::CoverStrokePathCHROMIUM* c =
+ GetCmdSpace<gles2::cmds::CoverStrokePathCHROMIUM>();
+ if (c) {
+ c->Init(path, coverMode);
+ }
+}
+
+void StencilThenCoverFillPathCHROMIUM(GLuint path,
+ GLenum fillMode,
+ GLuint mask,
+ GLenum coverMode) {
+ gles2::cmds::StencilThenCoverFillPathCHROMIUM* c =
+ GetCmdSpace<gles2::cmds::StencilThenCoverFillPathCHROMIUM>();
+ if (c) {
+ c->Init(path, fillMode, mask, coverMode);
+ }
+}
+
+void StencilThenCoverStrokePathCHROMIUM(GLuint path,
+ GLint reference,
+ GLuint mask,
+ GLenum coverMode) {
+ gles2::cmds::StencilThenCoverStrokePathCHROMIUM* c =
+ GetCmdSpace<gles2::cmds::StencilThenCoverStrokePathCHROMIUM>();
+ if (c) {
+ c->Init(path, reference, mask, coverMode);
+ }
+}
+
void BlendBarrierKHR() {
gles2::cmds::BlendBarrierKHR* c = GetCmdSpace<gles2::cmds::BlendBarrierKHR>();
if (c) {
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 5cc28ddc..5dcc9dd 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -255,6 +255,11 @@ IdHandlerInterface* GLES2Implementation::GetIdHandler(int namespace_id) const {
return share_group_->GetIdHandler(namespace_id);
}
+RangeIdHandlerInterface* GLES2Implementation::GetRangeIdHandler(
+ int namespace_id) const {
+ return share_group_->GetRangeIdHandler(namespace_id);
+}
+
IdAllocator* GLES2Implementation::GetIdAllocator(int namespace_id) const {
if (namespace_id == id_namespaces::kQueries)
return query_id_allocator_.get();
@@ -5824,6 +5829,164 @@ void GLES2Implementation::GetInternalformativ(
CheckGLError();
}
+GLuint GLES2Implementation::GenPathsCHROMIUM(GLsizei range) {
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glGenPathsCHROMIUM(" << range
+ << ")");
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ static const char kFunctionName[] = "glGenPathsCHROMIUM";
+ if (range < 0) {
+ SetGLError(GL_INVALID_VALUE, kFunctionName, "range < 0");
+ return 0;
+ }
+ if (!base::IsValueInRangeForNumericType<int32_t>(range)) {
+ SetGLError(GL_INVALID_OPERATION, kFunctionName, "range more than 32-bit");
+ return 0;
+ }
+ if (range == 0)
+ return 0;
+
+ GLuint first_client_id = 0;
+ GetRangeIdHandler(id_namespaces::kPaths)
+ ->MakeIdRange(this, range, &first_client_id);
+
+ if (first_client_id == 0) {
+ // Ran out of id space. Is not specified to raise any gl errors.
+ return 0;
+ }
+
+ helper_->GenPathsCHROMIUM(first_client_id, range);
+
+ GPU_CLIENT_LOG_CODE_BLOCK({
+ for (GLsizei i = 0; i < range; ++i) {
+ GPU_CLIENT_LOG(" " << i << ": " << (first_client_id + i));
+ }
+ });
+ CheckGLError();
+ return first_client_id;
+}
+
+void GLES2Implementation::DeletePathsCHROMIUM(GLuint first_client_id,
+ GLsizei range) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glDeletePathsCHROMIUM("
+ << first_client_id << ", " << range << ")");
+ static const char kFunctionName[] = "glDeletePathsCHROMIUM";
+
+ if (range < 0) {
+ SetGLError(GL_INVALID_VALUE, kFunctionName, "range < 0");
+ return;
+ }
+ if (!base::IsValueInRangeForNumericType<int32_t>(range)) {
+ SetGLError(GL_INVALID_OPERATION, kFunctionName, "range more than 32-bit");
+ return;
+ }
+ if (range == 0)
+ return;
+
+ GLuint last_client_id;
+ if (!SafeAddUint32(first_client_id, range - 1, &last_client_id)) {
+ SetGLError(GL_INVALID_OPERATION, kFunctionName, "overflow");
+ return;
+ }
+
+ GetRangeIdHandler(id_namespaces::kPaths)
+ ->FreeIdRange(this, first_client_id, range,
+ &GLES2Implementation::DeletePathsCHROMIUMStub);
+ CheckGLError();
+}
+
+void GLES2Implementation::DeletePathsCHROMIUMStub(GLuint first_client_id,
+ GLsizei range) {
+ helper_->DeletePathsCHROMIUM(first_client_id, range);
+}
+
+void GLES2Implementation::PathCommandsCHROMIUM(GLuint path,
+ GLsizei num_commands,
+ const GLubyte* commands,
+ GLsizei num_coords,
+ GLenum coord_type,
+ const void* coords) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glPathCommandsCHROMIUM(" << path
+ << ", " << num_commands << ", " << commands << ", "
+ << num_coords << ", " << coords << ")");
+ static const char kFunctionName[] = "glPathCommandsCHROMIUM";
+ if (path == 0) {
+ SetGLError(GL_INVALID_VALUE, kFunctionName, "invalid path object");
+ return;
+ }
+ if (num_commands < 0) {
+ SetGLError(GL_INVALID_VALUE, kFunctionName, "numCommands < 0");
+ return;
+ }
+ if (num_commands != 0 && !commands) {
+ SetGLError(GL_INVALID_VALUE, kFunctionName, "missing commands");
+ return;
+ }
+ if (num_coords < 0) {
+ SetGLError(GL_INVALID_VALUE, kFunctionName, "numCoords < 0");
+ return;
+ }
+ if (num_coords != 0 && !coords) {
+ SetGLError(GL_INVALID_VALUE, kFunctionName, "missing coords");
+ return;
+ }
+ uint32 coord_type_size = GLES2Util::GetGLTypeSizeForPathCoordType(coord_type);
+ if (coord_type_size == 0) {
+ SetGLError(GL_INVALID_ENUM, kFunctionName, "invalid coordType");
+ return;
+ }
+ if (num_commands == 0) {
+ // No commands must mean no coords, thus nothing to memcpy. Let
+ // the service validate the call. Validate coord_type above, so
+ // that the parameters will be checked the in the same order
+ // regardless of num_commands.
+ helper_->PathCommandsCHROMIUM(path, num_commands, 0, 0, num_coords,
+ coord_type, 0, 0);
+ CheckGLError();
+ return;
+ }
+
+ uint32 coords_size;
+ if (!SafeMultiplyUint32(num_coords, coord_type_size, &coords_size)) {
+ SetGLError(GL_INVALID_OPERATION, kFunctionName, "overflow");
+ return;
+ }
+
+ uint32 required_buffer_size;
+ if (!SafeAddUint32(coords_size, num_commands, &required_buffer_size)) {
+ SetGLError(GL_INVALID_OPERATION, kFunctionName, "overflow");
+ return;
+ }
+
+ ScopedTransferBufferPtr buffer(required_buffer_size, helper_,
+ transfer_buffer_);
+ if (!buffer.valid() || buffer.size() < required_buffer_size) {
+ SetGLError(GL_OUT_OF_MEMORY, kFunctionName, "too large");
+ return;
+ }
+
+ uint32 coords_shm_id = 0;
+ uint32 coords_shm_offset = 0;
+ // Copy coords first because they need more strict alignment.
+ if (coords_size > 0) {
+ unsigned char* coords_addr = static_cast<unsigned char*>(buffer.address());
+ memcpy(coords_addr, coords, coords_size);
+ coords_shm_id = buffer.shm_id();
+ coords_shm_offset = buffer.offset();
+ }
+
+ DCHECK(num_commands > 0);
+ unsigned char* commands_addr =
+ static_cast<unsigned char*>(buffer.address()) + coords_size;
+ memcpy(commands_addr, commands, num_commands);
+
+ helper_->PathCommandsCHROMIUM(path, num_commands, buffer.shm_id(),
+ buffer.offset() + coords_size, num_coords,
+ coord_type, coords_shm_id, coords_shm_offset);
+ CheckGLError();
+}
+
// Include the auto-generated part of this file. We split this because it means
// we can easily edit the non-auto generated parts right here in this file
// instead of having to edit some template or the code generator.
diff --git a/gpu/command_buffer/client/gles2_implementation.h b/gpu/command_buffer/client/gles2_implementation.h
index c642f9a..3446e76 100644
--- a/gpu/command_buffer/client/gles2_implementation.h
+++ b/gpu/command_buffer/client/gles2_implementation.h
@@ -510,6 +510,7 @@ class GLES2_IMPL_EXPORT GLES2Implementation
void DeleteFramebuffersStub(GLsizei n, const GLuint* framebuffers);
void DeleteRenderbuffersStub(GLsizei n, const GLuint* renderbuffers);
void DeleteTexturesStub(GLsizei n, const GLuint* textures);
+ void DeletePathsCHROMIUMStub(GLuint first_client_id, GLsizei range);
void DeleteProgramStub(GLsizei n, const GLuint* programs);
void DeleteShaderStub(GLsizei n, const GLuint* shaders);
void DeleteVertexArraysOESStub(GLsizei n, const GLuint* arrays);
@@ -593,6 +594,7 @@ class GLES2_IMPL_EXPORT GLES2Implementation
bool SetCapabilityState(GLenum cap, bool enabled);
IdHandlerInterface* GetIdHandler(int id_namespace) const;
+ RangeIdHandlerInterface* GetRangeIdHandler(int id_namespace) const;
// IdAllocators for objects that can't be shared among contexts.
// For now, used only for Queries. TODO(hj.r.chung) Should be added for
// Framebuffer and Vertex array objects.
diff --git a/gpu/command_buffer/client/gles2_implementation_autogen.h b/gpu/command_buffer/client/gles2_implementation_autogen.h
index 5cb7a65..bee4f9c 100644
--- a/gpu/command_buffer/client/gles2_implementation_autogen.h
+++ b/gpu/command_buffer/client/gles2_implementation_autogen.h
@@ -1053,6 +1053,47 @@ void MatrixLoadfCHROMIUM(GLenum matrixMode, const GLfloat* m) override;
void MatrixLoadIdentityCHROMIUM(GLenum matrixMode) override;
+GLuint GenPathsCHROMIUM(GLsizei range) override;
+
+void DeletePathsCHROMIUM(GLuint path, GLsizei range) override;
+
+GLboolean IsPathCHROMIUM(GLuint path) override;
+
+void PathCommandsCHROMIUM(GLuint path,
+ GLsizei numCommands,
+ const GLubyte* commands,
+ GLsizei numCoords,
+ GLenum coordType,
+ const GLvoid* coords) override;
+
+void PathParameterfCHROMIUM(GLuint path, GLenum pname, GLfloat value) override;
+
+void PathParameteriCHROMIUM(GLuint path, GLenum pname, GLint value) override;
+
+void PathStencilFuncCHROMIUM(GLenum func, GLint ref, GLuint mask) override;
+
+void StencilFillPathCHROMIUM(GLuint path,
+ GLenum fillMode,
+ GLuint mask) override;
+
+void StencilStrokePathCHROMIUM(GLuint path,
+ GLint reference,
+ GLuint mask) override;
+
+void CoverFillPathCHROMIUM(GLuint path, GLenum coverMode) override;
+
+void CoverStrokePathCHROMIUM(GLuint path, GLenum coverMode) override;
+
+void StencilThenCoverFillPathCHROMIUM(GLuint path,
+ GLenum fillMode,
+ GLuint mask,
+ GLenum coverMode) override;
+
+void StencilThenCoverStrokePathCHROMIUM(GLuint path,
+ GLint reference,
+ GLuint mask,
+ GLenum coverMode) override;
+
GLenum GetGraphicsResetStatusKHR() override;
void BlendBarrierKHR() override;
diff --git a/gpu/command_buffer/client/gles2_implementation_impl_autogen.h b/gpu/command_buffer/client/gles2_implementation_impl_autogen.h
index 8586fe3..79a7650 100644
--- a/gpu/command_buffer/client/gles2_implementation_impl_autogen.h
+++ b/gpu/command_buffer/client/gles2_implementation_impl_autogen.h
@@ -3462,6 +3462,123 @@ void GLES2Implementation::MatrixLoadIdentityCHROMIUM(GLenum matrixMode) {
CheckGLError();
}
+GLboolean GLES2Implementation::IsPathCHROMIUM(GLuint path) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ TRACE_EVENT0("gpu", "GLES2Implementation::IsPathCHROMIUM");
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glIsPathCHROMIUM(" << path << ")");
+ typedef cmds::IsPathCHROMIUM::Result Result;
+ Result* result = GetResultAs<Result*>();
+ if (!result) {
+ return GL_FALSE;
+ }
+ *result = 0;
+ helper_->IsPathCHROMIUM(path, GetResultShmId(), GetResultShmOffset());
+ WaitForCmd();
+ GLboolean result_value = *result != 0;
+ GPU_CLIENT_LOG("returned " << result_value);
+ CheckGLError();
+ return result_value;
+}
+
+void GLES2Implementation::PathParameterfCHROMIUM(GLuint path,
+ GLenum pname,
+ GLfloat value) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glPathParameterfCHROMIUM(" << path
+ << ", " << GLES2Util::GetStringPathParameter(pname) << ", "
+ << value << ")");
+ helper_->PathParameterfCHROMIUM(path, pname, value);
+ CheckGLError();
+}
+
+void GLES2Implementation::PathParameteriCHROMIUM(GLuint path,
+ GLenum pname,
+ GLint value) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glPathParameteriCHROMIUM(" << path
+ << ", " << GLES2Util::GetStringPathParameter(pname) << ", "
+ << value << ")");
+ helper_->PathParameteriCHROMIUM(path, pname, value);
+ CheckGLError();
+}
+
+void GLES2Implementation::PathStencilFuncCHROMIUM(GLenum func,
+ GLint ref,
+ GLuint mask) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glPathStencilFuncCHROMIUM("
+ << GLES2Util::GetStringCmpFunction(func) << ", " << ref
+ << ", " << mask << ")");
+ helper_->PathStencilFuncCHROMIUM(func, ref, mask);
+ CheckGLError();
+}
+
+void GLES2Implementation::StencilFillPathCHROMIUM(GLuint path,
+ GLenum fillMode,
+ GLuint mask) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glStencilFillPathCHROMIUM(" << path
+ << ", " << GLES2Util::GetStringPathFillMode(fillMode)
+ << ", " << mask << ")");
+ helper_->StencilFillPathCHROMIUM(path, fillMode, mask);
+ CheckGLError();
+}
+
+void GLES2Implementation::StencilStrokePathCHROMIUM(GLuint path,
+ GLint reference,
+ GLuint mask) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glStencilStrokePathCHROMIUM("
+ << path << ", " << reference << ", " << mask << ")");
+ helper_->StencilStrokePathCHROMIUM(path, reference, mask);
+ CheckGLError();
+}
+
+void GLES2Implementation::CoverFillPathCHROMIUM(GLuint path, GLenum coverMode) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCoverFillPathCHROMIUM(" << path
+ << ", " << GLES2Util::GetStringPathCoverMode(coverMode)
+ << ")");
+ helper_->CoverFillPathCHROMIUM(path, coverMode);
+ CheckGLError();
+}
+
+void GLES2Implementation::CoverStrokePathCHROMIUM(GLuint path,
+ GLenum coverMode) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glCoverStrokePathCHROMIUM(" << path
+ << ", " << GLES2Util::GetStringPathCoverMode(coverMode)
+ << ")");
+ helper_->CoverStrokePathCHROMIUM(path, coverMode);
+ CheckGLError();
+}
+
+void GLES2Implementation::StencilThenCoverFillPathCHROMIUM(GLuint path,
+ GLenum fillMode,
+ GLuint mask,
+ GLenum coverMode) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG(
+ "[" << GetLogPrefix() << "] glStencilThenCoverFillPathCHROMIUM(" << path
+ << ", " << GLES2Util::GetStringPathFillMode(fillMode) << ", " << mask
+ << ", " << GLES2Util::GetStringPathCoverMode(coverMode) << ")");
+ helper_->StencilThenCoverFillPathCHROMIUM(path, fillMode, mask, coverMode);
+ CheckGLError();
+}
+
+void GLES2Implementation::StencilThenCoverStrokePathCHROMIUM(GLuint path,
+ GLint reference,
+ GLuint mask,
+ GLenum coverMode) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix()
+ << "] glStencilThenCoverStrokePathCHROMIUM(" << path
+ << ", " << reference << ", " << mask << ", "
+ << GLES2Util::GetStringPathCoverMode(coverMode) << ")");
+ helper_->StencilThenCoverStrokePathCHROMIUM(path, reference, mask, coverMode);
+ CheckGLError();
+}
+
void GLES2Implementation::BlendBarrierKHR() {
GPU_CLIENT_SINGLE_THREAD_CHECK();
GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glBlendBarrierKHR("
diff --git a/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h b/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h
index 7cf70eb..fef96d9 100644
--- a/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h
+++ b/gpu/command_buffer/client/gles2_implementation_unittest_autogen.h
@@ -3119,4 +3119,136 @@ TEST_F(GLES2ImplementationTest, MatrixLoadIdentityCHROMIUM) {
gl_->MatrixLoadIdentityCHROMIUM(GL_PATH_PROJECTION_CHROMIUM);
EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
}
+// TODO(zmo): Implement unit test for GenPathsCHROMIUM
+
+TEST_F(GLES2ImplementationTest, DeletePathsCHROMIUM) {
+ struct Cmds {
+ cmds::DeletePathsCHROMIUM cmd;
+ };
+ Cmds expected;
+ expected.cmd.Init(1, 2);
+
+ gl_->DeletePathsCHROMIUM(1, 2);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
+TEST_F(GLES2ImplementationTest, IsPathCHROMIUM) {
+ struct Cmds {
+ cmds::IsPathCHROMIUM cmd;
+ };
+
+ Cmds expected;
+ ExpectedMemoryInfo result1 =
+ GetExpectedResultMemory(sizeof(cmds::IsPathCHROMIUM::Result));
+ expected.cmd.Init(1, result1.id, result1.offset);
+
+ EXPECT_CALL(*command_buffer(), OnFlush())
+ .WillOnce(SetMemory(result1.ptr, uint32_t(GL_TRUE)))
+ .RetiresOnSaturation();
+
+ GLboolean result = gl_->IsPathCHROMIUM(1);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+ EXPECT_TRUE(result);
+}
+// TODO(zmo): Implement unit test for PathCommandsCHROMIUM
+
+TEST_F(GLES2ImplementationTest, PathParameterfCHROMIUM) {
+ struct Cmds {
+ cmds::PathParameterfCHROMIUM cmd;
+ };
+ Cmds expected;
+ expected.cmd.Init(1, GL_PATH_STROKE_WIDTH_CHROMIUM, 3);
+
+ gl_->PathParameterfCHROMIUM(1, GL_PATH_STROKE_WIDTH_CHROMIUM, 3);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
+TEST_F(GLES2ImplementationTest, PathParameteriCHROMIUM) {
+ struct Cmds {
+ cmds::PathParameteriCHROMIUM cmd;
+ };
+ Cmds expected;
+ expected.cmd.Init(1, GL_PATH_STROKE_WIDTH_CHROMIUM, 3);
+
+ gl_->PathParameteriCHROMIUM(1, GL_PATH_STROKE_WIDTH_CHROMIUM, 3);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
+TEST_F(GLES2ImplementationTest, PathStencilFuncCHROMIUM) {
+ struct Cmds {
+ cmds::PathStencilFuncCHROMIUM cmd;
+ };
+ Cmds expected;
+ expected.cmd.Init(GL_NEVER, 2, 3);
+
+ gl_->PathStencilFuncCHROMIUM(GL_NEVER, 2, 3);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
+TEST_F(GLES2ImplementationTest, StencilFillPathCHROMIUM) {
+ struct Cmds {
+ cmds::StencilFillPathCHROMIUM cmd;
+ };
+ Cmds expected;
+ expected.cmd.Init(1, GL_INVERT, 3);
+
+ gl_->StencilFillPathCHROMIUM(1, GL_INVERT, 3);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
+TEST_F(GLES2ImplementationTest, StencilStrokePathCHROMIUM) {
+ struct Cmds {
+ cmds::StencilStrokePathCHROMIUM cmd;
+ };
+ Cmds expected;
+ expected.cmd.Init(1, 2, 3);
+
+ gl_->StencilStrokePathCHROMIUM(1, 2, 3);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
+TEST_F(GLES2ImplementationTest, CoverFillPathCHROMIUM) {
+ struct Cmds {
+ cmds::CoverFillPathCHROMIUM cmd;
+ };
+ Cmds expected;
+ expected.cmd.Init(1, GL_CONVEX_HULL_CHROMIUM);
+
+ gl_->CoverFillPathCHROMIUM(1, GL_CONVEX_HULL_CHROMIUM);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
+TEST_F(GLES2ImplementationTest, CoverStrokePathCHROMIUM) {
+ struct Cmds {
+ cmds::CoverStrokePathCHROMIUM cmd;
+ };
+ Cmds expected;
+ expected.cmd.Init(1, GL_CONVEX_HULL_CHROMIUM);
+
+ gl_->CoverStrokePathCHROMIUM(1, GL_CONVEX_HULL_CHROMIUM);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
+TEST_F(GLES2ImplementationTest, StencilThenCoverFillPathCHROMIUM) {
+ struct Cmds {
+ cmds::StencilThenCoverFillPathCHROMIUM cmd;
+ };
+ Cmds expected;
+ expected.cmd.Init(1, GL_INVERT, 3, GL_CONVEX_HULL_CHROMIUM);
+
+ gl_->StencilThenCoverFillPathCHROMIUM(1, GL_INVERT, 3,
+ GL_CONVEX_HULL_CHROMIUM);
+ EXPECT_EQ(0, memcmp(&expected, commands_, sizeof(expected)));
+}
+
+TEST_F(GLES2ImplementationTest, StencilThenCoverStrokePathCHROMIUM) {
+ struct Cmds {
+ cmds::StencilThenCoverStrokePathCHROMIUM cmd;
+ };
+ Cmds expected;
+ expected.cmd.Init(1, 2, 3, GL_CONVEX_HULL_CHROMIUM);
+
+ gl_->StencilThenCoverStrokePathCHROMIUM(1, 2, 3, GL_CONVEX_HULL_CHROMIUM);
+ 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 5e61f11..99d0577 100644
--- a/gpu/command_buffer/client/gles2_interface_autogen.h
+++ b/gpu/command_buffer/client/gles2_interface_autogen.h
@@ -781,6 +781,36 @@ virtual void ScheduleOverlayPlaneCHROMIUM(GLint plane_z_order,
virtual void SwapInterval(GLint interval) = 0;
virtual void MatrixLoadfCHROMIUM(GLenum matrixMode, const GLfloat* m) = 0;
virtual void MatrixLoadIdentityCHROMIUM(GLenum matrixMode) = 0;
+virtual GLuint GenPathsCHROMIUM(GLsizei range) = 0;
+virtual void DeletePathsCHROMIUM(GLuint path, GLsizei range) = 0;
+virtual GLboolean IsPathCHROMIUM(GLuint path) = 0;
+virtual void PathCommandsCHROMIUM(GLuint path,
+ GLsizei numCommands,
+ const GLubyte* commands,
+ GLsizei numCoords,
+ GLenum coordType,
+ const GLvoid* coords) = 0;
+virtual void PathParameterfCHROMIUM(GLuint path,
+ GLenum pname,
+ GLfloat value) = 0;
+virtual void PathParameteriCHROMIUM(GLuint path, GLenum pname, GLint value) = 0;
+virtual void PathStencilFuncCHROMIUM(GLenum func, GLint ref, GLuint mask) = 0;
+virtual void StencilFillPathCHROMIUM(GLuint path,
+ GLenum fillMode,
+ GLuint mask) = 0;
+virtual void StencilStrokePathCHROMIUM(GLuint path,
+ GLint reference,
+ GLuint mask) = 0;
+virtual void CoverFillPathCHROMIUM(GLuint path, GLenum coverMode) = 0;
+virtual void CoverStrokePathCHROMIUM(GLuint path, GLenum coverMode) = 0;
+virtual void StencilThenCoverFillPathCHROMIUM(GLuint path,
+ GLenum fillMode,
+ GLuint mask,
+ GLenum coverMode) = 0;
+virtual void StencilThenCoverStrokePathCHROMIUM(GLuint path,
+ GLint reference,
+ GLuint mask,
+ GLenum coverMode) = 0;
virtual GLenum GetGraphicsResetStatusKHR() = 0;
virtual void BlendBarrierKHR() = 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 1f70750..41358fb 100644
--- a/gpu/command_buffer/client/gles2_interface_stub_autogen.h
+++ b/gpu/command_buffer/client/gles2_interface_stub_autogen.h
@@ -759,6 +759,34 @@ void ScheduleOverlayPlaneCHROMIUM(GLint plane_z_order,
void SwapInterval(GLint interval) override;
void MatrixLoadfCHROMIUM(GLenum matrixMode, const GLfloat* m) override;
void MatrixLoadIdentityCHROMIUM(GLenum matrixMode) override;
+GLuint GenPathsCHROMIUM(GLsizei range) override;
+void DeletePathsCHROMIUM(GLuint path, GLsizei range) override;
+GLboolean IsPathCHROMIUM(GLuint path) override;
+void PathCommandsCHROMIUM(GLuint path,
+ GLsizei numCommands,
+ const GLubyte* commands,
+ GLsizei numCoords,
+ GLenum coordType,
+ const GLvoid* coords) override;
+void PathParameterfCHROMIUM(GLuint path, GLenum pname, GLfloat value) override;
+void PathParameteriCHROMIUM(GLuint path, GLenum pname, GLint value) override;
+void PathStencilFuncCHROMIUM(GLenum func, GLint ref, GLuint mask) override;
+void StencilFillPathCHROMIUM(GLuint path,
+ GLenum fillMode,
+ GLuint mask) override;
+void StencilStrokePathCHROMIUM(GLuint path,
+ GLint reference,
+ GLuint mask) override;
+void CoverFillPathCHROMIUM(GLuint path, GLenum coverMode) override;
+void CoverStrokePathCHROMIUM(GLuint path, GLenum coverMode) override;
+void StencilThenCoverFillPathCHROMIUM(GLuint path,
+ GLenum fillMode,
+ GLuint mask,
+ GLenum coverMode) override;
+void StencilThenCoverStrokePathCHROMIUM(GLuint path,
+ GLint reference,
+ GLuint mask,
+ GLenum coverMode) override;
GLenum GetGraphicsResetStatusKHR() override;
void BlendBarrierKHR() 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 cf1baa2..6058760 100644
--- a/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h
+++ b/gpu/command_buffer/client/gles2_interface_stub_impl_autogen.h
@@ -1290,6 +1290,60 @@ void GLES2InterfaceStub::MatrixLoadfCHROMIUM(GLenum /* matrixMode */,
}
void GLES2InterfaceStub::MatrixLoadIdentityCHROMIUM(GLenum /* matrixMode */) {
}
+GLuint GLES2InterfaceStub::GenPathsCHROMIUM(GLsizei /* range */) {
+ return 0;
+}
+void GLES2InterfaceStub::DeletePathsCHROMIUM(GLuint /* path */,
+ GLsizei /* range */) {
+}
+GLboolean GLES2InterfaceStub::IsPathCHROMIUM(GLuint /* path */) {
+ return 0;
+}
+void GLES2InterfaceStub::PathCommandsCHROMIUM(GLuint /* path */,
+ GLsizei /* numCommands */,
+ const GLubyte* /* commands */,
+ GLsizei /* numCoords */,
+ GLenum /* coordType */,
+ const GLvoid* /* coords */) {
+}
+void GLES2InterfaceStub::PathParameterfCHROMIUM(GLuint /* path */,
+ GLenum /* pname */,
+ GLfloat /* value */) {
+}
+void GLES2InterfaceStub::PathParameteriCHROMIUM(GLuint /* path */,
+ GLenum /* pname */,
+ GLint /* value */) {
+}
+void GLES2InterfaceStub::PathStencilFuncCHROMIUM(GLenum /* func */,
+ GLint /* ref */,
+ GLuint /* mask */) {
+}
+void GLES2InterfaceStub::StencilFillPathCHROMIUM(GLuint /* path */,
+ GLenum /* fillMode */,
+ GLuint /* mask */) {
+}
+void GLES2InterfaceStub::StencilStrokePathCHROMIUM(GLuint /* path */,
+ GLint /* reference */,
+ GLuint /* mask */) {
+}
+void GLES2InterfaceStub::CoverFillPathCHROMIUM(GLuint /* path */,
+ GLenum /* coverMode */) {
+}
+void GLES2InterfaceStub::CoverStrokePathCHROMIUM(GLuint /* path */,
+ GLenum /* coverMode */) {
+}
+void GLES2InterfaceStub::StencilThenCoverFillPathCHROMIUM(
+ GLuint /* path */,
+ GLenum /* fillMode */,
+ GLuint /* mask */,
+ GLenum /* coverMode */) {
+}
+void GLES2InterfaceStub::StencilThenCoverStrokePathCHROMIUM(
+ GLuint /* path */,
+ GLint /* reference */,
+ GLuint /* mask */,
+ GLenum /* coverMode */) {
+}
GLenum GLES2InterfaceStub::GetGraphicsResetStatusKHR() {
return 0;
}
diff --git a/gpu/command_buffer/client/gles2_trace_implementation_autogen.h b/gpu/command_buffer/client/gles2_trace_implementation_autogen.h
index 30743ea..ed48158 100644
--- a/gpu/command_buffer/client/gles2_trace_implementation_autogen.h
+++ b/gpu/command_buffer/client/gles2_trace_implementation_autogen.h
@@ -759,6 +759,34 @@ void ScheduleOverlayPlaneCHROMIUM(GLint plane_z_order,
void SwapInterval(GLint interval) override;
void MatrixLoadfCHROMIUM(GLenum matrixMode, const GLfloat* m) override;
void MatrixLoadIdentityCHROMIUM(GLenum matrixMode) override;
+GLuint GenPathsCHROMIUM(GLsizei range) override;
+void DeletePathsCHROMIUM(GLuint path, GLsizei range) override;
+GLboolean IsPathCHROMIUM(GLuint path) override;
+void PathCommandsCHROMIUM(GLuint path,
+ GLsizei numCommands,
+ const GLubyte* commands,
+ GLsizei numCoords,
+ GLenum coordType,
+ const GLvoid* coords) override;
+void PathParameterfCHROMIUM(GLuint path, GLenum pname, GLfloat value) override;
+void PathParameteriCHROMIUM(GLuint path, GLenum pname, GLint value) override;
+void PathStencilFuncCHROMIUM(GLenum func, GLint ref, GLuint mask) override;
+void StencilFillPathCHROMIUM(GLuint path,
+ GLenum fillMode,
+ GLuint mask) override;
+void StencilStrokePathCHROMIUM(GLuint path,
+ GLint reference,
+ GLuint mask) override;
+void CoverFillPathCHROMIUM(GLuint path, GLenum coverMode) override;
+void CoverStrokePathCHROMIUM(GLuint path, GLenum coverMode) override;
+void StencilThenCoverFillPathCHROMIUM(GLuint path,
+ GLenum fillMode,
+ GLuint mask,
+ GLenum coverMode) override;
+void StencilThenCoverStrokePathCHROMIUM(GLuint path,
+ GLint reference,
+ GLuint mask,
+ GLenum coverMode) override;
GLenum GetGraphicsResetStatusKHR() override;
void BlendBarrierKHR() 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 13c215f..a0b41a2 100644
--- a/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h
+++ b/gpu/command_buffer/client/gles2_trace_implementation_impl_autogen.h
@@ -2206,6 +2206,99 @@ void GLES2TraceImplementation::MatrixLoadIdentityCHROMIUM(GLenum matrixMode) {
gl_->MatrixLoadIdentityCHROMIUM(matrixMode);
}
+GLuint GLES2TraceImplementation::GenPathsCHROMIUM(GLsizei range) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::GenPathsCHROMIUM");
+ return gl_->GenPathsCHROMIUM(range);
+}
+
+void GLES2TraceImplementation::DeletePathsCHROMIUM(GLuint path, GLsizei range) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::DeletePathsCHROMIUM");
+ gl_->DeletePathsCHROMIUM(path, range);
+}
+
+GLboolean GLES2TraceImplementation::IsPathCHROMIUM(GLuint path) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::IsPathCHROMIUM");
+ return gl_->IsPathCHROMIUM(path);
+}
+
+void GLES2TraceImplementation::PathCommandsCHROMIUM(GLuint path,
+ GLsizei numCommands,
+ const GLubyte* commands,
+ GLsizei numCoords,
+ GLenum coordType,
+ const GLvoid* coords) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::PathCommandsCHROMIUM");
+ gl_->PathCommandsCHROMIUM(path, numCommands, commands, numCoords, coordType,
+ coords);
+}
+
+void GLES2TraceImplementation::PathParameterfCHROMIUM(GLuint path,
+ GLenum pname,
+ GLfloat value) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::PathParameterfCHROMIUM");
+ gl_->PathParameterfCHROMIUM(path, pname, value);
+}
+
+void GLES2TraceImplementation::PathParameteriCHROMIUM(GLuint path,
+ GLenum pname,
+ GLint value) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::PathParameteriCHROMIUM");
+ gl_->PathParameteriCHROMIUM(path, pname, value);
+}
+
+void GLES2TraceImplementation::PathStencilFuncCHROMIUM(GLenum func,
+ GLint ref,
+ GLuint mask) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::PathStencilFuncCHROMIUM");
+ gl_->PathStencilFuncCHROMIUM(func, ref, mask);
+}
+
+void GLES2TraceImplementation::StencilFillPathCHROMIUM(GLuint path,
+ GLenum fillMode,
+ GLuint mask) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::StencilFillPathCHROMIUM");
+ gl_->StencilFillPathCHROMIUM(path, fillMode, mask);
+}
+
+void GLES2TraceImplementation::StencilStrokePathCHROMIUM(GLuint path,
+ GLint reference,
+ GLuint mask) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::StencilStrokePathCHROMIUM");
+ gl_->StencilStrokePathCHROMIUM(path, reference, mask);
+}
+
+void GLES2TraceImplementation::CoverFillPathCHROMIUM(GLuint path,
+ GLenum coverMode) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::CoverFillPathCHROMIUM");
+ gl_->CoverFillPathCHROMIUM(path, coverMode);
+}
+
+void GLES2TraceImplementation::CoverStrokePathCHROMIUM(GLuint path,
+ GLenum coverMode) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::CoverStrokePathCHROMIUM");
+ gl_->CoverStrokePathCHROMIUM(path, coverMode);
+}
+
+void GLES2TraceImplementation::StencilThenCoverFillPathCHROMIUM(
+ GLuint path,
+ GLenum fillMode,
+ GLuint mask,
+ GLenum coverMode) {
+ TRACE_EVENT_BINARY_EFFICIENT0("gpu",
+ "GLES2Trace::StencilThenCoverFillPathCHROMIUM");
+ gl_->StencilThenCoverFillPathCHROMIUM(path, fillMode, mask, coverMode);
+}
+
+void GLES2TraceImplementation::StencilThenCoverStrokePathCHROMIUM(
+ GLuint path,
+ GLint reference,
+ GLuint mask,
+ GLenum coverMode) {
+ TRACE_EVENT_BINARY_EFFICIENT0(
+ "gpu", "GLES2Trace::StencilThenCoverStrokePathCHROMIUM");
+ gl_->StencilThenCoverStrokePathCHROMIUM(path, reference, mask, coverMode);
+}
+
GLenum GLES2TraceImplementation::GetGraphicsResetStatusKHR() {
TRACE_EVENT_BINARY_EFFICIENT0("gpu", "GLES2Trace::GetGraphicsResetStatusKHR");
return gl_->GetGraphicsResetStatusKHR();
diff --git a/gpu/command_buffer/client/share_group.cc b/gpu/command_buffer/client/share_group.cc
index 32e853b..e6ed66d 100644
--- a/gpu/command_buffer/client/share_group.cc
+++ b/gpu/command_buffer/client/share_group.cc
@@ -318,6 +318,35 @@ class NonReusedIdHandler : public IdHandlerInterface {
GLuint last_id_;
};
+class RangeIdHandler : public RangeIdHandlerInterface {
+ public:
+ RangeIdHandler() {}
+
+ void MakeIdRange(GLES2Implementation* /*gl_impl*/,
+ GLsizei n,
+ GLuint* first_id) override {
+ base::AutoLock auto_lock(lock_);
+ *first_id = id_allocator_.AllocateIDRange(n);
+ }
+
+ void FreeIdRange(GLES2Implementation* gl_impl,
+ const GLuint first_id,
+ GLsizei range,
+ DeleteRangeFn delete_fn) override {
+ base::AutoLock auto_lock(lock_);
+ DCHECK(range > 0);
+ id_allocator_.FreeIDRange(first_id, range);
+ (gl_impl->*delete_fn)(first_id, range);
+ gl_impl->helper()->CommandBufferHelper::OrderingBarrier();
+ }
+
+ void FreeContext(GLES2Implementation* gl_impl) override {}
+
+ private:
+ base::Lock lock_;
+ IdAllocator id_allocator_;
+};
+
ShareGroup::ShareGroup(bool bind_generates_resource)
: bind_generates_resource_(bind_generates_resource) {
if (bind_generates_resource) {
@@ -338,6 +367,9 @@ ShareGroup::ShareGroup(bool bind_generates_resource)
}
}
program_info_manager_.reset(new ProgramInfoManager);
+ for (auto& range_id_handler : range_id_handlers_) {
+ range_id_handler.reset(new RangeIdHandler());
+ }
}
void ShareGroup::set_program_info_manager(ProgramInfoManager* manager) {
diff --git a/gpu/command_buffer/client/share_group.h b/gpu/command_buffer/client/share_group.h
index c150004..2a6acc5 100644
--- a/gpu/command_buffer/client/share_group.h
+++ b/gpu/command_buffer/client/share_group.h
@@ -19,6 +19,8 @@ class GLES2ImplementationTest;
class ProgramInfoManager;
typedef void (GLES2Implementation::*DeleteFn)(GLsizei n, const GLuint* ids);
+typedef void (GLES2Implementation::*DeleteRangeFn)(const GLuint first_id,
+ GLsizei range);
typedef void (GLES2Implementation::*BindFn)(GLenum target, GLuint id);
typedef void (GLES2Implementation::*BindIndexedFn)( \
GLenum target, GLuint index, GLuint id);
@@ -86,6 +88,27 @@ class IdHandlerInterface {
virtual void FreeContext(GLES2Implementation* gl_impl) = 0;
};
+class RangeIdHandlerInterface {
+ public:
+ RangeIdHandlerInterface() {}
+ virtual ~RangeIdHandlerInterface() {}
+
+ // Makes a continuous range of ids. Stores the first allocated id to
+ // |first_id| or 0 if allocation failed.
+ virtual void MakeIdRange(GLES2Implementation* gl_impl,
+ GLsizei n,
+ GLuint* first_id) = 0;
+
+ // Frees a continuous |range| of ids beginning at |first_id|.
+ virtual void FreeIdRange(GLES2Implementation* gl_impl,
+ const GLuint first_id,
+ GLsizei range,
+ DeleteRangeFn delete_fn) = 0;
+
+ // Called when a context in the share group is destructed.
+ virtual void FreeContext(GLES2Implementation* gl_impl) = 0;
+};
+
// ShareGroup manages shared resources for contexts that are sharing resources.
class GLES2_IMPL_EXPORT ShareGroup
: public gpu::RefCountedThreadSafe<ShareGroup> {
@@ -100,6 +123,10 @@ class GLES2_IMPL_EXPORT ShareGroup
return id_handlers_[namespace_id].get();
}
+ RangeIdHandlerInterface* GetRangeIdHandler(int range_namespace_id) const {
+ return range_id_handlers_[range_namespace_id].get();
+ }
+
ProgramInfoManager* program_info_manager() {
return program_info_manager_.get();
}
@@ -108,6 +135,9 @@ class GLES2_IMPL_EXPORT ShareGroup
for (int i = 0; i < id_namespaces::kNumIdNamespaces; ++i) {
id_handlers_[i]->FreeContext(gl_impl);
}
+ for (auto& range_id_handler : range_id_handlers_) {
+ range_id_handler->FreeContext(gl_impl);
+ }
}
private:
@@ -119,6 +149,8 @@ class GLES2_IMPL_EXPORT ShareGroup
void set_program_info_manager(ProgramInfoManager* manager);
scoped_ptr<IdHandlerInterface> id_handlers_[id_namespaces::kNumIdNamespaces];
+ scoped_ptr<RangeIdHandlerInterface>
+ range_id_handlers_[id_namespaces::kNumRangeIdNamespaces];
scoped_ptr<ProgramInfoManager> program_info_manager_;
bool bind_generates_resource_;