summaryrefslogtreecommitdiffstats
path: root/o3d/core/cross/gpu2d
Commit message (Collapse)AuthorAgeFilesLines
* Incorporating change missed in previous CLkbr@chromium.org2010-02-271-2/+2
| | | | | | | | (http://codereview.chromium.org/652016). Review URL: http://codereview.chromium.org/661232 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40191 0039d316-1c4b-4281-b951-d872f2087c98
* Fixed uninitialized variables breaking Linux build after checkin ofkbr@google.com2010-02-261-3/+3
| | | | | | | | | | | | http://codereview.chromium.org/652016 . BUG=none TEST=built and tested on Linux TBR=gman Review URL: http://codereview.chromium.org/661143 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40084 0039d316-1c4b-4281-b951-d872f2087c98
* Added the bulk of the algorithm for GPU accelerated 2D vector curvekbr@chromium.org2010-02-266-0/+1704
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Review URL: http://codereview.chromium.org/652016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40079 0039d316-1c4b-4281-b951-d872f2087c98
* Requesting C++ readability review for these classes and unit tests.kbr@chromium.org2010-02-196-107/+102
| | | | | | | | | | | | | The arena allocator is designed for optimized allocation and deallocation of small temporary objects, and is used by the augmentable red-black tree. In a subsequent checkin, the red-black tree will be augmented into an interval tree, which is a key data structure for efficient implementation of one of the algorithms in the forthcoming code in this directory. Review URL: http://codereview.chromium.org/596093 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39414 0039d316-1c4b-4281-b951-d872f2087c98
* Added a specialized triangulator which creates triangles filling thekbr@chromium.org2010-02-195-0/+804
| | | | | | | | | | | | | | convex hull of the four control points of a cubic curve segment. It also computes a path along the filled side of the curve segment, which will be used to fill the interior region of closed shapes with a general tessellation algorithm. BUG=none TEST=LocalTriangulatorTest Review URL: http://codereview.chromium.org/646048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39413 0039d316-1c4b-4281-b951-d872f2087c98
* Added computation of three-dimensional texture coordinates for thekbr@chromium.org2010-02-182-0/+287
| | | | | | | | | | | | | | | | control points of cubic curves. It's difficult if not impossible to write a unit test for this part of the algorithm, since the texture coordinates aren't precisely defined for any particular inputs. The forthcoming system tests will exercise these code paths. BUG=none TEST=none Review URL: http://codereview.chromium.org/647041 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39386 0039d316-1c4b-4281-b951-d872f2087c98
* Added classifier which determines the type of a cubic curve input.kbr@chromium.org2010-02-184-0/+415
| | | | | | | | | | | | Its output will be used by the forthcoming texture coordinate generator. BUG=none TEST=CubicClassifierTest Review URL: http://codereview.chromium.org/626015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39373 0039d316-1c4b-4281-b951-d872f2087c98
* Added interval tree data structure and unit tests. This is built onkbr@chromium.org2010-02-172-0/+496
| | | | | | | | | the red/black tree and is a key data structure in one of the forthcoming algorithms in this code. Review URL: http://codereview.chromium.org/594048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39284 0039d316-1c4b-4281-b951-d872f2087c98
* Fixed broken Linux build by changing Counter helper class used bykbr@google.com2010-02-121-21/+21
| | | | | | | | | | NumElements() from a local class to a nested class as Gregg suggested in http://codereview.chromium.org/574024 . Changed this class to use DISALLOW_COPY_AND_ASSIGN. Review URL: http://codereview.chromium.org/606025 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38923 0039d316-1c4b-4281-b951-d872f2087c98
* Added an arena allocator and an augmentable red-black tree whichkbr@chromium.org2010-02-126-0/+1443
allocates its temporary objects from it. In a subsequent checkin, the red-black tree will be augmented into an interval tree, which is a key data structure for efficient implementation of one of the algorithms in the forthcoming code in this directory. I plan to submit this for C++ readability following code review. Review URL: http://codereview.chromium.org/574024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38908 0039d316-1c4b-4281-b951-d872f2087c98