Home
last modified time | relevance | path

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

12345

/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/flutter/skia/modules/canvaskit/htmlcanvas/
D_namedcolors.js10 }).ready().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.SkPaint();
7 this._paint.setStrokeCap(CanvasKit.StrokeCap.Butt);
8 this._paint.setStrokeJoin(CanvasKit.StrokeJoin.Miter);
11 this._font = new CanvasKit.SkFont(null, 10);
13 this._strokeStyle = CanvasKit.BLACK;
14 this._fillStyle = CanvasKit.BLACK;
16 this._shadowColor = CanvasKit.TRANSPARENT;
24 this._globalCompositeOperation = CanvasKit.BlendMode.SrcOver;
25 this._imageFilterQuality = CanvasKit.FilterQuality.Low;
32 this._currentPath = new CanvasKit.SkPath();
[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 …]
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 …]
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 …]
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 …]
/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 …]
/third_party/flutter/skia/modules/canvaskit/
Dinterface.js8 CanvasKit.onRuntimeInitialized = function() {
18 CanvasKit.SkMatrix = {};
25 CanvasKit.SkMatrix.identity = function() {
35 CanvasKit.SkMatrix.invert = function(m) {
40 return CanvasKit.SkMatrix.identity();
52 CanvasKit.SkMatrix.mapPoints = function(matrix, ptArr) {
70 CanvasKit.SkMatrix.multiply = function(m1, m2) {
86 CanvasKit.SkMatrix.rotated = function(radians, px, py) {
98 CanvasKit.SkMatrix.scaled = function(sx, sy, px, py) {
108 CanvasKit.SkMatrix.skewed = function(kx, ky, px, py) {
[all …]
Dcpu.js3 (function(CanvasKit){ argument
4 CanvasKit._extraInitializations = CanvasKit._extraInitializations || [];
5 CanvasKit._extraInitializations.push(function() {
7 CanvasKit.MakeSWCanvasSurface = function(idOrElement) {
17 var surface = CanvasKit.MakeSurface(canvas.width, canvas.height);
25 if (!CanvasKit.MakeCanvasSurface) {
26 CanvasKit.MakeCanvasSurface = CanvasKit.MakeSWCanvasSurface;
29 CanvasKit.MakeSurface = function(width, height) {
34 'colorType': CanvasKit.ColorType.RGBA_8888,
37 'alphaType': CanvasKit.AlphaType.Unpremul,
[all …]
Dexterns.js25 var CanvasKit = { variable
511 CanvasKit.SkPath.prototype.addArc = function() {};
512 CanvasKit.SkPath.prototype.addPath = function() {};
513 CanvasKit.SkPath.prototype.addRect = function() {};
514 CanvasKit.SkPath.prototype.addRoundRect = function() {};
515 CanvasKit.SkPath.prototype.arc = function() {};
516 CanvasKit.SkPath.prototype.arcTo = function() {};
517 CanvasKit.SkPath.prototype.close = function() {};
518 CanvasKit.SkPath.prototype.conicTo = function() {};
519 CanvasKit.SkPath.prototype.cubicTo = function() {};
[all …]
Dhelper.js11 CanvasKit.Color = function(r, g, b, a) {
23 CanvasKit.getColorComponents = function(color) {
32 CanvasKit.multiplyByAlpha = function(color, alpha) {
74 ptr = CanvasKit._malloc(arr.length * dest.BYTES_PER_ELEMENT);
98 ptr = CanvasKit._malloc(arr.length * arr[0].length * dest.BYTES_PER_ELEMENT);
120 ptr = CanvasKit._malloc(arr.length * arr[0].length * arr[0][0].length * dest.BYTES_PER_ELEMENT);
174 var ptr = copy1dArray(ta, CanvasKit.HEAPF32);
205 CanvasKit.FourFloatArrayHelper = function() {
221 CanvasKit.FourFloatArrayHelper.prototype.push = function(f1, f2, f3, f4) {
233 CanvasKit.FourFloatArrayHelper.prototype.set = function(idx, f1, f2, f3, f4) {
[all …]
/third_party/flutter/skia/modules/canvaskit/tests/
Dpath.spec.js20 const surface = CanvasKit.MakeCanvasSurface('test');
27 const paint = new CanvasKit.SkPaint();
30 paint.setColor(CanvasKit.Color(0, 0, 0, 1.0));
31 paint.setStyle(CanvasKit.PaintStyle.Stroke);
33 const path = new CanvasKit.SkPath();
61 let rrect = new CanvasKit.SkPath()
81 const surface = CanvasKit.MakeCanvasSurface('test');
88 const paint = new CanvasKit.SkPaint();
91 paint.setColor(CanvasKit.Color(0, 0, 0, 1.0));
92 paint.setStyle(CanvasKit.PaintStyle.Stroke);
[all …]
Dfont.spec.js29 const surface = CanvasKit.MakeCanvasSurface('test');
36 const paint = new CanvasKit.SkPaint();
38 paint.setColor(CanvasKit.BLUE);
39 paint.setStyle(CanvasKit.PaintStyle.Stroke);
41 const fontMgr = CanvasKit.SkFontMgr.RefDefault();
44 const textPaint = new CanvasKit.SkPaint();
46 const textFont = new CanvasKit.SkFont(notoSerif, 20);
48 canvas.drawRect(CanvasKit.LTRBRect(30, 30, 200, 200), paint);
52 const shapedText = new CanvasKit.ShapedText({
70 const textFont2 = new CanvasKit.SkFont(notoSerif, 60);
[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 …]

12345