Lines Matching refs:CanvasKit
10 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 = {};
187 CanvasKit.Vector.dot = function(a, b) {
193 CanvasKit.Vector.lengthSquared = function(v) {
194 return CanvasKit.Vector.dot(v, v);
196 CanvasKit.Vector.length = function(v) {
197 return Math.sqrt(CanvasKit.Vector.lengthSquared(v));
199 CanvasKit.Vector.mulScalar = function(v, s) {
202 CanvasKit.Vector.add = function(a, b) {
205 CanvasKit.Vector.sub = function(a, b) {
208 CanvasKit.Vector.dist = function(a, b) {
209 return CanvasKit.Vector.length(CanvasKit.Vector.sub(a, b));
211 CanvasKit.Vector.normalize = function(v) {
212 return CanvasKit.Vector.mulScalar(v, 1/CanvasKit.Vector.length(v));
214 CanvasKit.Vector.cross = function(a, b) {
228 CanvasKit.M44 = {};
230 CanvasKit.M44.identity = function() {
236 CanvasKit.M44.translated = function(vec) {
240 CanvasKit.M44.scaled = function(vec) {
245 CanvasKit.M44.rotated = function(axisVec, radians) {
246 return CanvasKit.M44.rotatedUnitSinCos(
247 CanvasKit.Vector.normalize(axisVec), Math.sin(radians), Math.cos(radians));
255 CanvasKit.M44.rotatedUnitSinCos = function(axisVec, sinAngle, cosAngle) {
270 CanvasKit.M44.lookat = function(eyeVec, centerVec, upVec) {
271 var f = CanvasKit.Vector.normalize(CanvasKit.Vector.sub(centerVec, eyeVec));
272 var u = CanvasKit.Vector.normalize(upVec);
273 var s = CanvasKit.Vector.normalize(CanvasKit.Vector.cross(f, u));
275 var m = CanvasKit.M44.identity();
278 stride(CanvasKit.Vector.cross(s, f), m, 4, 1, 0);
279 stride(CanvasKit.Vector.mulScalar(f, -1), m, 4, 2, 0);
282 var m2 = CanvasKit.M44.invert(m);
284 return CanvasKit.M44.identity();
290 CanvasKit.M44.perspective = function(near, far, angle) {
305 CanvasKit.M44.rc = function(m, r, c) {
309 CanvasKit.M44.multiply = function() {
316 CanvasKit.M44.invert = function(m) {
405 CanvasKit.M44.transpose = function(m) {
415 CanvasKit.M44.mustInvert = function(m) {
416 var m2 = CanvasKit.M44.invert(m);
437 CanvasKit.M44.setupCamera = function(area, zscale, cam) {
438 var camera = CanvasKit.M44.lookat(cam['eye'], cam['coa'], cam['up']);
439 var perspective = CanvasKit.M44.perspective(cam['near'], cam['far'], cam['angle']);
442 var viewport = CanvasKit.M44.multiply(
443 CanvasKit.M44.translated(center),
444 CanvasKit.M44.scaled(viewScale));
445 return CanvasKit.M44.multiply(
446 viewport, perspective, camera, CanvasKit.M44.mustInvert(viewport));
471 CanvasKit.ColorMatrix = {};
472 CanvasKit.ColorMatrix.identity = function() {
481 CanvasKit.ColorMatrix.scaled = function(rs, gs, bs, as) {
496 CanvasKit.ColorMatrix.rotated = function(axis, sine, cosine) {
497 var m = CanvasKit.ColorMatrix.identity();
508 CanvasKit.ColorMatrix.postTranslate = function(m, dr, dg, db, da) {
517 CanvasKit.ColorMatrix.concat = function(outer, inner) {