summaryrefslogtreecommitdiffstats
path: root/gpu/GLES2
diff options
context:
space:
mode:
authorkkinnunen <kkinnunen@nvidia.com>2014-08-26 03:19:57 -0700
committerCommit bot <commit-bot@chromium.org>2014-08-26 10:21:08 +0000
commit337d59638d630d0892b444ca2ab0a2989921d00e (patch)
tree1c1013028e5d34ae32f73b8515239a753f3b979f /gpu/GLES2
parentfe6080fcd10b713bb913553ba8186b36d3b4785b (diff)
downloadchromium_src-337d59638d630d0892b444ca2ab0a2989921d00e.zip
chromium_src-337d59638d630d0892b444ca2ab0a2989921d00e.tar.gz
chromium_src-337d59638d630d0892b444ca2ab0a2989921d00e.tar.bz2
Add initial support for NV_path_rendering extension to gpu command buffer
Add initial support for NV_path_rendering extension to gpu command buffer. This is needed in order to support NV_path_rendering implementation in Skia. Implement this by creating a new GL ES pseudo-extension called CHROMIUM_path_rendering. The CHROMIUM_path_rendering extension will be exposed to clients only if the context is not a webgl context, NV_path_rendering extension is present. Also, EXT_direct_state_access extension must be present for Open GL. Add matrix functions needed to support the feature: void glMatrixLoadfEXT(GLenum matrixMode, const GLfloat* m) void glMatrixLoadIdentityEXT(GLenum matrixMode) NV_path_rendering needs these functions to implement transformations for the path drawing. Changes the build_gles2_cmd_buffer.py to be able to generate context state variables that are arrays. The state variable is defined to be an an array when its default value is an array. Changes the build_gles2_cmd_buffer.py to round the float GL state variables with round() when querying them with GetInteger. The values GL_*_CHROMIUM tokens added match the values of corresponding GL_*_NV tokens from the NV_path_rendering extensions. This is why the values are passed after validation to the receiving GL function, without any mapping. BUG=344330 Review URL: https://codereview.chromium.org/169603002 Cr-Commit-Position: refs/heads/master@{#291878}
Diffstat (limited to 'gpu/GLES2')
-rw-r--r--gpu/GLES2/extensions/CHROMIUM/CHROMIUM_path_rendering.txt65
-rw-r--r--gpu/GLES2/gl2chromium.h4
-rw-r--r--gpu/GLES2/gl2chromium_autogen.h2
-rw-r--r--gpu/GLES2/gl2extchromium.h16
4 files changed, 87 insertions, 0 deletions
diff --git a/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_path_rendering.txt b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_path_rendering.txt
new file mode 100644
index 0000000..d2e8c93
--- /dev/null
+++ b/gpu/GLES2/extensions/CHROMIUM/CHROMIUM_path_rendering.txt
@@ -0,0 +1,65 @@
+Name
+
+ CHROMIUM_path_rendering
+
+Name Strings
+
+ GL_CHROMIUM_path_rendering
+
+Version
+
+ Last Modifed Date: August 14, 2014
+
+Dependencies
+
+ OpenGL ES 3.0 is required.
+
+Overview
+
+ This extensions implements path rendering using
+ OpenGL API.
+
+New Tokens
+
+ Accepted by the <matrixMode> parameter of MatrixLoadfCHROMIUM and
+ MatrixLoadIdentityCHROMIUM:
+ PATH_MODELVIEW_CHROMIUM 0x1700
+ PATH_PROJECTION_CHROMIUM 0x1701
+
+ Accepted by the <pname> parameter of GetIntegerv,
+ GetFloatv:
+ PATH_MODELVIEW_MATRIX_CHROMIUM 0x0BA6
+ PATH_PROJECTION_MATRIX_CHROMIUM 0x0BA7
+
+
+New Procedures and Functions
+
+ void MatrixLoadfCHROMIUM(enum matrixMode, float* matrix)
+
+ Takes a pointer to a 4x4 matrix stored in column-major order as 16
+ consecutive floating-point values. The matrixMode specifies which
+ matrix, PATH_MODELVIEW_CHROMIUM or PATH_PROJECTION_CHROMIUM is used.
+
+ The funcition specifies either modelview or projection matrix
+ to be used with path rendering API calls.
+
+ void MatrixLoadIdentityCHROMIUM(enum matrixMode)
+
+ Effectively calls MatrixLoadf with the identity matrix.
+
+Errors
+
+ None.
+
+New State
+
+ Get Value Type Get Command Initial Description
+ ----------------------------- ----- ------------ -------- -------------------
+ PATH_MODELVIEW_MATRIX_CHROMIUM 16xR GetFloatv all 0's Current modelview
+ matrix for path rendering
+ PATH_PROJECTION_MATRIX_CHROMIUM 16xR GetFloatv all 0's Current projection
+ matrix for path rendering
+
+Revision History
+
+ 14/8/2014 Documented the extension
diff --git a/gpu/GLES2/gl2chromium.h b/gpu/GLES2/gl2chromium.h
index 42889dd..0dc648d 100644
--- a/gpu/GLES2/gl2chromium.h
+++ b/gpu/GLES2/gl2chromium.h
@@ -10,6 +10,10 @@
#include <GLES2/gl2platform.h>
#define GL_CONTEXT_LOST 0x300E
+#define GL_PATH_MODELVIEW_CHROMIUM 0x1700
+#define GL_PATH_PROJECTION_CHROMIUM 0x1701
+#define GL_PATH_MODELVIEW_MATRIX_CHROMIUM 0x0BA6
+#define GL_PATH_PROJECTION_MATRIX_CHROMIUM 0x0BA7
#if defined(GLES2_USE_MOJO)
#define GLES2_GET_FUN(name) MojoGLES2gl ## name
diff --git a/gpu/GLES2/gl2chromium_autogen.h b/gpu/GLES2/gl2chromium_autogen.h
index 7f3bbee..e71c0f7 100644
--- a/gpu/GLES2/gl2chromium_autogen.h
+++ b/gpu/GLES2/gl2chromium_autogen.h
@@ -239,5 +239,7 @@
#define glDiscardBackbufferCHROMIUM GLES2_GET_FUN(DiscardBackbufferCHROMIUM)
#define glScheduleOverlayPlaneCHROMIUM \
GLES2_GET_FUN(ScheduleOverlayPlaneCHROMIUM)
+#define glMatrixLoadfCHROMIUM GLES2_GET_FUN(MatrixLoadfCHROMIUM)
+#define glMatrixLoadIdentityCHROMIUM GLES2_GET_FUN(MatrixLoadIdentityCHROMIUM)
#endif // GPU_GLES2_GL2CHROMIUM_AUTOGEN_H_
diff --git a/gpu/GLES2/gl2extchromium.h b/gpu/GLES2/gl2extchromium.h
index 0671187..b5ab0cb 100644
--- a/gpu/GLES2/gl2extchromium.h
+++ b/gpu/GLES2/gl2extchromium.h
@@ -717,6 +717,22 @@ typedef void(GL_APIENTRYP PFNGLSCHEDULEOVERLAYPLANECHROMIUMPROC)(
#endif
#endif /* GL_CHROMIUM_sync_query */
+#ifndef GL_CHROMIUM_path_rendering
+#define GL_CHROMIUM_path_rendering 1
+
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY
+ glMatrixLoadfCHROMIUM(GLenum mode, const GLfloat* m);
+GL_APICALL void GL_APIENTRY glMatrixLoadIdentityCHROMIUM(GLenum mode);
+#endif
+
+typedef void(GL_APIENTRYP PFNGLMATRIXLOADFCHROMIUMPROC)(GLenum matrixMode,
+ const GLfloat* m);
+typedef void(GL_APIENTRYP PFNGLMATRIXLOADIDENTITYCHROMIUMPROC)(
+ GLenum matrixMode);
+
+#endif /* GL_CHROMIUM_path_rendering */
+
#ifdef __cplusplus
}
#endif