| Index: gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc
|
| diff --git a/gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc b/gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc
|
| index 0cb575876b4e53dae1d2eb92e3ead751c599a548..9166b3386fede646d982fd917a7f79c7d41df6e0 100644
|
| --- a/gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc
|
| +++ b/gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc
|
| @@ -12,6 +12,51 @@
|
| #include "third_party/khronos/GLES2/gl2ext.h"
|
| #include "third_party/skia/include/gpu/gl/GrGLInterface.h"
|
|
|
| +namespace {
|
| +// Conversion functions from NV_path_rendering to CHROMIUM_path_rendering.
|
| +// Coord type is not part of CHROMIUM_path_rendering, so DCHECK it to be
|
| +// GL_FLOAT. Cover mode is not part of the extension either, but it's only
|
| +// a perf flag, not a correctness flag. It can not be DCHECKed, as
|
| +// GL_BOUNDING_BOX_NV is not a token in Chromium GL (in which this code is
|
| +// compiled).
|
| +GrGLvoid callPathCommandsCHROMIUM(GrGLuint path,
|
| + GrGLsizei num_commands,
|
| + const GrGLubyte* commands,
|
| + GrGLsizei num_coords,
|
| + GrGLenum coords_type,
|
| + const void* coords) {
|
| + DCHECK(coords_type == GL_FLOAT);
|
| + glPathCommandsCHROMIUM(path,
|
| + num_commands,
|
| + commands,
|
| + num_coords,
|
| + static_cast<const GLfloat*>(coords));
|
| +}
|
| +
|
| +GrGLvoid callCoverFillPathCHROMIUM(GrGLuint path, GrGLenum /*cover_mode*/) {
|
| + glCoverFillPathCHROMIUM(path);
|
| +}
|
| +
|
| +GrGLvoid callCoverStrokePathCHROMIUM(GrGLuint path, GrGLenum /*cover_mode*/) {
|
| + glCoverStrokePathCHROMIUM(path);
|
| +}
|
| +
|
| +GrGLvoid callStencilThenCoverFillPathCHROMIUM(GrGLuint path,
|
| + GrGLenum fill_mode,
|
| + GrGLuint mask,
|
| + GrGLenum /*cover_mode*/) {
|
| + glStencilThenCoverFillPathCHROMIUM(path, fill_mode, mask);
|
| +}
|
| +
|
| +GrGLvoid callStencilThenCoverStrokePathCHROMIUM(GrGLuint path,
|
| + GrGLint reference,
|
| + GrGLuint mask,
|
| + GrGLenum /*cover_mode*/) {
|
| + glStencilThenCoverStrokePathCHROMIUM(path, reference, mask);
|
| +}
|
| +
|
| +} // anonymous namespace
|
| +
|
| namespace skia_bindings {
|
|
|
| GrGLInterface* CreateCommandBufferSkiaGLBinding() {
|
| @@ -141,8 +186,26 @@ GrGLInterface* CreateCommandBufferSkiaGLBinding() {
|
| functions->fBindUniformLocation = glBindUniformLocationCHROMIUM;
|
| functions->fBlitFramebuffer = glBlitFramebufferCHROMIUM;
|
| functions->fGenerateMipmap = glGenerateMipmap;
|
| - functions->fMatrixLoadf = glMatrixLoadfCHROMIUM;
|
| - functions->fMatrixLoadIdentity = glMatrixLoadIdentityCHROMIUM;
|
| + if (false) {
|
| + // These are disabled until the full extension is implemented.
|
| + // Otherwise the interface fails validation and the context can not
|
| + // be created.
|
| + functions->fMatrixLoadf = glMatrixLoadfCHROMIUM;
|
| + functions->fMatrixLoadIdentity = glMatrixLoadIdentityCHROMIUM;
|
| + functions->fPathCommands = callPathCommandsCHROMIUM;
|
| + functions->fPathParameteri = glPathParameteriCHROMIUM;
|
| + functions->fPathParameterf = glPathParameterfCHROMIUM;
|
| + functions->fGenPaths = glGenPathsCHROMIUM;
|
| + functions->fDeletePaths = glDeletePathsCHROMIUM;
|
| + functions->fPathStencilFunc = glPathStencilFuncCHROMIUM;
|
| + functions->fStencilFillPath = glStencilFillPathCHROMIUM;
|
| + functions->fStencilStrokePath = glStencilStrokePathCHROMIUM;
|
| + functions->fCoverFillPath = callCoverFillPathCHROMIUM;
|
| + functions->fCoverStrokePath = callCoverStrokePathCHROMIUM;
|
| + functions->fStencilThenCoverFillPath = callStencilThenCoverFillPathCHROMIUM;
|
| + functions->fStencilThenCoverStrokePath =
|
| + callStencilThenCoverStrokePathCHROMIUM;
|
| + }
|
|
|
| return interface;
|
| }
|
|
|