saveCamera() is no longer experimental
In a separate CL, will stage changes to concat virtual to take M44.
Change-Id: Iaf37ce2f24ab1223c54aeb1e79eaebf18f87fece
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/281589
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Need to migrate clients from private/ to core/ include
Unexperimentalize concat44() methods on SkCanvas
Change-Id: I64b8816722a9d93316cb8b8691d2d9a3e36f167f
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/272464
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
and improve perspective handling in rest of quad pipeline
This function produces 0, 1, or 2 quads clipped to w > 0, with proper
local coords. To make its signature a little easier to reason about,
I added a simple 'DrawQuad' struct that represents the combination of
device and local coordinates, and edge AA flags. I am open to suggestions
for the name.
GrQuad::bounds() remains perspective aware so that it is always correct.
I updated CropToRect to check for w < 0 and not attempt to crop in that
scenario. Theoretically, we could clip to w = 0 first and then go through
the CropToRect optimization path. However, with the current state of the
GrFillRectOp and GrTextureOp, that made it more annoying to have the bulk
APIs handle the w clipping as well.
So for now, the w plane clipping is entirely the responsibility of the
ops. A benefit of this approach is that GrRenderTargetContext doesn't need
to be modified, and in the case where the clipping produces 2 quads they
are automatically put in the same op w/o going through any batching code.
However, it is becoming clear to me that managing 4 effective code paths
(fill + texture X simple + bulk API) is more maintenance than it's worth.
I added skbug:9869 to work out how to simplify these op creation APIs further,
and if we succeed there, I think it will make applying the W plane clipping
more convenient as well.
For now, since this affects SkiaRenderer on Linux stable, I am pushing
for correctness.
Bug: skia:9779, chromium:224618
Change-Id: I4218a956cbe0bbc2b5c9cf133a069d54c93848e8
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/268686
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Modeled on https://codepen.io/adamdupuis/pen/qLYzqB, this GM creates a
cube of rectangles with the camera at the center. It animates the FOV
since the original chrome issue was most visible when resizing the page
(which then updated the fov of the perspective css transform).
This draws correctly with the raster backend. There are two issues it
causes with Ganesh:
1. The input coordinates of some of the cube faces have 0 or negative ws.
- When negative, the current bounds code does not perform clipping and
just uses the mirrored point, which leads to misleading bounds.
- When 0, the current bounds code produces infinities, and then GrOpsTask
discards the op with non-finite bounds.
2. The anti-aliasing code also ignores w <= 0, and so all of its screen
space math is incorrect.
This causes a mix of completely discarded draws and distorted draws on the
GPU backend.
Bug: skia:9779, chromium:224618
Change-Id: Ib00b909f51cbf7aaba5b89ed830ddc720ad3c73d
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/265763
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>