|
Added the bulk of the algorithm for GPU accelerated 2D vector curve
rendering from "Rendering Vector Art on the GPU" by Loop and Blinn,
GPU Gems 3, Chapter 25.
The main entry point to the algorithm is the PathProcessor, which
takes in a Skia path and converts it to two triangle meshes: one for
the exterior region of the shape containing the curve segments, and
one for the interior region of the shape which is filled with constant
(1.0) alpha.
The o3d.ProcessedPath class is the internal object which exposes the
needed entry points to JavaScript. However, o3djs.gpu2d is the
user-level entry point to the algorithm. This exposes a Path primitive
to which line, quadratic curve and cubic curve segments can be added,
and simple fills (currently only a solid color).
An SVG loader in samples/gpu2d/svgloader.js illustrates how content
might be imported at run time. Several samples and regression tests
demonstrate the current state of the implementation. More work is
planned.
Some small generalizations to the O3D code were necessary to support
two-dimensional vertices.
Note that I plan to submit gpu2d.js and/or svgloader.js for JavaScript
readability. I have run both through the JS compiler and have fixed as
many of the doc generation errors as possible in svgloader.js without
pulling this file into the o3djs namespace.
Tested in O3D on Windows and Mac OS X.
BUG=none
TEST=various SVG based tests
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=40079
Total comments: 136
Total comments: 28
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+5909 lines, -23 lines) |
Patch |
 |
M |
DEPS
|
View
|
1
2
3
|
2 chunks |
+4 lines, -1 line |
0 comments
|
Download
|
 |
M |
core/core.gyp
|
View
|
1
2
3
|
3 chunks |
+7 lines, -0 lines |
0 comments
|
Download
|
 |
M |
core/cross/class_manager.cc
|
View
|
1
2
3
|
2 chunks |
+2 lines, -0 lines |
0 comments
|
Download
|
 |
M |
core/cross/gpu2d/cubic_math_utils.h
|
View
|
1
2
3
|
1 chunk |
+11 lines, -0 lines |
0 comments
|
Download
|
 |
M |
core/cross/gpu2d/cubic_math_utils.cc
|
View
|
1
2
3
|
2 chunks |
+91 lines, -0 lines |
0 comments
|
Download
|
 |
A |
core/cross/gpu2d/path_cache.h
|
View
|
1
|
1 chunk |
+120 lines, -0 lines |
0 comments
|
Download
|
 |
A |
core/cross/gpu2d/path_cache.cc
|
View
|
1
|
1 chunk |
+105 lines, -0 lines |
0 comments
|
Download
|
 |
A |
core/cross/gpu2d/path_processor.h
|
View
|
1
|
1 chunk |
+126 lines, -0 lines |
0 comments
|
Download
|
 |
A |
core/cross/gpu2d/path_processor.cc
|
View
|
1
2
|
1 chunk |
+1251 lines, -0 lines |
0 comments
|
Download
|
 |
M |
core/cross/primitive.cc
|
View
|
1
2
3
|
5 chunks |
+65 lines, -22 lines |
0 comments
|
Download
|
 |
A |
core/cross/processed_path.h
|
View
|
1
2
|
1 chunk |
+115 lines, -0 lines |
0 comments
|
Download
|
 |
A |
core/cross/processed_path.cc
|
View
|
1
2
3
|
1 chunk |
+159 lines, -0 lines |
0 comments
|
Download
|
 |
A |
plugin/idl/processed_path.idl
|
View
|
1
|
1 chunk |
+119 lines, -0 lines |
0 comments
|
Download
|
 |
M |
plugin/idl_list.manifest
|
View
|
1
2
3
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
A |
samples/gpu2d/Google_Logo.svg
|
View
|
|
1 chunk |
+134 lines, -0 lines |
0 comments
|
Download
|
 |
A |
samples/gpu2d/a.svg
|
View
|
|
1 chunk |
+72 lines, -0 lines |
0 comments
|
Download
|
 |
A |
samples/gpu2d/basic.html
|
View
|
1
2
3
|
1 chunk |
+229 lines, -0 lines |
0 comments
|
Download
|
 |
A |
samples/gpu2d/crescent.svg
|
View
|
|
1 chunk |
+19 lines, -0 lines |
0 comments
|
Download
|
 |
A |
samples/gpu2d/javalogo.svg
|
View
|
|
1 chunk |
+58 lines, -0 lines |
0 comments
|
Download
|
 |
A |
samples/gpu2d/regression-tests/curve-subdivision-bug-1.html
|
View
|
|
1 chunk |
+51 lines, -0 lines |
0 comments
|
Download
|
 |
A |
samples/gpu2d/regression-tests/curve-subdivision-bug-1.svg
|
View
|
|
1 chunk |
+17 lines, -0 lines |
0 comments
|
Download
|
 |
A |
samples/gpu2d/regression-tests/curve-subdivision-bug-2.html
|
View
|
|
1 chunk |
+51 lines, -0 lines |
0 comments
|
Download
|
 |
A |
samples/gpu2d/regression-tests/curve-subdivision-bug-2.svg
|
View
|
|
1 chunk |
+17 lines, -0 lines |
0 comments
|
Download
|
 |
A |
samples/gpu2d/regression-tests/curve-subdivision-bug-3.html
|
View
|
|
1 chunk |
+51 lines, -0 lines |
0 comments
|
Download
|
 |
A |
samples/gpu2d/regression-tests/curve-subdivision-bug-3.svg
|
View
|
|
1 chunk |
+17 lines, -0 lines |
0 comments
|
Download
|
 |
A |
samples/gpu2d/regression-tests/orientation-bug-1.html
|
View
|
|
1 chunk |
+51 lines, -0 lines |
0 comments
|
Download
|
 |
A |
samples/gpu2d/regression-tests/orientation-bug-1.svg
|
View
|
|
1 chunk |
+72 lines, -0 lines |
0 comments
|
Download
|
 |
A |
samples/gpu2d/svg_a.html
|
View
|
|
1 chunk |
+51 lines, -0 lines |
0 comments
|
Download
|
 |
A |
samples/gpu2d/svg_crescent.html
|
View
|
|
1 chunk |
+51 lines, -0 lines |
0 comments
|
Download
|
 |
A |
samples/gpu2d/svg_google_logo.html
|
View
|
|
1 chunk |
+51 lines, -0 lines |
0 comments
|
Download
|
 |
A |
samples/gpu2d/svg_java_logo.html
|
View
|
|
1 chunk |
+51 lines, -0 lines |
0 comments
|
Download
|
 |
A |
samples/gpu2d/svg_thin_crescent.html
|
View
|
|
1 chunk |
+51 lines, -0 lines |
0 comments
|
Download
|
 |
A |
samples/gpu2d/svgloader.js
|
View
|
1
2
3
|
1 chunk |
+974 lines, -0 lines |
0 comments
|
Download
|
 |
A |
samples/gpu2d/svgsample.js
|
View
|
1
2
3
4
5
|
1 chunk |
+226 lines, -0 lines |
0 comments
|
Download
|
 |
A |
samples/gpu2d/thincrescent.svg
|
View
|
|
1 chunk |
+22 lines, -0 lines |
0 comments
|
Download
|
 |
A |
samples/o3djs/gpu2d.js
|
View
|
1
2
3
4
|
1 chunk |
+680 lines, -0 lines |
0 comments
|
Download
|
 |
M |
samples/o3djs/js_list.manifest
|
View
|
1
2
3
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
 |
A |
samples/third_party/xmljs/COPYING
|
View
|
|
1 chunk |
+491 lines, -0 lines |
0 comments
|
Download
|
 |
A |
samples/third_party/xmljs/tinyxmlsax.js
|
View
|
|
1 chunk |
+245 lines, -0 lines |
0 comments
|
Download
|
Total messages: 10 (0 generated)
|