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

Unified Diff: gpu/skia_bindings/gl_bindings_skia_cmd_buffer.cc

Issue 169403005: command_buffer: Implement path rendering functions for CHROMIUM_path_rendering (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@nv-pr-02-texgen
Patch Set: rebase and cleanup ids Created 6 years, 2 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/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;
}
« gpu/GLES2/gl2chromium.h ('K') | « gpu/gpu.gyp ('k') | ppapi/c/dev/ppb_opengles2ext_dev.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698