Remove experimental from name of skm44 canvas methods
Change-Id: If275ede5049b74c0c4c36eb5ac5697ec63737228 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/275047 Commit-Queue: Nathaniel Nifong <nifong@google.com> Reviewed-by: Kevin Lubick <kjlubick@google.com>
This commit is contained in:
parent
50d7d6fd72
commit
628f3e70ee
@ -717,25 +717,25 @@ const curves = {
|
||||
|
||||
// want "world" to be in our big coordinates (e.g. area), so apply this inverse
|
||||
// as part of our "camera".
|
||||
canvas.experimental_saveCamera(
|
||||
canvas.saveCamera(
|
||||
CanvasKit.SkM44.multiply(viewport, perspective),
|
||||
CanvasKit.SkM44.multiply(camera, mustInvert(viewport)));
|
||||
}
|
||||
|
||||
function setClickToWorld(canvas, matrix) {
|
||||
const l2d = canvas.experimental_getLocalToDevice();
|
||||
const l2d = canvas.getLocalToDevice();
|
||||
worldToClick = CanvasKit.SkM44.multiply(mustInvert(matrix), l2d);
|
||||
clickToWorld = mustInvert(worldToClick);
|
||||
}
|
||||
|
||||
function drawCubeFace(canvas, m, color) {
|
||||
const trans = new CanvasKit.SkM44.translated([vSphereRadius/2, vSphereRadius/2, 0]);
|
||||
canvas.experimental_concat44(CanvasKit.SkM44.multiply(trans, m, mustInvert(trans)));
|
||||
const znormal = front(canvas.experimental_getLocalToDevice());
|
||||
canvas.concat44(CanvasKit.SkM44.multiply(trans, m, mustInvert(trans)));
|
||||
const znormal = front(canvas.getLocalToDevice());
|
||||
if (znormal < 0) {
|
||||
return; // skip faces facing backwards
|
||||
}
|
||||
const ltw = canvas.experimental_getLocalToWorld();
|
||||
const ltw = canvas.getLocalToWorld();
|
||||
// shader expects the 4x4 matrices in column major order.
|
||||
const uniforms = [...CanvasKit.SkM44.transpose(ltw), ...mustInvert(ltw), ...lightWorldPos];
|
||||
const paint = new CanvasKit.SkPaint();
|
||||
@ -747,9 +747,7 @@ const curves = {
|
||||
}
|
||||
|
||||
function drawFrame(canvas) {
|
||||
// TODO if not GPU backend, print an error to the console and return.
|
||||
// this demo only works in GL.
|
||||
const clickM = canvas.experimental_getLocalToDevice();
|
||||
const clickM = canvas.getLocalToDevice();
|
||||
canvas.save();
|
||||
canvas.translate(vSphereCenter[0] - vSphereRadius/2, vSphereCenter[1] - vSphereRadius/2);
|
||||
// pass surface dimensions as viewport size.
|
||||
|
@ -1053,23 +1053,23 @@ EMSCRIPTEN_BINDINGS(Skia) {
|
||||
|
||||
return self.writePixels(dstInfo, pixels, srcRowBytes, dstX, dstY);
|
||||
}))
|
||||
// Experimental 4x4 matrix functions
|
||||
.function("experimental_saveCamera", optional_override([](SkCanvas& self,
|
||||
// 4x4 matrix functions
|
||||
.function("saveCamera", optional_override([](SkCanvas& self,
|
||||
const SimpleM44& projection, const SimpleM44& camera) {
|
||||
self.experimental_saveCamera(toSkM44(projection), toSkM44(camera));
|
||||
}))
|
||||
.function("experimental_concat44", optional_override([](SkCanvas& self, const SimpleM44& m) {
|
||||
.function("concat44", optional_override([](SkCanvas& self, const SimpleM44& m) {
|
||||
self.concat44(toSkM44(m));
|
||||
}))
|
||||
.function("experimental_getLocalToDevice", optional_override([](const SkCanvas& self)->SimpleM44 {
|
||||
.function("getLocalToDevice", optional_override([](const SkCanvas& self)->SimpleM44 {
|
||||
SkM44 m = self.getLocalToDevice();
|
||||
return toSimpleM44(m);
|
||||
}))
|
||||
.function("experimental_getLocalToWorld", optional_override([](const SkCanvas& self)->SimpleM44 {
|
||||
.function("getLocalToWorld", optional_override([](const SkCanvas& self)->SimpleM44 {
|
||||
SkM44 m = self.experimental_getLocalToWorld();
|
||||
return toSimpleM44(m);
|
||||
}))
|
||||
.function("experimental_getLocalToCamera", optional_override([](const SkCanvas& self)->SimpleM44 {
|
||||
.function("getLocalToCamera", optional_override([](const SkCanvas& self)->SimpleM44 {
|
||||
SkM44 m = self.experimental_getLocalToCamera();
|
||||
return toSimpleM44(m);
|
||||
}));
|
||||
|
Loading…
Reference in New Issue
Block a user