Home
last modified time | relevance | path

Searched refs:CanvasKit (Results 1 – 25 of 69) sorted by relevance

123

/third_party/skia/modules/canvaskit/htmlcanvas/
D_namedcolors.js10 }).then((CanvasKit) => {
13 'aliceblue': CanvasKit.Color(240, 248, 255),
14 'antiquewhite': CanvasKit.Color(250, 235, 215),
15 'aqua': CanvasKit.Color(0, 255, 255),
16 'aquamarine': CanvasKit.Color(127, 255, 212),
17 'azure': CanvasKit.Color(240, 255, 255),
18 'beige': CanvasKit.Color(245, 245, 220),
19 'bisque': CanvasKit.Color(255, 228, 196),
20 'black': CanvasKit.Color(0, 0, 0),
21 'blanchedalmond': CanvasKit.Color(255, 235, 205),
[all …]
Dcanvas2dcontext.js3 this._paint = new CanvasKit.Paint();
7 this._paint.setStrokeCap(CanvasKit.StrokeCap.Butt);
8 this._paint.setStrokeJoin(CanvasKit.StrokeJoin.Miter);
11 this._font = new CanvasKit.Font(null, 10);
14 this._strokeStyle = CanvasKit.BLACK;
15 this._fillStyle = CanvasKit.BLACK;
17 this._shadowColor = CanvasKit.TRANSPARENT;
25 this._globalCompositeOperation = CanvasKit.BlendMode.SrcOver;
30 this._currentPath = new CanvasKit.Path();
31 this._currentTransform = CanvasKit.Matrix.identity();
[all …]
/third_party/skia/modules/canvaskit/tests/
Dcanvas.spec.js18 const paint = new CanvasKit.Paint();
21 paint.setColor(CanvasKit.Color(0, 0, 0, 1.0));
22 paint.setStyle(CanvasKit.PaintStyle.Stroke);
25 const rrect = CanvasKit.RRectXY([5, 35, 45, 80], 15, 10);
28 canvas.drawOval(CanvasKit.LTRBRect(5, 35, 45, 80), paint);
30 canvas.drawArc(CanvasKit.LTRBRect(55, 35, 95, 80), 15, 270, true, paint);
32 const font = new CanvasKit.Font(null, 20);
35 const blob = CanvasKit.TextBlob.MakeFromText('Unicode chars �� é É ص', font);
45 const path = starPath(CanvasKit);
46 const paint = new CanvasKit.Paint();
[all …]
Dpath.spec.js18 const paint = new CanvasKit.Paint();
21 paint.setColor(CanvasKit.Color(0, 0, 0, 1.0));
22 paint.setStyle(CanvasKit.PaintStyle.Stroke);
24 const path = new CanvasKit.Path();
52 const rrect = CanvasKit.RRectXY([100, 10, 140, 62], 10, 4);
54 const rrectPath = new CanvasKit.Path().addRRect(rrect, true);
67 const path = CanvasKit.Path.MakeFromSVGString(
75 CanvasKit.MOVE_VERB, 205, 5,
76 CanvasKit.LINE_VERB, 795, 5,
77 CanvasKit.LINE_VERB, 595, 295,
[all …]
Dcore.spec.js18 const spr = new CanvasKit.PictureRecorder();
20 CanvasKit.LTRBRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT));
21 const paint = new CanvasKit.Paint();
24 paint.setColor(CanvasKit.Color(0, 0, 0, 1.0));
25 paint.setStyle(CanvasKit.PaintStyle.Stroke);
27 rcanvas.drawRRect(CanvasKit.RRectXY([5, 35, 45, 80], 15, 10), paint);
29 const font = new CanvasKit.Font(null, 20);
44 return CanvasKit.Color(
54 ambient: CanvasKit.BLUE,
55 spot: CanvasKit.RED,
[all …]
Dparagraph.spec.js50 const paint = new CanvasKit.Paint();
52 paint.setColor(CanvasKit.RED);
53 paint.setStyle(CanvasKit.PaintStyle.Stroke);
55 const fontMgr = CanvasKit.FontMgr.FromData(notoSerifFontBuffer);
61 const paraStyle = new CanvasKit.ParagraphStyle({
63 color: CanvasKit.BLACK,
67 textAlign: CanvasKit.TextAlign.Center,
72 const builder = CanvasKit.ParagraphBuilder.Make(paraStyle, fontMgr);
75 const blueText = new CanvasKit.TextStyle({
76 backgroundColor: CanvasKit.Color(234, 208, 232), // light pink
[all …]
Dfont.spec.js37 const paint = new CanvasKit.Paint();
39 paint.setStyle(CanvasKit.PaintStyle.Stroke);
41 const font = new CanvasKit.Font(null, 24);
42 const fontPaint = new CanvasKit.Paint();
44 fontPaint.setStyle(CanvasKit.PaintStyle.Fill);
47 const arc = new CanvasKit.Path();
48 arc.arcToOval(CanvasKit.LTRBRect(20, 40, 280, 300), -160, 140, true);
50 arc.arcToOval(CanvasKit.LTRBRect(20, 0, 280, 260), 160, -140, true);
54 const textBlob = CanvasKit.TextBlob.MakeOnPath(str, arc, font);
67 const notoSerif = CanvasKit.Typeface.MakeFreeTypeFaceFromData(notoSerifFontBuffer);
[all …]
Dmatrix.spec.js19 CanvasKit.Matrix.translated(5, -1),
27 CanvasKit.Matrix.scaled(2, 3),
35 CanvasKit.Matrix.rotated(Math.PI, 9, 9),
43 CanvasKit.Matrix.skewed(4, 3, 2, 1),
66 CanvasKit.Matrix.multiply(a, b),
77 const b = CanvasKit.Matrix.invert(a);
79 CanvasKit.Matrix.multiply(a, b),
80 CanvasKit.Matrix.identity());
98 CanvasKit.Matrix.mapPoints(a, points),
107 CanvasKit.M44.translated([5, 6, 7]),
[all …]
Drtshader.spec.js38 const surface = CanvasKit.MakeCanvasSurface('test');
43 const spiral = CanvasKit.RuntimeEffect.Make(spiralSkSL);
63 const paint = new CanvasKit.Paint();
64 canvas.clear(CanvasKit.BLACK); // black should not be visible
73 canvas.drawRect(CanvasKit.LTRBRect(0, 0, CANVAS_WIDTH, CANVAS_HEIGHT), paint);
87 testRTShader('rtshader_spiral_translated', done, CanvasKit.Matrix.translated(-200, 100));
92 const spiral = CanvasKit.RuntimeEffect.Make(`invalid sksl code, I hope`, (e) => {
132 const brickImg = CanvasKit.MakeImageFromEncoded(brickData);
134 const mandrillImg = CanvasKit.MakeImageFromEncoded(mandrillData);
137 const thresholdEffect = CanvasKit.RuntimeEffect.Make(thresholdSkSL);
[all …]
Dskottie.spec.js33 if (!CanvasKit.skottie || !CanvasKit.managed_skottie) {
38 const animation = CanvasKit.MakeManagedAnimation(promises[1], {
42 const bounds = CanvasKit.LTRBRect(0, 0, 500, 500);
47 canvas.clear(CanvasKit.WHITE);
60 canvas.clear(CanvasKit.WHITE);
66 if (!CanvasKit.skottie || !CanvasKit.managed_skottie) {
71 const bounds = CanvasKit.LTRBRect(0, 0, 500, 500);
72 canvas.clear(CanvasKit.WHITE);
74 const animation = CanvasKit.MakeManagedAnimation(promises[0]);
76 animation.setColor('$Icon Fill', CanvasKit.RED);
[all …]
Dcanvas2d.spec.js31 const parseColor = CanvasKit.parseColorString;
33 CanvasKit.Color(hex('FF'), hex('EE'), hex('DD'), 1));
35 CanvasKit.Color(hex('FF'), hex('EE'), hex('DD'), hex('CC')/255));
37 CanvasKit.Color(hex('FF'), hex('EE'), hex('DD'), 1));
39 CanvasKit.Color(hex('FF'), hex('EE'), hex('DD'), hex('CC')/255));
42 const parseColor = CanvasKit.parseColorString;
44 CanvasKit.Color(117, 33, 64, 0.75));
46 CanvasKit.Color(117, 33, 64, 0.75));
48 CanvasKit.Color(117, 33, 64, 1.0));
50 CanvasKit.Color(117, 33, 64, 1.0));
[all …]
/third_party/skia/tools/perf-canvaskit-puppeteer/
Dcanvas_perf.js7 function randomColorTwo(CanvasKit, i, j) { argument
11 return CanvasKit.Color4f(...c);
14 function randomColor(CanvasKit) { argument
15 return CanvasKit.Color4f(Math.random(), Math.random(), Math.random(), Math.random());
18 function starPath(CanvasKit, X=128, Y=128, R=116) { argument
19 const p = new CanvasKit.Path();
31 setup: function(CanvasKit, ctx) { argument
34 test: function(CanvasKit, ctx) { argument
40 ctx.canvas.clipRect(CanvasKit.LTRBRect(x, y, x+50, y+50),
41 CanvasKit.ClipOp.Intersect, false);
[all …]
/third_party/skia/modules/canvaskit/
Dinterface.js8 CanvasKit.onRuntimeInitialized = function() {
11 _scratchColor = CanvasKit.Malloc(Float32Array, 4); // 4 color scalars.
14 _scratch4x4Matrix = CanvasKit.Malloc(Float32Array, 16); // 16 matrix scalars.
17 _scratch3x3Matrix = CanvasKit.Malloc(Float32Array, 9); // 9 matrix scalars.
20 _scratchRRect = CanvasKit.Malloc(Float32Array, 12); // 4 scalars for rrect, 8 for radii.
23 _scratchRRect2 = CanvasKit.Malloc(Float32Array, 12); // 4 scalars for rrect, 8 for radii.
26 _scratchFourFloatsA = CanvasKit.Malloc(Float32Array, 4);
29 _scratchFourFloatsB = CanvasKit.Malloc(Float32Array, 4);
32 _scratchThreeFloatsA = CanvasKit.Malloc(Float32Array, 3); // 3 floats to represent SkVector3
35 _scratchThreeFloatsB = CanvasKit.Malloc(Float32Array, 3); // 3 floats to represent SkVector3
[all …]
Dfont.js1 CanvasKit._extraInitializations = CanvasKit._extraInitializations || [];
2 CanvasKit._extraInitializations.push(function() {
4 CanvasKit.Canvas.prototype.drawText = function(str, x, y, paint, font) {
10 var strPtr = CanvasKit._malloc(strLen + 1);
13 CanvasKit._free(strPtr);
20 CanvasKit.Font.prototype.getGlyphBounds = function(glyphs, paint, optionalOutputArray) {
23 var rectPtr = CanvasKit._malloc(glyphs.length * bytesPerRect);
26 var rects = new Float32Array(CanvasKit.HEAPU8.buffer, rectPtr, glyphs.length * 4);
30 CanvasKit._free(rectPtr);
34 CanvasKit._free(rectPtr);
[all …]
Dparagraph.js1 (function(CanvasKit){ argument
2 CanvasKit._extraInitializations = CanvasKit._extraInitializations || [];
3 CanvasKit._extraInitializations.push(function() {
5 CanvasKit.Paragraph.prototype.getRectsForRange = function(start, end, hStyle, wStyle) {
14 CanvasKit.Paragraph.prototype.getRectsForPlaceholders = function() {
29 … var r = CanvasKit.LTRBRect(floatArray[i], floatArray[i+1], floatArray[i+2], floatArray[i+3]);
31 r['direction'] = CanvasKit.TextDirection.RTL;
33 r['direction'] = CanvasKit.TextDirection.LTR;
37 CanvasKit._free(floatArray.byteOffset);
42 CanvasKit.TypefaceFontProvider.prototype.registerFont = function(font, family) {
[all …]
Dcpu.js5 (function(CanvasKit){ argument
6 CanvasKit._extraInitializations = CanvasKit._extraInitializations || [];
7 CanvasKit._extraInitializations.push(function() {
9 CanvasKit.MakeSWCanvasSurface = function(idOrElement) {
20 var surface = CanvasKit.MakeSurface(canvas.width, canvas.height);
28 if (!CanvasKit.MakeCanvasSurface) {
29 CanvasKit.MakeCanvasSurface = CanvasKit.MakeSWCanvasSurface;
36 CanvasKit.MakeSurface = function(width, height) {
40 'colorType': CanvasKit.ColorType.RGBA_8888,
43 'alphaType': CanvasKit.AlphaType.Unpremul,
[all …]
Dcolor.js11 CanvasKit.Color = function(r, g, b, a) {
15 return CanvasKit.Color4f(clamp(r)/255, clamp(g)/255, clamp(b)/255, a);
20 CanvasKit.ColorAsInt = function(r, g, b, a) {
35 CanvasKit.Color4f = function(r, g, b, a) {
44 Object.defineProperty(CanvasKit, 'TRANSPARENT', {
45 get: function() { return CanvasKit.Color4f(0, 0, 0, 0); }
47 Object.defineProperty(CanvasKit, 'BLACK', {
48 get: function() { return CanvasKit.Color4f(0, 0, 0, 1); }
50 Object.defineProperty(CanvasKit, 'WHITE', {
51 get: function() { return CanvasKit.Color4f(1, 1, 1, 1); }
[all …]
Dmatrix.js10 CanvasKit.Matrix = {};
51 CanvasKit.Matrix.identity = function() {
57 CanvasKit.Matrix.invert = function(m) {
81 CanvasKit.Matrix.mapPoints = function(matrix, ptArr) {
146 CanvasKit.Matrix.multiply = function() {
153 CanvasKit.Matrix.rotated = function(radians, px, py) {
165 CanvasKit.Matrix.scaled = function(sx, sy, px, py) {
172 CanvasKit.Matrix.skewed = function(kx, ky, px, py) {
179 CanvasKit.Matrix.translated = function(dx, dy) {
186 CanvasKit.Vector = {};
[all …]
Dgpu.js4 (function(CanvasKit){ argument
5 CanvasKit._extraInitializations = CanvasKit._extraInitializations || [];
6 CanvasKit._extraInitializations.push(function() {
14 CanvasKit.GetWebGLContext = function(canvas, attrs) {
53 CanvasKit.deleteContext = function(handle) {
57 CanvasKit._setTextureCleanup({
67 CanvasKit.MakeGrContext = function(ctx) {
81 CanvasKit.MakeOnScreenGLSurface = function(grCtx, w, h, colorspace) {
90 CanvasKit.MakeRenderTarget = function(grCtx, w, h) {
99 CanvasKit.MakeRenderTarget = function(grCtx, imageInfo) {
[all …]
Dskottie.js17 CanvasKit.MakeManagedAnimation = function(json, assets, prop_filter_prefix, soundMap, logger) {
18 if (!CanvasKit._MakeManagedAnimation) {
25 return CanvasKit._MakeManagedAnimation(json, 0, nullptr, nullptr, nullptr, prop_filter_prefix,
38 var iptr = CanvasKit._malloc(data.byteLength);
39 CanvasKit.HEAPU8.set(data, iptr);
47 var strPtr = CanvasKit._malloc(strLen);
59 var anim = CanvasKit._MakeManagedAnimation(json, assetKeys.length, namesPtr,
64 CanvasKit._free(namesPtr);
65 CanvasKit._free(assetsPtr);
66 CanvasKit._free(assetSizesPtr);
[all …]
Dparticles.js7 CanvasKit.MakeParticles = function(json, assets) {
8 if (!CanvasKit._MakeParticles) {
12 return CanvasKit._MakeParticles(json, 0, nullptr, nullptr, nullptr);
24 var iptr = CanvasKit._malloc(data.byteLength);
25 CanvasKit.HEAPU8.set(data, iptr);
33 var strPtr = CanvasKit._malloc(strLen);
45 var particles = CanvasKit._MakeParticles(json, assetKeys.length,
49 CanvasKit._free(namesPtr);
50 CanvasKit._free(assetsPtr);
51 CanvasKit._free(assetSizesPtr);
[all …]
/third_party/skia/site/docs/user/modules/
Dcanvaskit.md2 title: 'CanvasKit - Skia + WebAssembly'
3 linkTitle: 'CanvasKit - Skia + WebAssembly'
11 CanvasKit provides a playground for testing new Canvas and SVG platform APIs,
136 let CanvasKit = null;
147 CanvasKit = CK;
148 DrawingExample(CanvasKit);
149 InkExample(CanvasKit);
150 ShapingExample(CanvasKit);
152 SkottieExample(CanvasKit, 'sk_legos', legoJSON, [-183, -100, 483, 400]);
154 SkottieExample(CanvasKit, 'sk_drinks', drinksJSON, fullBounds);
[all …]
Dquickstart.md3 title: "CanvasKit - Quickstart"
4 linkTitle: "CanvasKit - Quickstart"
9 CanvasKit is a wasm module that uses Skia to draw to canvas elements a more advance feature set tha…
26 ckLoaded.then((CanvasKit) => {
27 const surface = CanvasKit.MakeCanvasSurface('foo');
29 const paint = new CanvasKit.Paint();
30 paint.setColor(CanvasKit.Color4f(0.9, 0, 0, 1.0));
31 paint.setStyle(CanvasKit.PaintStyle.Stroke);
33 const rr = CanvasKit.RRectXY(CanvasKit.LTRBRect(10, 60, 210, 260), 25, 15);
36 canvas.clear(CanvasKit.WHITE);
[all …]
/third_party/skia/modules/canvaskit/npm_build/
Dnode.example.js9 }).then((CanvasKit) => {
10 let canvas = CanvasKit.MakeCanvas(300, 300);
48 fancyAPI(CanvasKit);
51 function fancyAPI(CanvasKit) { argument
52 let surface = CanvasKit.MakeSurface(300, 300);
55 const paint = new CanvasKit.Paint();
58 const roboto = CanvasKit.Typeface.MakeFreeTypeFaceFromData(robotoData);
60 const textPaint = new CanvasKit.Paint();
61 textPaint.setColor(CanvasKit.Color(40, 0, 0));
64 const textFont = new CanvasKit.Font(roboto, 30);
[all …]
/third_party/skia/demos.skia.org/demos/image_decode_web_worker/
Dmain.js15 CanvasKit,
18 const surface = CanvasKit.MakeWebGLCanvasSurface('main-thread-canvas', null);
23 const paint = new CanvasKit.Paint();
24 paint.setColor(CanvasKit.RED);
31 canvas.clear(CanvasKit.WHITE);
35 CanvasKit.LTRBRect(0, 0, 3764, 5706), // original size of the image
36 CanvasKit.LTRBRect(0, 0, 500, 800), // scaled down
52 decodedImage = CanvasKit.MakeImageFromCanvasImageSource(imgBitmap);
66 decodedImage = CanvasKit.MakeImage({
69 alphaType: CanvasKit.AlphaType.Unpremul,
[all …]

123