Go to file
Michael Ludwig 05a78241e5 Remove branch in robust_normalize_diff function
This removes one branch, one normalize, one max, and switches to
dividing by the magnitude once, instead of doing it twice; invMag may
not be exact but it's accuracy should be similar to doing the divide
directly.

I changed the magnitude scaling to happen after subtracting the two
points, since this was a better balance between dealing with points
that had really large coordinates, and points that differed by epsilon
(where upon dividing the original coordinate value would lose that
precision, but doing it after the subtraction preserved the
direction).

At the very least, this does not cause the accuracy failures for large
coordinates that I was seeing before robust_normalize_diff was first
added, and it avoids issues with epsilon sized stroke rectangles that I
ran into when evaluating other optimization variants of this function.

Bug: skia:13275
Change-Id: I07862b80b67ef905fce2aeeeabed3e907a63796a
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/535438
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Michael Ludwig <michaelludwig@google.com>
2022-05-04 15:56:20 +00:00
bazel [bazel] Add location for G3 define 2022-05-03 14:22:33 +00:00
bench Reland "Delete HW tessellation shaders for curve/wedge tessellation" 2022-05-02 18:58:12 +00:00
bin Roll emsdk to 3.1.9 2022-04-29 22:31:29 +00:00
build/fuchsia [fuchsia] Fix fidlc command. 2020-06-10 03:29:24 +00:00
build_overrides Set dawn_vulkan_tools_dir in Dawn's GN overrides 2022-04-14 17:05:33 +00:00
client_utils/android Revert "Move SkCamera.h to client_utils/android" 2022-04-25 12:33:01 +00:00
demos.skia.org [canvaskit] Add in fillText to spreadsheet demo for comparison 2022-02-15 15:35:43 +00:00
dm Add dylib flag to DM 2022-05-04 15:17:54 +00:00
docker [infra] Avoid timeouts in CreateDockerImage_Skia_WASM_Release 2022-04-08 12:26:54 +00:00
docs/examples Reland "Add kR8_unorm_SkColorType" 2022-02-10 18:00:19 +00:00
example [bazel] Put licenses() after legacy_exports 2022-05-02 15:04:33 +00:00
experimental [ganesh][dawn] Fix mapAsync range size invocation 2022-05-02 18:41:47 +00:00
fuzz [includes] Enforce IWYU on src/utils 2022-04-28 17:32:20 +00:00
gm Plumb label from GrGpu's createTexture function. 2022-05-03 21:39:19 +00:00
gn Delete HW stroke tessellation shaders 2022-05-03 18:58:33 +00:00
include Fixup GrDriverBugWorkaroundsAutogen.h 2022-05-03 20:20:26 +00:00
infra Add Mac ANGLE test bots 2022-05-04 14:55:27 +00:00
modules Remove the unnecessary SkPaint parameter to SkParticleDrawable 2022-05-03 17:58:47 +00:00
platform_tools Fix bug where SkQP test that are always to be excluded are not. 2022-04-29 20:26:54 +00:00
resources [svg] Add support for var in color parsing. 2022-05-03 14:34:35 +00:00
samplecode Reland "Delete HW tessellation shaders for curve/wedge tessellation" 2022-05-02 18:58:12 +00:00
site Remove INHERITED from style 2022-05-03 17:26:23 +00:00
specs [infra] Port serve.py from Python2 to 3 2021-08-31 15:28:19 +00:00
src Remove branch in robust_normalize_diff function 2022-05-04 15:56:20 +00:00
tests SkM44::LookAt: handle zero-length vectors gracefully 2022-05-04 15:05:35 +00:00
third_party Manually roll Dawn from 41e4d9a34c1d to a1a3e0484c48 (18 revisions) 2022-05-03 13:24:06 +00:00
toolchain [bazel] Put licenses() after legacy_exports 2022-05-02 15:04:33 +00:00
tools Plumb label from GrGpu's createTexture function. 2022-05-03 21:39:19 +00:00
.bazelrc [sksl] Make sksl tracing optional 2022-04-12 13:59:25 +00:00
.bazelversion [canvaskit] Add skottie to Bazel build 2022-02-04 19:18:27 +00:00
.clang-format no more bin packing in .clang-format 2021-03-04 17:22:50 +00:00
.clang-tidy Disable ClangTidy namespace comments for short blocks. 2020-08-24 14:01:22 +00:00
.gitignore Add .vscode to the default gitignore list. 2021-10-13 15:23:02 +00:00
.gn Add support for ANGLE's Metal backend 2022-04-28 19:53:18 +00:00
.vpython [python3] Reland recipes -> python3 changes 2021-12-01 13:04:03 +00:00
AUTHORS Add missing include for std::begin and std::end in SkParseColor.cpp 2022-04-26 17:39:59 +00:00
BUILD.bazel [bazel] Put licenses() after legacy_exports 2022-05-02 15:04:33 +00:00
BUILD.gn Revert "Move SkCamera.h to client_utils/android" 2022-04-25 12:33:01 +00:00
codereview.settings
CONTRIBUTING
CQ_COMMITTERS
DEPS Roll vulkan-deps from 3b9b5a7559f3 to 1ebd98d952fa (2 revisions) 2022-05-04 08:14:20 +00:00
DIR_METADATA Move metadata in OWNERS files to DIR_METADATA files 2021-02-02 23:41:54 +00:00
go_repositories.bzl [infra] Update dep of infra repo 2022-04-28 13:20:10 +00:00
go.mod [infra] Update dep of infra repo 2022-04-28 13:20:10 +00:00
go.sum [infra] Fix go.sum 2022-04-28 18:01:34 +00:00
LICENSE
OWNERS [infra] Add wildcard OWNERS 2021-08-30 19:19:34 +00:00
OWNERS.android Update OWNERS.android with more details 2022-03-16 18:13:33 +00:00
package-lock.json [bazel] Make custom karma_test rule 2022-02-23 14:53:01 +00:00
package.json [bazel] Make custom karma_test rule 2022-02-23 14:53:01 +00:00
PRESUBMIT.py [bazel] Make PRESUBMIT ignore deleted BUILD.bazel files 2022-05-04 15:12:21 +00:00
public.bzl Fix G3 Build 2022-05-04 11:30:35 +00:00
README
README.chromium
RELEASE_NOTES.txt Reland "Reland "Add anisotropic option to SkSamplingOptions."" 2022-04-29 19:28:52 +00:00
requirements.txt add Mac hash for MarkupSafe requirements 2022-04-13 15:39:27 +00:00
whitespace.txt Push shaders.skia.org. 2022-01-19 21:46:16 +00:00
WORKSPACE.bazel Roll emsdk to 3.1.9 2022-04-29 22:31:29 +00:00

Skia is a complete 2D graphic library for drawing Text, Geometries, and Images.

See full details, and build instructions, at https://skia.org.