skia2/gyp
mtklein 1b6b626f9b nanobench: lazily decode bitmaps in .skps.
This cuts down on tool overhead when running something like recording only,
    $ out/Release/nanobench --match skp --config nonrendering
which doesn't usually ever need to decode the images.

The actual measurements for recording don't change, as the decode is not in the timed section.  It just skips irrelevant code, removing it from the profile and making the tool run faster.

This does, however, make a significant difference for playback speed.  Most skps draw faster with this patch, some slower.  I don't really have a good intuition for what's going on here.  There is a fixed clip acting as a viewport, so there are probably lots of images that don't ever need to be decoded.  Ideas?  Is this perhaps because we're now blitting from smaller, partially decoded source images?

~/skia (clean) $ compare clean.log lazy-decode-bitmaps.log
                   tabl_slashdot.skp_1	2.76ms -> 4.33ms	1.57x
               tabl_slashdot.skp_1_mpd	2.79ms -> 4.07ms	1.46x
                    tabl_sahadan.skp_1	3.41ms -> 4.87ms	1.43x
                 tabl_googleblog.skp_1	1.52ms -> 2.05ms	1.35x
               tabl_techmeme.skp_1_mpd	1.14ms -> 1.51ms	1.32x
               tabl_transformice.skp_1	2.61ms -> 3.43ms	1.31x
                tabl_sahadan.skp_1_mpd	3.54ms -> 4.48ms	1.26x
                   tabl_techmeme.skp_1	1.01ms -> 1.27ms	1.26x
                tabl_nytimes.skp_1_mpd	   1ms -> 1.23ms	1.23x
           tabl_worldjournal.skp_1_mpd	1.98ms -> 2.43ms	1.23x
                 tabl_pravda.skp_1_mpd	2.05ms -> 2.51ms	1.22x
           tabl_transformice.skp_1_mpd	2.75ms -> 3.19ms	1.16x
                    tabl_nytimes.skp_1	 874us -> 1.01ms	1.15x
                     tabl_pravda.skp_1	1.83ms -> 1.99ms	1.09x
               tabl_worldjournal.skp_1	1.76ms -> 1.91ms	1.09x
                desk_wowwiki.skp_1_mpd	 3.7ms ->  3.9ms	1.05x
                       tabl_digg.skp_1	3.99ms -> 4.16ms	1.04x
                  tabl_ukwsj.skp_1_mpd	   3ms -> 3.12ms	1.04x
                    desk_booking.skp_1	3.74ms -> 3.81ms	1.02x
    desk_googlespreadsheetdashed.skp_1	10.6ms -> 10.6ms	1x
                      tabl_ukwsj.skp_1	2.88ms -> 2.89ms	1x
desk_googlespreadsheetdashed.skp_1_mpd	11.8ms -> 11.8ms	1x
     desk_jsfiddlehumperclip.skp_1_mpd	 891us ->  888us	1x
          desk_googlespreadsheet.skp_1	4.65ms -> 4.62ms	0.99x
                  tabl_gspro.skp_1_mpd	1.97ms -> 1.94ms	0.99x
                desk_booking.skp_1_mpd	 4.1ms ->    4ms	0.98x
                     desk_carsvg.skp_1	18.2ms -> 17.7ms	0.97x
            desk_gmailthread.skp_1_mpd	2.81ms -> 2.73ms	0.97x
               desk_tigersvg.skp_1_mpd	19.5ms -> 18.9ms	0.97x
                     desk_mapsvg.skp_1	88.4ms -> 85.6ms	0.97x
                   tabl_cnet.skp_1_mpd	1.43ms -> 1.38ms	0.97x
             desk_jsfiddlebigcar.skp_1	1.26ms -> 1.22ms	0.96x
                        desk_gws.skp_1	1.87ms ->  1.8ms	0.96x
                   desk_linkedin.skp_1	2.07ms -> 1.98ms	0.96x
             tabl_deviantart.skp_1_mpd	 118ms ->  113ms	0.96x
                       tabl_cnet.skp_1	 1.2ms -> 1.14ms	0.95x
          tabl_androidpolice.skp_1_mpd	5.95ms -> 5.63ms	0.95x
                     desk_sfgate.skp_1	1.75ms -> 1.64ms	0.94x
                    desk_twitter.skp_1	  74ms -> 69.6ms	0.94x
                desk_youtube.skp_1_mpd	3.17ms -> 2.96ms	0.93x
                desk_gmailthread.skp_1	2.73ms -> 2.54ms	0.93x
            desk_silkfinance.skp_1_mpd	1.71ms -> 1.59ms	0.93x
         desk_jsfiddlebigcar.skp_1_mpd	1.45ms -> 1.35ms	0.93x
            desk_pokemonwiki.skp_1_mpd	2.72ms -> 2.51ms	0.92x
                    desk_gws.skp_1_mpd	2.14ms -> 1.98ms	0.92x
                 desk_googlehome.skp_1	 563us ->  517us	0.92x
                       desk_espn.skp_1	4.24ms -> 3.89ms	0.92x
          tabl_culturalsolutions.skp_1	12.7ms -> 11.6ms	0.91x
                 desk_sfgate.skp_1_mpd	1.91ms -> 1.74ms	0.91x
                       tabl_hsfi.skp_1	1.06ms ->  966us	0.91x
               desk_samoasvg.skp_1_mpd	10.5ms -> 9.47ms	0.91x
               desk_facebook.skp_1_mpd	 3.8ms -> 3.43ms	0.9x
                    desk_youtube.skp_1	3.52ms -> 3.14ms	0.89x
                   desk_ebay.skp_1_mpd	2.95ms -> 2.62ms	0.89x
                   desk_samoasvg.skp_1	10.9ms -> 9.66ms	0.89x
      desk_googlespreadsheet.skp_1_mpd	5.59ms -> 4.94ms	0.88x
                 desk_mapsvg.skp_1_mpd	 100ms -> 87.9ms	0.88x
                   desk_espn.skp_1_mpd	 4.7ms -> 4.12ms	0.88x
              desk_wordpress.skp_1_mpd	1.92ms -> 1.68ms	0.87x
                 tabl_deviantart.skp_1	 140ms ->  122ms	0.87x
           tabl_cuteoverload.skp_1_mpd	4.41ms -> 3.83ms	0.87x
                   desk_tigersvg.skp_1	19.6ms ->   17ms	0.87x
             tabl_googlecalendar.skp_1	4.01ms -> 3.44ms	0.86x
                    desk_blogger.skp_1	2.49ms -> 2.14ms	0.86x
             desk_chalkboard.skp_1_mpd	52.7ms ->   45ms	0.85x
                    desk_weather.skp_1	2.88ms -> 2.46ms	0.85x
                 desk_chalkboard.skp_1	  51ms -> 43.4ms	0.85x
               desk_yahooanswers.skp_1	2.74ms -> 2.32ms	0.85x
             desk_forecastio.skp_1_mpd	1.26ms -> 1.07ms	0.85x
              tabl_androidpolice.skp_1	5.18ms -> 4.34ms	0.84x
           desk_yahooanswers.skp_1_mpd	3.44ms -> 2.85ms	0.83x
                    tabl_cnn.skp_1_mpd	2.59ms -> 2.15ms	0.83x
                  desk_pinterest.skp_1	2.69ms -> 2.22ms	0.83x
                   tabl_hsfi.skp_1_mpd	 1.6ms -> 1.32ms	0.82x
      tabl_culturalsolutions.skp_1_mpd	13.8ms -> 11.3ms	0.82x
                desk_twitter.skp_1_mpd	76.6ms ->   63ms	0.82x
                       desk_ebay.skp_1	3.11ms -> 2.51ms	0.81x
                    tabl_mlb.skp_1_mpd	3.17ms -> 2.53ms	0.8x
                    tabl_mozilla.skp_1	2.42ms -> 1.91ms	0.79x
                desk_pokemonwiki.skp_1	2.84ms -> 2.22ms	0.78x
                 desk_carsvg.skp_1_mpd	23.3ms -> 17.8ms	0.77x
                    desk_wowwiki.skp_1	4.21ms -> 3.21ms	0.76x
                     desk_amazon.skp_1	 963us ->  728us	0.76x
              desk_css3gradients.skp_1	2.58ms -> 1.92ms	0.74x
               tabl_cuteoverload.skp_1	4.55ms -> 3.38ms	0.74x
                        tabl_cnn.skp_1	3.13ms -> 2.29ms	0.73x
             tabl_googleblog.skp_1_mpd	2.32ms ->  1.7ms	0.73x
                 desk_mobilenews.skp_1	3.65ms -> 2.61ms	0.71x
                 desk_googleplus.skp_1	3.76ms -> 2.66ms	0.71x
                tabl_mozilla.skp_1_mpd	2.88ms -> 2.03ms	0.71x
              desk_pinterest.skp_1_mpd	3.17ms -> 2.21ms	0.7x
          desk_css3gradients.skp_1_mpd	2.98ms -> 2.07ms	0.69x
                desk_silkfinance.skp_1	2.06ms -> 1.42ms	0.69x
                   desk_facebook.skp_1	 4.5ms -> 3.07ms	0.68x
             desk_mobilenews.skp_1_mpd	4.05ms -> 2.73ms	0.68x
                  desk_baidu.skp_1_mpd	2.73ms -> 1.81ms	0.66x
                desk_weather.skp_1_mpd	3.93ms ->  2.5ms	0.64x
                  desk_wordpress.skp_1	2.15ms -> 1.36ms	0.63x
             desk_googlehome.skp_1_mpd	1.02ms ->  605us	0.59x
                   desk_fontwipe.skp_1	 722us ->  402us	0.56x
               desk_fontwipe.skp_1_mpd	 897us ->  486us	0.54x
                      desk_baidu.skp_1	3.02ms ->  1.6ms	0.53x
                 desk_forecastio.skp_1	2.01ms ->  999us	0.5x
                 desk_amazon.skp_1_mpd	1.77ms ->  860us	0.49x

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/7e225bdb1f00ae4aed524ff8d0a61df3d3abb109

Review URL: https://codereview.chromium.org/743613005
2015-02-09 11:44:23 -08:00
..
android_deps.gyp Reland "Gyp file changes for the android framework." 2014-02-05 16:35:12 +00:00
android_framework_lib.gyp Updates to gyp files for building Android.mk 2014-02-28 16:07:39 +00:00
android_output.gyp Change how SkDebugf is sent to stdout on Android. 2014-12-10 10:23:06 -08:00
android_system.gyp Update DEPS and GYP to use the copy of Android in platform_tools. 2013-05-02 12:27:21 +00:00
angle.gyp Try to roll angle again. 2014-06-17 17:28:17 -04:00
animator.gyp rename SkDrawable to SkADrawable 2014-11-26 08:50:45 -08:00
apptype_console.gypi Change how SkDebugf is sent to stdout on Android. 2014-12-10 10:23:06 -08:00
bench.gyp nanobench: lazily decode bitmaps in .skps. 2015-02-09 11:44:23 -08:00
bench.gypi add bench for very big paths 2015-02-06 13:04:16 -08:00
canvas_state_lib.gyp Run CanvasState test across a library boundary. 2014-07-22 12:38:55 -07:00
chromeos_deps.gyp GYP Changes and Scripts for Compiling Skia for ChromeOS 2013-06-11 15:52:19 +00:00
common_conditions.gypi Build in C++11 mode on Unix-like bots. 2015-02-05 09:23:57 -08:00
common_variables.gypi WAE on Macs too. That leaves only Android framework builds. 2014-12-15 10:38:42 -08:00
common.gypi remove dead code for scalar type 2015-01-18 11:19:33 -08:00
core.gyp Cleanup the XML directory in public includes. 2014-11-14 05:52:50 -08:00
core.gypi Rename SkCanvasDrawable to SkDrawable, and make public 2015-02-06 08:36:15 -08:00
debugger.gyp debugger: Make draw command image widget resize 2014-12-30 23:03:56 -08:00
dm.gyp Revert of Make nanobench and dm be usable from Chromium build (patchset #5 id:80001 of https://codereview.chromium.org/657373002/) 2014-11-13 08:06:40 -08:00
dm.gypi Add SkSVGCanvas 2015-02-06 12:51:10 -08:00
effects.gyp Remove the comments settings for vim tab width and expansion variables. 2013-12-02 22:23:03 +00:00
effects.gypi Reland "remove unused SkAvoidXfermode" 2015-01-30 13:16:02 -08:00
etc1.gyp Simple PKM image decoder. 2014-05-22 18:40:29 +00:00
everything.gyp Cleanup: Delete webtry.gyp 2014-11-20 18:20:06 -08:00
example.gyp move HelloWorld to be a peer of SampleApp 2015-02-02 12:55:14 -08:00
experimental.gyp remove remaining parts of SkExample 2015-02-03 11:16:05 -08:00
FileReaderApp.gyp Remove the comments settings for vim tab width and expansion variables. 2013-12-02 22:23:03 +00:00
flags.gyp tool --help alphabetizes command line flags 2015-01-18 10:39:25 -08:00
freetype.gyp Clean up FreeType code for 2.3.8. 2014-11-21 13:18:34 -08:00
freetype.gypi Sanitizing source files in Housekeeper-Nightly 2013-08-21 07:01:29 +00:00
giflib.gyp Sanitizing source files in Housekeeper-Nightly 2014-02-25 03:05:18 +00:00
gmslides.gypi add new gm for SkPath::addArc() 2015-01-29 10:48:16 -08:00
gpu.gyp Apply the layer's image filter to the hoisted image 2014-12-11 08:20:31 -08:00
gpu.gypi Revert of Revert of Move DstCopy on gpu into the GrXferProcessor. (patchset #1 id:1 of https://codereview.chromium.org/901663007/) 2015-02-06 07:02:37 -08:00
gputest.gyp Cleanup GrContextFactory and make it's subclasses private 2014-11-13 11:12:41 -08:00
images.gyp add ImageGenerator::NewFromData to porting layer 2015-01-07 18:04:45 -08:00
iOSShell.gyp Revert of Fix build for iOS after "Make nanobench and dm be usable from Chromium build" (patchset #1 id:1 of https://codereview.chromium.org/716413003/) 2014-11-13 07:58:01 -08:00
jsoncpp.gyp Roll jsoncpp, drop dependency on Chromium overrides. 2014-08-19 07:21:00 -07:00
ktx.gyp Pass compressed blitters to our mask drawing algorithm 2014-08-07 08:15:14 -07:00
libjpeg.gyp Build Skia for a bare-bones embedded Linux system. 2014-02-24 20:22:34 +00:00
libpng.gyp Build Skia for a bare-bones embedded Linux system. 2014-02-24 20:22:34 +00:00
libwebp.gyp Build in C++11 mode on Macs. 2015-02-03 13:24:36 -08:00
lua.gyp Build Skia for a bare-bones embedded Linux system. 2014-02-24 20:22:34 +00:00
most.gyp move HelloWorld to be a peer of SampleApp 2015-02-02 12:55:14 -08:00
nacl.gyp Prepare skia for shared library build on android 2013-06-03 12:10:19 +00:00
nanomsg.gyp Silence warnings from libnanomsg on Mac like we do on Linux. 2014-12-15 12:24:47 -08:00
opts.gyp Split src/opts source lists out of opts.gyp. 2015-01-26 18:55:58 -08:00
opts.gypi Revert of Revert of SSE4 opaque blend using intrinsics instead of assembly. (patchset #1 id:1 of https://codereview.chromium.org/873553003/) 2015-02-02 10:02:48 -08:00
pathops_skpclip.gyp Turn SkTaskGroups back on. 2014-11-03 17:41:08 -08:00
pathops_unittest.gyp Turn SkTaskGroups back on. 2014-11-03 17:41:08 -08:00
pathops_unittest.gypi These tests stress pathops by describing the union of circle-like paths that have tiny line segments embedded and double back to create near-coincident conditions. 2014-11-13 06:58:52 -08:00
pathops.gypi path ops work in progress 2013-09-16 15:55:01 +00:00
pdf.gyp revert buildbot breaker 2015-01-07 07:36:52 -08:00
pdf.gypi SkPDFCanon 2015-01-21 09:59:14 -08:00
pdfviewer_lib.gyp move some headers out of public 2014-06-17 09:04:45 -07:00
pdfviewer.gyp Remove the comments settings for vim tab width and expansion variables. 2013-12-02 22:23:03 +00:00
poppler.gyp Since we're only using it on Linux now, just require poppler as a system dependency. 2014-05-20 15:07:53 +00:00
ports.gyp Move sync code to include/, switch from using platform define to a proxy header in core/ 2015-01-21 13:13:31 -08:00
SampleApp.gyp migrate more samples over to SkAnimTImer 2015-02-05 22:02:37 -08:00
sfnt.gyp Better rendering detection with DirectWrite. 2014-06-23 08:29:23 -07:00
SimpleCocoaApp.gyp Remove the comments settings for vim tab width and expansion variables. 2013-12-02 22:23:03 +00:00
SimpleiOSApp.gyp get iOS building again 2014-04-05 01:13:43 +00:00
skflate.gyp Build Skia for a bare-bones embedded Linux system. 2014-02-24 20:22:34 +00:00
skia_for_android_framework_defines.gypi remove unnecessary guard flags for android (for conics) 2015-01-22 13:41:00 -08:00
skia_for_chromium_defines.gypi remove flags that are now in chrome's SkUserConfig.h 2015-01-08 10:20:05 -08:00
skia_launcher.gyp Move BenchTimer to tools as Timer 2014-06-20 11:29:21 -07:00
skia_lib.gyp Split src/opts source lists out of opts.gyp. 2015-01-26 18:55:58 -08:00
svg.gyp Add SkSVGCanvas 2015-02-06 12:51:10 -08:00
tests.gypi Remove GrBinHashKey 2015-01-23 06:46:16 -08:00
tools.gyp Add SkSVGCanvas 2015-02-06 12:51:10 -08:00
utils.gyp Cleanup the XML directory in public includes. 2014-11-14 05:52:50 -08:00
utils.gypi Remove SkProxyCanvas. 2015-01-29 11:58:51 -08:00
v8.gyp SkV8Sample: Now with Path2D and Path2DBuilder. 2014-10-29 05:33:28 -07:00
views_animated.gyp Remove dependency of views on angle 2014-04-29 00:38:39 +00:00
views.gyp First cut at cleaning up Sergio's example code and moving some common code to SkWindow. 2015-01-30 12:37:02 -08:00
xml.gyp Cleanup the XML directory in public includes. 2014-11-14 05:52:50 -08:00
xps.gyp Remove the comments settings for vim tab width and expansion variables. 2013-12-02 22:23:03 +00:00
zlib.gyp Fix valgrind bot errors introduced in f84722e477. 2014-02-25 18:01:37 +00:00