Kevin Lubick | 53eabf6 | 2018-12-10 12:41:26 -0500 | [diff] [blame] | 1 | // Adds compile-time JS functions to augment the CanvasKit interface. |
| 2 | // Specifically, the code that emulates the HTML Canvas interface |
| 3 | // (which is called HTMLCanvas or similar to avoid confusion with |
| 4 | // SkCanvas). |
| 5 | (function(CanvasKit) { |
| 6 | |
| 7 | // This allows us to expose internal functions (e.g. color |
| 8 | // parsing) for unit-testing, even in the minified version. |
| 9 | // Our tests are not minified like CanvasKit is, so the names |
| 10 | // would get lost otherwise. |
| 11 | CanvasKit._testing = {}; |
| 12 | |
| 13 | // This intentionally dangles because we want all the htmlcanvas |
| 14 | // JS code to be in the same scope, but JS doesn't support |
| 15 | // namespaces like C++ does. Thus, we simply include this |
| 16 | // preamble.js file, all the source .js files and then postamble.js |
| 17 | // to bundle everything in the same scope. |