GrTessellator (AA): sorting and comparison performance improvements.
authorStephen White <senorblanco@chromium.org>
Thu, 23 Feb 2017 16:10:01 +0000 (11:10 -0500)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Thu, 23 Feb 2017 17:23:04 +0000 (17:23 +0000)
commit16a40cb65adeb4d94b84479f9946c360ed73e1bb
tree2b6c8e745c290b638916350455f462784772d28d
parentdb356b7213bfd3ed636e158b5427be68adf01bed
GrTessellator (AA): sorting and comparison performance improvements.

Change comparison functions to perform the common case first (a.fX > b.fX),
and the uncommon case (a.fX == b.fX) after the short-circuit.

Change Comparator to switch on a direction enum instead of using function
pointers.

Inline sorted_merge() and front_back_split() into merge_sort(), and template
it on the comparator function, so it instantiates two versions. This
is even faster (but costs us some code bloat of course).

BUG=skia:

Change-Id: I45a2376492240ed7e0552ca2aed75e303e918bc6
Reviewed-on: https://skia-review.googlesource.com/8791
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Stephen White <senorblanco@chromium.org>
src/gpu/GrTessellator.cpp