aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkLiteDL.h
Commit message (Collapse)AuthorAge
* Revert[2] "remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS"Gravatar Mike Reed2016-12-09
| | | | | | | | | | | This reverts commit a129dfef2aaab0b5995cdf1ab7b2cdd41c29cf72. BUG=skia: Change-Id: I717de6e5fcd4516aa684b014b1414b0f82ac2b91 Reviewed-on: https://skia-review.googlesource.com/5722 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Derek Sollenberger <djsollen@google.com>
* Revert "remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS"Gravatar Mike Reed2016-12-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 8e7432b7f98dd592e529a0c8bb038d73ebfb0478. Reason for revert: <INSERT REASONING HERE> external/skia/bench/../tools/android/SkAndroidSDKCanvas.h:103:36: error: C++ requires a type specifier for all declarations void onClipRect(const SkRect&, ClipOp, ClipEdgeStyle) override; Original change's description: > remove SK_SUPPORT_LEGACY_CLIP_REGIONOPS > > > switch over to SkClipOps now that SK_SUPPORT_LEGACY_CLIP_REGIONOPS is gone > > BUG=skia: > > Change-Id: Ifdc8b3746d508348a40cc009a4e529a1cb3c405d > Reviewed-on: https://skia-review.googlesource.com/5714 > Commit-Queue: Mike Reed <reed@google.com> > Reviewed-by: Mike Reed <reed@google.com> > TBR=reed@google.com,reviews@skia.org BUG=skia: NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: If26ea91d7464615e43c1d3d2f726e337ff56b55c Reviewed-on: https://skia-review.googlesource.com/5721 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Reed <reed@google.com>
* remove SK_SUPPORT_LEGACY_CLIP_REGIONOPSGravatar Mike Reed2016-12-08
| | | | | | | | | | | switch over to SkClipOps now that SK_SUPPORT_LEGACY_CLIP_REGIONOPS is gone BUG=skia: Change-Id: Ifdc8b3746d508348a40cc009a4e529a1cb3c405d Reviewed-on: https://skia-review.googlesource.com/5714 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Reed <reed@google.com>
* remove unused code around SK_SUPPORT_LEGACY_XFERMODE_PARAMGravatar Mike Reed2016-11-03
| | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4384 Change-Id: I5121acd027d935ade169ff65941f29f654a47bd0 Reviewed-on: https://skia-review.googlesource.com/4384 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* remove xfermode from public apiGravatar Mike Reed2016-10-28
| | | | | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4020 CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Change-Id: I19cd056f2af778f10e8c6c2b7b2735593b43dbac Reviewed-on: https://skia-review.googlesource.com/4020 Reviewed-by: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* SkLiteDL: much simpler to eliminate bitmaps in recorder.Gravatar Mike Klein2016-10-04
| | | | | | | | | | | | | | This shouldn't be any significant change in behavior or performance, but it leaves the code in SkLiteDL a bit simpler. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2863 Change-Id: Ifb0023d56f7e9dae172d8021fb956b8fc9281b15 Reviewed-on: https://skia-review.googlesource.com/2863 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Add setBounds to SkLiteDL for AndroidGravatar liyuqian2016-09-21
| | | | | | | | | | The RootRenderNode in Android is changing bounds dynamically. This is a temporary fix to accomodate that behaviour. (See also b/31304115) BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2358793002 Review-Url: https://codereview.chromium.org/2358793002
* abstract name of clipping ops, to transtion to a more restricted setGravatar reed2016-09-20
| | | | | | | | | | | SkRegion::Op --> SkCanvas::ClipOp (alias) --> SkClipOp pre-CL needed in chrome : https://codereview.chromium.org/2355583002/ BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2355483002 Review-Url: https://codereview.chromium.org/2355483002
* SkLiteDL: drawAsLayer()Gravatar mtklein2016-09-08
| | | | | | | | | This more or less the API you were thinking? BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2315283002 Review-Url: https://codereview.chromium.org/2315283002
* record drawfiltersGravatar reed2016-09-02
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2303033002 Review-Url: https://codereview.chromium.org/2303033002
* Add drawRegion() API to SkCanvasGravatar msarett2016-08-25
| | | | | | | | | | | | | | This will allow us to optimize for the RectGrid macrobench. Currently, SkiaGL is much slower than OpenGL. SkiaGL 12 items/s OpenGL 160 items/s This contains everything except for the fast implementation on GPU. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2277053002 Review-Url: https://codereview.chromium.org/2277053002
* Made shadows blurry (thru implementing variance mapping)Gravatar vjiaoblack2016-08-25
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2224163005 Review-Url: https://codereview.chromium.org/2224163005
* Plumb drawArc to SkDevice.Gravatar bsalomon2016-08-19
| | | | | | | | | Plumbs the drawArc canvas method down to SkDevice without converting to a path. Plumbs through the various recording canvas classes. BUG=skia:5227 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2257023003 Review-Url: https://codereview.chromium.org/2257023003
* Fast path translate() in SkCanvas and SkLiteDL.Gravatar mtklein2016-08-19
| | | | | | | | | | | | | | | | | | | | | | | This adds didTranslate() so that SkLiteDL (and other canvas recorders) can record the translate rather than the full concat. It also adds a case to SkMatrix::preTranslate() to fast path translate x translate -> translate (i.e. +=). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2255283002 Committed: https://skia.googlesource.com/skia/+/5fa47f4fd13b3158de4599414c86d17649c2dd1c Misc bots failing in pictureimagefilter replay modes. https://luci-milo.appspot.com/swarming/task/30b8e53f3a1f4f10/steps/dm/0/stdout Problem is FMA vs. not. CQ_INCLUDE_TRYBOTS=master.client.skia: Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-Fast-Trybot Review-Url: https://codereview.chromium.org/2255283002
* Revert of Fast path translate() in SkCanvas and SkLiteDL. (patchset #5 ↵Gravatar mtklein2016-08-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | id:80001 of https://codereview.chromium.org/2255283002/ ) Reason for revert: speculative Original issue's description: > Fast path translate() in SkCanvas and SkLiteDL. > > This adds didTranslate() so that SkLiteDL (and other canvas recorders) > can record the translate rather than the full concat. > > It also adds a case to SkMatrix::preTranslate() to fast path > translate x translate -> translate (i.e. +=). > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2255283002 > > Committed: https://skia.googlesource.com/skia/+/5fa47f4fd13b3158de4599414c86d17649c2dd1c TBR=herb@google.com,reed@google.com,mtklein@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review-Url: https://codereview.chromium.org/2264433002
* Fast path translate() in SkCanvas and SkLiteDL.Gravatar mtklein2016-08-18
| | | | | | | | | | | | | This adds didTranslate() so that SkLiteDL (and other canvas recorders) can record the translate rather than the full concat. It also adds a case to SkMatrix::preTranslate() to fast path translate x translate -> translate (i.e. +=). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2255283002 Review-Url: https://codereview.chromium.org/2255283002
* SkLiteDL: a little spring cleaningGravatar mtklein2016-08-17
| | | | | | | | | | | | | | | - kill off optimizeFor() now that we know it's broken and have a better way; - simplify makeThreadsafe() a bit: we're not calling it anyway. This sort of earns me back some crazy code currency, which I am going to try to spend making reset() faster. If anything, this appears to make makeThreadsafe() _faster_. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2254913002 Review-Url: https://codereview.chromium.org/2254913002
* SkLiteDL: inline empty()Gravatar mtklein2016-08-17
| | | | | | | | | | | 1.85% 1.85% RenderThread 6458 6475 /system/lib64/libskia.so SkLiteDL::empty() const :/ BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2254823002 Review-Url: https://codereview.chromium.org/2254823002
* SkLiteDL: thread the original canvas matrix through for SetMatrix::Draw().Gravatar mtklein2016-08-16
| | | | | | | | | | | | | | | The SkLiteDL is recorded in some identity space (imagine, SkMatrix::I()), but played back in a different one (here named SkMatrix original). Any calls to setMatrix() need to be made relative to this new space. All other ops already operate in relative coordinates. This should let us not fiddle with setMatrix(). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2247353003 Review-Url: https://codereview.chromium.org/2247353003
* SkLiteDL: remove freelisting, add reset() and SKLITEDL_PAGE knob.Gravatar mtklein2016-08-16
| | | | | | | | | | | | We think Android can cache these better than a global freelist allows. This removes the freelisting but adds reset() to allow reuse. I took the opportunity to abstract 4096 as a define SKLITEDL_PAGE. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2248693004 Review-Url: https://codereview.chromium.org/2248693004
* Add onDrawBitmapLattice(), avoid unnecessary bitmap->image copyGravatar msarett2016-08-16
| | | | | | | | | | | | | out/Release/nanobench --match Lattice --config gpu --ms 3000 3.42ms -> 17.2us For reference, a loop over drawBitmapRects (which is what Android currently does) is about 13us. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2205273003 Review-Url: https://codereview.chromium.org/2205273003
* just add SkLiteDL::empty()Gravatar mtklein2016-08-15
| | | | | | | | | TBR=djsollen@google.com BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2249713002 Review-Url: https://codereview.chromium.org/2249713002
* SkLiteDL: turn vtable sidewaysGravatar mtklein2016-08-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Revert of SkLiteDL: turn vtable sideways (patchset #7 id:120001 of ↵Gravatar reed2016-08-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/2231103002/ ) Reason for revert: speculative revert to fix DEPS roll Original issue's description: > 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 TBR=mtklein@google.com,mtklein@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review-Url: https://codereview.chromium.org/2232183002
* SkLiteDL: turn vtable sidewaysGravatar mtklein2016-08-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Review-Url: https://codereview.chromium.org/2231103002
* allocate memory manually in SkLiteDLGravatar mtklein2016-08-09
| | | | | | | | | | | | | | | | | Instead of growing at SkTDArray's chosen rate (+4, then *1.25), grow in additive 4K pages. This is my attempt to make realloc() have the best chance of not copying and to keep fragmentation down. Because we use a freelist the rate we grow doesn't affect performance too much. I'm not getting very reliable numbers, but this looks maybe 5-10% faster for recording, mainly I think from inlining the allocation fast path into push(). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2231553002 Review-Url: https://codereview.chromium.org/2231553002
* Purge the SkLiteDL freelist when PurgeAllCaches() is called.Gravatar mtklein2016-08-09
| | | | | | | | | Seems like the polite thing to do. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2228953002 Review-Url: https://codereview.chromium.org/2228953002
* SkLiteDL: control reuse by a single parameterGravatar mtklein2016-08-08
| | | | | | | | | | | | | | | | This simply caps the number of times a display list can be reused. As this number goes up, the average amount of memory we cache goes up and the expected number of mallocs per SkLiteDL::New() goes down. This strategy does not need a hard-coded cap on how many display lists to cache, or how big they can grow. TBR=herb@google.com BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2226813002 Review-Url: https://codereview.chromium.org/2226813002
* finish SkLiteDLGravatar mtklein2016-08-07
| | | | | | | | | | | | | - makeThreadsafe() - fix up some alignment problems - drawVertices / drawPatch - work around drawPicture() + default paint bugs? - turn on tests. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2219343002 Review-Url: https://codereview.chromium.org/2219343002
* SkLiteDL, very nearly the restGravatar mtklein2016-08-07
| | | | | | | | | | | | | fix saveLayer bounds all the misc calls a bit of refactoring just drawVertices and drawPatch to go, plus some todos and likely bug fixes BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2226563002 Review-Url: https://codereview.chromium.org/2226563002
* SkLiteDL: closing inGravatar mtklein2016-08-06
| | | | | | | | | | | - optimizeFor(GrContext*) - images - basic text BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2224753002 Review-Url: https://codereview.chromium.org/2224753002
* flesh out more of SkLiteDL:Gravatar mtklein2016-08-06
| | | | | | | | | save layer, clips, simple draws BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2226513002 Review-Url: https://codereview.chromium.org/2226513002
* SkLite*Gravatar mtklein2016-08-06
SkLiteRecorder, a new SkCanvas, fills out SkLiteDL, a new SkDrawable. This SkDrawable is a display list similar to SkRecord and SkBigPicture / SkRecordedDrawable, but with a few new design points inspired by Android and slimming paint: 1) SkLiteDL is structured as one big contiguous array rather than the two layer structure of SkRecord. This trades away flexibility and large-op-count performance for better data locality for small to medium size pictures. 2) We keep a global freelist of SkLiteDLs, both reusing the SkLiteDL struct itself and its contiguous byte array. This keeps the expected number of mallocs per display list allocation <1 (really, ~0) for cyclical use cases. These two together mean recording is faster. Measuring against the code we use at head, SkLiteRecorder trends about ~3x faster across various size pictures, matching speed at 0 draws and beating the special-case 1-draw pictures we have today. (I.e. we won't need those special case implementations anymore, because they're slower than this new generic code.) This new strategy records 10 drawRects() in about the same time the old strategy took for 2. This strategy stays the winner until at least 500 drawRect()s on my laptop, where I stopped checking. A simpler alternative to freelisting is also possible (but not implemented here), where we allow the client to manually reset() an SkLiteDL for reuse when its refcnt is 1. That's essentially what we're doing with the freelist, except tracking what's available for reuse globally instead of making the client do it. This code is not fully capable yet, but most of the key design points are there. The internal structure of SkLiteDL is the area I expect to be most volatile (anything involving Op), but its interface and the whole of SkLiteRecorder ought to be just about done. You can run nanobench --match picture_overhead as a demo. Everything it exercises is fully fleshed out, so what it tests is an apples-to-apples comparison as far as recording costs go. I have not yet compared playback performance. It should be simple to wrap this into an SkPicture subclass if we want. I won't start proposing we replace anything old with anything new quite yet until I have more ducks in a row, but this does look pretty promising (similar to the SkRecord over old SkPicture change a couple years ago) and I'd like to land, experiment, iterate, especially with an eye toward Android. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2213333002 Review-Url: https://codereview.chromium.org/2213333002