Go to file
Ben Wagner 8508f6582f SkTInsertionSort tweak.
'Unoptomized' insertion sort swaps the 'insert' value multiple times
inside the main loop before it finds its place. However, this has the
advantage that if the 'insert' element is already not less than any
element in the sorted partition no moves are made at all.

The 'optimized' insertion sort present before this CL moves the 'insert'
value into a temporary (creating a 'hole') and then moves already sorted
elements until the 'insert' element finds its place. This has the
disadvantage of always moving the 'insert' element out of the list and
then re-inserting it, even if this was unnecessary.

This CL further optimizes the insertion sort by moving the first test of
the main loop to before moving the 'insert' element into the temporary.
This is expected to increase the code size by a few instructions but
avoids the useless non-moves. There will actually be one fewer
comparison per element comsidered (the initial 'left < hole' predicate
is always true when entering the inner loop).

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4022

Change-Id: I33158b7781e4dbec1f1b76c0bf43ebe169075733
Reviewed-on: https://skia-review.googlesource.com/4022
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Ben Wagner <bungeman@google.com>
2016-10-26 22:27:17 +00:00
animations first cut at a checkbox 2009-10-21 19:41:10 +00:00
bench Convert SkRasterPipeline loads and stores to indirect. 2016-10-26 18:15:03 +00:00
bin Build for Android from Windows, work in progress. 2016-10-26 14:37:43 +00:00
cmake Add gif sources to public.bzl. 2016-10-24 19:26:22 +00:00
debugger Remove some ancillary users of SkSurface::MakeRenderTargetDirect 2016-08-01 05:53:23 -07:00
dm DM: JSON Debug Sink 2016-10-25 14:58:17 +00:00
example simplify composing raster surface into window 2016-09-29 19:58:04 +00:00
experimental GrConstColorProcessor uses 4f colors in the destination space 2016-10-26 00:48:33 +00:00
fuzz Fix memory leak in FuzzGradients 2016-10-25 06:11:05 -07:00
gm Fix some Windows warnings 2016-10-26 14:16:28 +00:00
gn gpu.gypi -> gpu.gni 2016-10-26 22:14:31 +00:00
gyp gpu.gypi -> gpu.gni 2016-10-26 22:14:31 +00:00
include SkRasterPipelineBlitter simplifications 2016-10-26 20:58:56 +00:00
infra Add recipe support for Pixel and Pixel XL. 2016-10-26 18:02:26 +00:00
platform_tools Add mips dsp arch variants to gyp_to_android.py. 2016-09-27 07:37:20 -07:00
resources SkGifCodec: do not write off the end of memory when repeatCount > 1 2016-10-26 00:43:27 +00:00
samplecode Rename all color space factories from New* to Make* 2016-10-24 14:02:27 +00:00
site Mac GN doc. 2016-10-25 16:23:09 +00:00
src SkTInsertionSort tweak. 2016-10-26 22:27:17 +00:00
tests Convert SkRasterPipeline loads and stores to indirect. 2016-10-26 18:15:03 +00:00
third_party Write transparent pixels more often (SkGifCodec) 2016-10-26 13:48:03 -07:00
tools Add GrOpList and rename GrDrawTarget to GrRenderTargetOpList 2016-10-26 00:48:37 +00:00
.gitignore Remove skia.conf from .gitignore 2016-10-26 14:50:09 +00:00
.gn Basic standalone GN configs. 2016-07-21 12:25:45 -07:00
AUTHORS Add contributor to Skia AUTHORS file 2016-09-01 07:55:43 -07:00
BUILD.gn gypi -> gni: core, effects, android framework defines 2016-10-26 21:44:49 +00:00
codereview.settings Automatically add a docs preview link and NOTRY=true when there are only docs changes. 2015-02-26 10:16:13 -08:00
CONTRIBUTING Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
CQ_COMMITTERS Moved committer list to chrome-infra-auth and deleted it from the repo 2015-09-02 13:37:54 -07:00
DEPS Roll common DEPS 2016-10-21 12:01:12 -07:00
Doxyfile Make the housekeeper upload doxygen to a newer bucket 2016-10-04 13:23:57 -07:00
gyp_skia Make Win runtime DLLs writeable before overwriting 2016-03-18 08:33:38 -07:00
gyp_skia.py Roll gyp deps from 1765 to 1796. 2013-11-21 18:11:14 +00:00
LICENSE BUG=skia:5602 2016-09-02 11:19:34 -07:00
make.bat Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
make.py GYP: remove stale skia_scalar gyp variable 2015-11-10 13:25:12 -05:00
Makefile Add visualbench as valid target to Makefile 2015-12-18 08:05:06 -08:00
OWNERS add root files from chrome 2013-08-13 19:11:15 +00:00
PRESUBMIT.py Split SkSL and utils apart again into .gni files. 2016-10-26 18:56:37 +00:00
public.bzl Do not exclude Gif on iOS 2016-10-25 12:43:50 -07:00
README Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
README.chromium Update README.chromium. 2015-06-11 13:19:24 -07:00
skia.gyp Fix references to https://sites.google.com/site/skiadocs/. 2015-02-03 13:12:54 -02:00
whitespace.txt Test CL 2016-10-26 20:33:49 +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.