Go to file
mtklein d559eb2f47 SkLiteDL: turn vtable sideways
Instead of using virtuals for polymorphism, store each polymorphic operation
in its own array of function pointers.  This removes an indirection when calling
the function, and lets us use nullptr as a signal to skip the call entirely.

Unfortunately (as the old code is rather simpler) this makes an unambiguous speed improvement.

Before:
curr/maxrss	loops	min	median	mean	max	stddev	samples	config	bench
  21/26  MB	2	44.6µs	46.4µs	48.3µs	274µs	13%	51724	nonrendering	desk_nytimes.skp
  23/26  MB	11	11.4µs	11.9µs	12.4µs	75.1µs	15%	36716	nonrendering	keymobi_nytimes_com_.skp

After:
  19/26  MB	4	40.4µs	41.6µs	42.5µs	197µs	10%	29379	nonrendering	desk_nytimes.skp
  20/26  MB	14	10.5µs	10.7µs	11.2µs	59.5µs	13%	31971	nonrendering	keymobi_nytimes_com_.skp

Broader comparison:
               keymobi_linkedin.skp	1.76us -> 1.77us	1x
keymobi_bing_com_search_q_sloth.skp	5.09us -> 5.05us	0.99x
               keymobi_digg_com.skp	17.4us -> 17.3us	0.99x
           keymobi_theverge_com.skp	3.37us -> 3.34us	0.99x
top25desk_mail_google_com_mail_.skp	30.8us -> 30.4us	0.99x
                     tabl_gmail.skp	3.44us -> 3.38us	0.98x
    top25desk_wikipedia__1_tab_.skp	 100us -> 97.7us	0.98x
keymobi_cnn_com_2012_10_03_poli.skp	52.9us -> 51.7us	0.98x
                desk_chalkboard.skp	 107us ->  104us	0.97x
             desk_css3gradients.skp	17.8us -> 17.3us	0.97x
keymobi_androidpolice_com_2012_.skp	42.3us -> 41.1us	0.97x
                desk_googlehome.skp	1.94us -> 1.88us	0.97x
               keymobi_mlb_com_.skp	5.38us -> 5.18us	0.96x
            top25desk_pinterest.skp	92.1us -> 88.5us	0.96x
keymobi_iphone_capitolvolkswage.skp	15.1us -> 14.5us	0.96x
         keymobi_techcrunch_com.skp	9.45us -> 9.05us	0.96x
                      desk_espn.skp	31.3us ->   30us	0.96x
          keymobi_slashdot_org_.skp	8.72us -> 8.34us	0.96x
                 desk_tiger8svg.skp	30.6us -> 29.2us	0.96x
                keymobi_blogger.skp	4.09us -> 3.91us	0.95x
keymobi_baidu_com_s_wd_barack_o.skp	11.9us -> 11.3us	0.95x
       keymobi_cuteoverload_com.skp	54.2us -> 51.6us	0.95x
        keymobi_deviantart_com_.skp	17.2us -> 16.4us	0.95x
                    desk_mapsvg.skp	 163ns ->  155ns	0.95x
              keymobi_pinterest.skp	6.97us -> 6.62us	0.95x
      top25desk_games_yahoo_com.skp	94.1us -> 89.3us	0.95x
 top25desk_google_com_calendar_.skp	  18us ->   17us	0.95x
keymobi_google_co_uk_search_hl_.skp	11.4us -> 10.8us	0.95x
                    tabl_pravda.skp	38.5us -> 36.4us	0.94x
               desk_gmailthread.skp	  19us -> 17.9us	0.94x
keymobi_reddit_com_r_programmin.skp	76.1us -> 71.7us	0.94x
             top25desk_linkedin.skp	  20us -> 18.8us	0.94x
               tabl_gamedeksiam.skp	 118us ->  112us	0.94x
         keymobi_boingboing_net.skp	20.4us -> 19.1us	0.93x
top25desk_google_com__hl_en_q_b.skp	17.6us -> 16.4us	0.93x
keymobi_amazon_com_gp_aw_s_ref_.skp	12.5us -> 11.6us	0.93x
            keymobi_sfgate_com_.skp	16.6us -> 15.5us	0.93x
keymobi_booking_com_searchresul.skp	16.2us -> 15.1us	0.93x
                      tabl_digg.skp	28.8us -> 26.8us	0.93x
                   tabl_mozilla.skp	80.4us -> 74.6us	0.93x
                   desk_wowwiki.skp	39.2us -> 36.4us	0.93x
          top25desk_youtube_com.skp	  42us -> 38.9us	0.93x
             top25desk_facebook.skp	23.7us ->   22us	0.93x
              top25desk_blogger.skp	38.2us -> 35.4us	0.93x
keymobi_online_wsj_com_home_pag.skp	12.8us -> 11.9us	0.93x
            top25desk_wordpress.skp	28.9us -> 26.8us	0.93x
    top25desk_answers_yahoo_com.skp	37.2us -> 34.4us	0.93x
keymobi_plus_google_com_app_bas.skp	9.56us -> 8.85us	0.93x
              keymobi_wordpress.skp	16.1us -> 14.9us	0.92x
keymobi_mobile_news_sandbox_goo.skp	27.1us -> 24.9us	0.92x
       top25desk_techcrunch_com.skp	31.1us -> 28.6us	0.92x
      keymobi_worldjournal_com_.skp	50.7us -> 46.5us	0.92x
keymobi_theverge_com_2012_10_28.skp	26.2us ->   24us	0.92x
            desk_jsfiddlebigcar.skp	1.73us -> 1.59us	0.92x
          top25desk_weather_com.skp	31.3us -> 28.7us	0.92x
top25desk_google_com_search_q_c.skp	48.2us -> 44.1us	0.92x
              top25desk_twitter.skp	27.8us -> 25.5us	0.92x
              tabl_worldjournal.skp	29.3us -> 26.8us	0.91x
                   desk_nytimes.skp	  46us ->   42us	0.91x
top25desk_docs___1_open_documen.skp	6.04us -> 5.51us	0.91x
      keymobi_wikipedia__1_tab_.skp	59.7us -> 54.4us	0.91x
              desk_unicodetable.skp	1.12ms -> 1.02ms	0.91x
             top25desk_ebay_com.skp	17.8us -> 16.2us	0.91x
keymobi_ftw_usatoday_com_2014_0.skp	26.8us -> 24.3us	0.91x
    top25desk_sports_yahoo_com_.skp	49.9us -> 45.3us	0.91x
                keymobi_cnn_com.skp	9.94us -> 9.03us	0.91x
keymobi_m_youtube_com_watch_v_9.skp	13.4us -> 12.2us	0.91x
           top25desk_amazon_com.skp	26.6us -> 24.1us	0.91x
         keymobi_news_yahoo_com.skp	17.5us -> 15.8us	0.9x
keymobi_wowwiki_com_world_of_wa.skp	11.2us -> 10.2us	0.9x
top25desk_plus_google_com_11003.skp	93.5us -> 84.4us	0.9x
                    desk_carsvg.skp	53.5us -> 48.2us	0.9x
       top25desk_news_yahoo_com.skp	44.7us -> 40.3us	0.9x
keymobi_wikipedia__1_tab____del.skp	59.4us -> 53.4us	0.9x
         desk_googlespreadsheet.skp	  66us -> 59.2us	0.9x
keymobi_answers_yahoo_com_quest.skp	30.2us ->   27us	0.89x
             desk_ugamsolutions.skp	  13us -> 11.6us	0.89x
keymobi_shop_mobileweb_ebay_com.skp	6.96us -> 6.21us	0.89x
           keymobi_nytimes_com_.skp	12.1us -> 10.8us	0.89x
                 keymobi_gsp_ro.skp	5.54us -> 4.92us	0.89x
          top25desk_booking_com.skp	54.9us -> 48.6us	0.89x
                 top25desk_espn.skp	  37us -> 32.6us	0.88x
keymobi_facebook_com_barackobam.skp	23.3us -> 20.4us	0.88x

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

Committed: https://skia.googlesource.com/skia/+/ac243914af957a806d842318a43dddaf5f941dc3

CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_chromium_compile_dbg_ng

Review-Url: https://codereview.chromium.org/2231103002
2016-08-11 07:08:28 -07:00
animations first cut at a checkbox 2009-10-21 19:41:10 +00:00
bench Implement GPU occluded blur mask filter 2016-08-10 16:25:25 -07:00
bin Pick the right download tool for windows. 2016-08-01 12:26:51 -07:00
build_overrides GN 2016-06-23 10:29:30 -07:00
cmake Use sse4.2 CRC32 instructions to hash when available. 2016-08-08 09:06:28 -07:00
debugger Remove some ancillary users of SkSurface::MakeRenderTargetDirect 2016-08-01 05:53:23 -07:00
dm finish SkLiteDL 2016-08-07 13:35:47 -07:00
example Get Mac viewer working with SDL 2016-08-04 12:30:31 -07:00
experimental [SVGDom] Add rx/ry support for <rect> 2016-08-10 17:11:29 -07:00
fuzz Convert SkAutoTUnref<SkData> to sk_sp<SkData>. 2016-08-03 13:32:32 -07:00
gm Implement GPU occluded blur mask filter 2016-08-10 16:25:25 -07:00
gn Roll GN: gn format is --in-place by default 2016-08-10 07:30:58 -07:00
gyp add legacy flag 2016-08-11 05:21:41 -07:00
include Deserialize pictures with custom image-deserializer 2016-08-11 03:55:15 -07:00
infra Update VERSION of "svg" asset. 2016-08-10 16:36:15 -07:00
platform_tools Revert of Cleanup use of legacy SkSurface creation methods a bit (patchset #2 id:20001 of https://codereview.chromium.org/2223023002/ ) 2016-08-08 09:17:20 -07:00
resources Fix various SkColorSpace bugs 2016-07-29 08:58:33 -07:00
samplecode moved code into onDrawShadowedPic, only renders into shadow maps if needed 2016-08-09 09:32:09 -07:00
site SkRTConf: eliminate 2016-08-04 10:47:16 -07:00
src SkLiteDL: turn vtable sideways 2016-08-11 07:08:28 -07:00
tests Deserialize pictures with custom image-deserializer 2016-08-11 03:55:15 -07:00
third_party Get Mac viewer working with SDL 2016-08-04 12:30:31 -07:00
tools Clean up Xlib viewer 2016-08-11 07:03:04 -07:00
.gitignore Move Skia recipes from build repo 2016-07-26 11:52:17 -07:00
.gn Basic standalone GN configs. 2016-07-21 12:25:45 -07:00
AUTHORS SkPDF: Use type 2/3 shading for gradient shaders 2016-06-17 12:38:54 -07:00
BUILD.gn Use sse4.2 CRC32 instructions to hash when available. 2016-08-08 09:06:28 -07: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 GN: gn format is --in-place by default 2016-08-10 07:30:58 -07:00
Doxyfile Documentation: SkCanvas API 2015-05-19 10:21:29 -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 Include resources directory in google3 sync. 2015-10-20 13:00:48 -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 Roll GN: gn format is --in-place by default 2016-08-10 07:30:58 -07:00
public.bzl add legacy flag for google3 2016-08-11 05:04:52 -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 whitespace change 2016-08-08 08:45:40 -04:00

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

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