summaryrefslogtreecommitdiffstats
path: root/o3d/samples/gpu2d/Google_Logo.svg
diff options
context:
space:
mode:
authorkbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-26 00:26:00 +0000
committerkbr@chromium.org <kbr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-26 00:26:00 +0000
commit00d721c144d35882dfaf24b3869e95a8d6404ee5 (patch)
tree07243b1cb15a7fb0eddf54fce686c96cda594640 /o3d/samples/gpu2d/Google_Logo.svg
parent0a46d19ce396112b8a42005d1369de30df3bc872 (diff)
downloadchromium_src-00d721c144d35882dfaf24b3869e95a8d6404ee5.zip
chromium_src-00d721c144d35882dfaf24b3869e95a8d6404ee5.tar.gz
chromium_src-00d721c144d35882dfaf24b3869e95a8d6404ee5.tar.bz2
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 Review URL: http://codereview.chromium.org/652016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40079 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'o3d/samples/gpu2d/Google_Logo.svg')
-rw-r--r--o3d/samples/gpu2d/Google_Logo.svg134
1 files changed, 134 insertions, 0 deletions
diff --git a/o3d/samples/gpu2d/Google_Logo.svg b/o3d/samples/gpu2d/Google_Logo.svg
new file mode 100644
index 0000000..e5f0332
--- /dev/null
+++ b/o3d/samples/gpu2d/Google_Logo.svg
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 12.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 51448) -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" [
+ <!ENTITY ns_svg "http://www.w3.org/2000/svg">
+ <!ENTITY ns_xlink "http://www.w3.org/1999/xlink">
+]>
+<svg version="1.1" xmlns="&ns_svg;" xmlns:xlink="&ns_xlink;" width="720.002" height="238.598" viewBox="0 0 720.002 238.598"
+ overflow="visible" enable-background="new 0 0 720.002 238.598" xml:space="preserve">
+<g id="Grid" display="none">
+</g>
+<g id="Layer_1">
+</g>
+<g id="Desktop">
+</g>
+<g id="Guides">
+</g>
+<g id="Page_1">
+ <g id="Layer_1_1_">
+
+ <linearGradient id="XMLID_8_" gradientUnits="userSpaceOnUse" x1="242.4595" y1="542.1074" x2="332.2358" y2="542.1074" gradientTransform="matrix(0.6652 0 0 0.6708 371.3542 -281.5009)">
+ <stop offset="0.35" style="stop-color:#85C881"/>
+ <stop offset="0.503" style="stop-color:#097E3F"/>
+ <stop offset="0.65" style="stop-color:#205127"/>
+ </linearGradient>
+ <path fill-rule="evenodd" clip-rule="evenodd" fill="url(#XMLID_8_)" d="M550.94,0c10.977,0,21.309,0.004,32.281,0.004
+ c-4.492,2.91-6,4.117-7.93,7.172c-1.383,2.195-1.738,6.352-1.988,10.098c-1.887,43.109-0.73,86.543-1.008,129.652
+ c0.176,11.75,4.793,10.371,20.074,9.922c-2.305,1.953-6.039,5.816-8.938,7.473c-13.781,0-26.945-0.293-40.723-0.293
+ c5.195-5.363,7.855-8.82,7.5-22.227c0.273-45.055-1.512-88.285,1.234-131.672c-6.465,0.184-12.332,0.09-18.797,0.277
+ C538.745,7.258,544.522,2.828,550.94,0L550.94,0z"/>
+ <path fill-rule="evenodd" clip-rule="evenodd" fill="#6B696B" d="M691.01,55.836c1.488,0,9.984,0,11.473,0l-0.77,2.113
+ c-0.262,0.109-0.523,0.215-0.781,0.324c0.164-0.777,0.434-1.355-0.16-1.512l-2.691,0.004c-0.148,2.574-0.254,7.293-0.25,10.68
+ c-0.133,1.121,1.086,1.051,2.348,1.301l-1.098,0.637c-1.867,0-3.727-0.039-5.594-0.039c0.891-0.469,1.016-1.195,0.969-3.016
+ c-0.055-3.031,0.055-6.926,0.215-9.59c-0.902-0.023-1.699,0.012-2.574,0.039c-0.402,0.047-0.711,0.453-0.992,1.16l-0.852,0.355
+ L691.01,55.836L691.01,55.836z"/>
+
+ <radialGradient id="XMLID_9_" cx="-89.4995" cy="559.8066" r="94.2447" gradientTransform="matrix(0.6875 0 0 0.6652 291.9632 -263.6867)" gradientUnits="userSpaceOnUse">
+ <stop offset="0.1124" style="stop-color:#FFFFFF"/>
+ <stop offset="0.12" style="stop-color:#F15C49"/>
+ <stop offset="0.31" style="stop-color:#4E140E"/>
+ <stop offset="0.4772" style="stop-color:#B21F24"/>
+ <stop offset="0.5684" style="stop-color:#B21F24"/>
+ <stop offset="0.6748" style="stop-color:#F15C49"/>
+ <stop offset="0.88" style="stop-color:#4E140E"/>
+ </radialGradient>
+ <path fill-rule="evenodd" clip-rule="evenodd" fill="url(#XMLID_9_)" d="M236.346,56.355c37.484,0,57.039,24.629,58.791,53.484
+ c1.736,28.742-22.246,54.461-51.596,57.543c-35.295,3.699-66.115-20.332-66.115-55.371
+ C177.426,81.359,203.895,56.355,236.346,56.355L236.346,56.355z M271.77,113.535c2.146,21.148-5.029,40.781-24.227,45.176
+ c-19.643,4.492-40.467-11.613-45.668-38.98c-5.705-30.012,3.725-49.777,22.268-54.637
+ C246.108,59.336,268.495,81.25,271.77,113.535L271.77,113.535z"/>
+
+ <radialGradient id="XMLID_10_" cx="50.7944" cy="559.8027" r="92.5321" gradientTransform="matrix(0.6794 0 0 0.6652 324.1435 -263.6867)" gradientUnits="userSpaceOnUse">
+ <stop offset="0.11" style="stop-color:#FEEE15"/>
+ <stop offset="0.305" style="stop-color:#615120"/>
+ <stop offset="0.4298" style="stop-color:#B08D2F"/>
+ <stop offset="0.5858" style="stop-color:#B38F2F"/>
+ <stop offset="0.6794" style="stop-color:#F1E00B"/>
+ <stop offset="0.89" style="stop-color:#615120"/>
+ </radialGradient>
+ <path fill-rule="evenodd" clip-rule="evenodd" fill="url(#XMLID_10_)" d="M363.333,56.355c37.045,0,56.373,24.629,58.104,53.484
+ c1.715,28.742-21.988,54.461-50.996,57.543c-34.881,3.699-65.34-20.332-65.34-55.371C305.1,81.359,331.258,56.355,363.333,56.355
+ L363.333,56.355z M398.338,113.535c2.125,21.148-4.969,40.781-23.941,45.176c-19.414,4.492-39.992-11.613-45.133-38.98
+ c-5.641-30.012,3.68-49.777,22.006-54.637C372.979,59.336,395.104,81.25,398.338,113.535L398.338,113.535z"/>
+
+ <radialGradient id="XMLID_11_" cx="397.9761" cy="536.8584" r="115.4805" gradientTransform="matrix(0.6652 0 0 0.6652 404.6628 -255.9006)" gradientUnits="userSpaceOnUse">
+ <stop offset="0.08" style="stop-color:#F15C49"/>
+ <stop offset="0.0968" style="stop-color:#4E140E"/>
+ <stop offset="0.4748" style="stop-color:#B21F24"/>
+ <stop offset="0.5756" style="stop-color:#B21F24"/>
+ <stop offset="0.6932" style="stop-color:#F15C49"/>
+ <stop offset="0.92" style="stop-color:#4E140E"/>
+ </radialGradient>
+ <path fill-rule="evenodd" clip-rule="evenodd" fill="url(#XMLID_11_)" d="M684.073,88.641c3.609-1.5,3.895-1.762,2.563-5.574
+ c-7.629-21.77-36.344-33.523-60.797-23.324c-19.285,8.039-33.25,28.434-33.25,51.246c0,30.734,22.18,58.063,52.32,58.063
+ c13.813,0,23.633-1.906,32.383-7.457c1.875-1.738,12.438-10.191,12.539-12.004c0.023-0.418-1.484,0.898-3.781,2.164
+ c-6.813,3.586-17.023,4.957-25.023,5.105c-16.203,0.297-29.141-10.742-37.578-23.848c-5.43-8.434-8.938-18.078-9.813-28.434
+ c-1.34-15.91,2.547-34.215,20.523-38.707c11.961-2.992,23.289,3.707,27.695,15.23c1.996,5.227,0.789,7.941-4.043,9.938
+ l-43.246,18.063l14.746,0.941C646.87,102.762,666.518,95.922,684.073,88.641L684.073,88.641z"/>
+
+ <radialGradient id="XMLID_12_" cx="-251.0381" cy="536.7227" r="139.9347" gradientTransform="matrix(0.6652 0 0 0.6652 256.4202 -274.632)" gradientUnits="userSpaceOnUse">
+ <stop offset="0.14" style="stop-color:#6584C2"/>
+ <stop offset="0.32" style="stop-color:#263573"/>
+ <stop offset="0.5648" style="stop-color:#2C50A3"/>
+ <stop offset="0.6656" style="stop-color:#6584C2"/>
+ <stop offset="0.86" style="stop-color:#263573"/>
+ </radialGradient>
+ <path fill-rule="evenodd" clip-rule="evenodd" fill="url(#XMLID_12_)" d="M143.196,40.938l16.85-17.18
+ C131.444,0.078,82.385-3.027,49.879,13.406C21.606,27.703,1.049,56.098,0.042,87.805c-1.059,33.371,18.338,59.77,38.021,73.047
+ c32.492,21.91,88.824,17.031,122.758-0.102l-0.008-3.176l0.004-0.004v-34.973l7.9-9.254h-49.436l-18.309,10.309l35.557-1.055
+ c0,9.957,0,20.863,0,30.824c0,4.379,0.057,5.082-7.152,7.406c-10.145,2.668-21.598,3.188-32.063,2.316
+ c-35.504-2.961-62.566-31.016-68.979-66.008c-6.082-33.199,9.574-64.605,36.045-77.566c12.928-6.328,28.438-9.297,45.25-3.918
+ c10.539,3.375,20.109,9.449,28.449,17.828l-5.809,10.563L143.196,40.938L143.196,40.938z"/>
+
+ <radialGradient id="XMLID_13_" cx="190.2485" cy="510.457" r="88.1475" gradientTransform="matrix(0.666 0 0 0.666 353.5035 -242.8212)" gradientUnits="userSpaceOnUse">
+ <stop offset="0.08" style="stop-color:#6584C2"/>
+ <stop offset="0.248" style="stop-color:#263573"/>
+ <stop offset="0.4748" style="stop-color:#6584C2"/>
+ <stop offset="0.6596" style="stop-color:#2C50A3"/>
+ <stop offset="0.92" style="stop-color:#263573"/>
+ </radialGradient>
+ <path fill-rule="evenodd" clip-rule="evenodd" fill="url(#XMLID_13_)" d="M507.112,131.16l-29.234,10.438
+ c1.09-1.91,0.398-1.254-1.66-0.941c-18.895,2.855-38.363-9.48-42.918-28.121c-2.309-9.461-0.875-19.348,2.727-27.082
+ c7.828-16.805,25.23-26.141,44.535-26.141c20.082,0,38.676,0.004,58.363,0.164l-13.805,8.938h-15.715
+ c6.641,4.633,11.723,11.313,14.527,18.758c2.988,7.922,3.398,16.707,0.367,24.797C521.44,119.598,515.639,126.168,507.112,131.16
+ L507.112,131.16z M504.178,100.457c2.457,14.922-1.332,29.074-14.824,32.805c-13.805,3.82-29.078-6.926-33.988-26.156
+ c-5.387-21.09,0.184-34.484,13.191-38.527C483.963,63.789,500.424,77.68,504.178,100.457L504.178,100.457z"/>
+
+ <radialGradient id="XMLID_14_" cx="169.6396" cy="660.5957" r="95.1706" gradientTransform="matrix(0.666 0 0 0.666 360.8121 -245.4305)" gradientUnits="userSpaceOnUse">
+ <stop offset="0.07" style="stop-color:#6584C2"/>
+ <stop offset="0.242" style="stop-color:#263573"/>
+ <stop offset="0.4742" style="stop-color:#6584C2"/>
+ <stop offset="0.6634" style="stop-color:#2C50A3"/>
+ <stop offset="0.93" style="stop-color:#263573"/>
+ </radialGradient>
+ <path fill-rule="evenodd" clip-rule="evenodd" fill="url(#XMLID_14_)" d="M477.877,141.594l29.234-10.434
+ c-4.844,2.84-7.293,6.434-7.563,9.883c-0.789,10.07,11.516,17.391,18.633,22.715c15.563,11.656,21.641,30.773,11.344,49.246
+ c-9.84,17.637-33.281,25.504-58.168,25.594c-30.918-0.137-50.418-14.305-51.449-33.586c-1.328-24.922,24.242-36.781,47.344-39.484
+ c6.469-0.758,12.25-0.637,17.688-0.254C476.764,159.895,473.706,148.922,477.877,141.594L477.877,141.594z M492.581,171.699
+ c2.328,1.695,4.746,3.352,7.234,4.93c13.563,8.586,17.891,19.086,16.785,28.777c-1.328,11.688-12.543,20.902-31.742,22.066
+ c-20.496,1.242-48.09-6.875-42.98-33.836c2.719-14.363,21.781-21.781,37.539-22.305
+ C483.78,171.191,488.217,171.551,492.581,171.699L492.581,171.699z"/>
+ <path fill-rule="evenodd" clip-rule="evenodd" fill="#6B696B" d="M702.94,55.836c0.258,0,0.496,0,0.734,0v-0.004h2.914
+ c0.711,0,0.758,0.344,0.996,1.008c1.012,2.809,3.316,9.676,3.34,9.637c0.953-2.594,2.402-6.457,3.523-9.129
+ c-0.008-0.309-0.313-0.332-0.707-0.309c-0.523,0-1.043,0-1.566,0c0.008-0.008,0.023-0.016,0.031-0.023
+ c-0.016,0.004-0.031,0.012-0.047,0.016c0.164-0.117,0.328-0.238,0.492-0.359c0.363-0.277,0.727-0.559,1.09-0.836
+ c0.02,0,0.035,0,0.055,0h0.004c1.488,0,2.695,0,4.188,0l0,0c0.32,0,0.648,0,0.969,0c-0.086,0.199-0.172,0.402-0.258,0.605
+ c-0.727,0.457-0.547,1.656-0.48,2.586c0.168,2.43,0.418,4.855,0.629,7.281c0.102,1.16,0.344,2.172,1.156,3.059
+ c-0.781,0.223-1.305,0.301-2.352,0.301c-1.688,0-2.156-1.078-2.344-2.961c-0.172-2.629-0.344-5.258-0.516-7.883
+ c-1.109,2.777-2.129,5.363-3.148,8.199c-0.219,0.672-0.313,0.742-0.07,1.41l-3.031,1.215l-3.863-11.012
+ c-0.254,2.547-0.512,5.852-0.664,8.387c-0.043,1.242,0.141,1.547,2.23,1.652l-1.215,0.707c-1.871,0-1.23-0.039-3.098-0.039
+ c0.887-0.609,1.148-1.199,1.227-3.016c0.188-2.797,0.492-6.828,0.84-9.492l-0.027-0.07c-0.762-0.016-1.352-0.129-2.313,0.266
+ L702.94,55.836L702.94,55.836z"/>
+ </g>
+</g>
+</svg>