aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPictureFlat.h
Commit message (Collapse)AuthorAge
* use SkTDynamicHash in picture recordingGravatar mtklein@google.com2013-08-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cleaned up SkPictureFlat.h quite a bit while working on this. bench --match picture_record_ shows some improvement: compare.sh bench --match picture_record_ --repeat 100 master -> usehash N=3 p=0.001000 (corrected to 0.000333) sig? rel. speed bench y 1.0x picture_record_dictionaries y 1.5x picture_record_recurring_paint_dictionary y 3.8x picture_record_unique_paint_dictionary Overall relative speed: 1.9x bench_pictures --record is pretty much neutral: compare.sh bench_pictures -r ../skp --mode record --repeat 30 master -> usehash N=63 p=0.001000 (corrected to 0.000016) sig? rel. speed bench n 0.9x desk_pokemonwiki.skp y 0.9x desk_googlespreadsheet.skp y 0.9x tabl_pravda.skp y 1.0x desk_googlespreadsheetdashed.skp n 1.0x tabl_onlinewsj.skp n 1.0x tabl_nytimes.skp n 1.0x desk_googlehome.skp y 1.0x desk_techcrunch.skp n 1.0x tabl_slashdot.skp n 1.0x tabl_techmeme.skp n 1.0x desk_googleplus.skp n 1.0x desk_sfgate.skp n 1.0x tabl_transformice.skp n 1.0x desk_espn.skp n 1.0x desk_baidu.skp n 1.0x tabl_worldjournal.skp n 1.0x desk_chalkboard.skp n 1.0x tabl_frantzen.skp n 1.0x desk_gws.skp n 1.0x tabl_androidpolice.skp n 1.0x desk_linkedin.skp n 1.0x mobi_wikipedia.skp n 1.0x desk_wowwiki.skp n 1.0x desk_css3gradients.skp n 1.0x desk_gmailthread.skp n 1.0x desk_yahoogames.skp n 1.0x desk_facebook.skp n 1.0x desk_wordpress.skp n 1.0x tabl_vnexpress.skp n 1.0x desk_br337.skp n 1.0x tabl_engadget.skp n 1.0x tabl_theverge.skp n 1.0x desk_amazon.skp n 1.0x desk_ebay.skp n 1.0x tabl_hsfi.skp n 1.0x tabl_sahadan.skp n 1.0x desk_weather.skp n 1.0x tabl_digg.skp n 1.0x desk_youtubetvbrowse.skp n 1.0x tabl_culturalsolutions.skp n 1.0x tabl_ukwsj.skp n 1.0x desk_youtube.skp n 1.0x tabl_googlecalendar.skp y 1.0x desk_yahooanswers.skp n 1.0x desk_blogger.skp n 1.0x desk_yahoonews.skp y 1.0x desk_yahoosports.skp y 1.0x tabl_mercurynews.skp n 1.0x desk_youtubetvvideo.skp y 1.0x tabl_gspro.skp y 1.1x tabl_googleblog.skp y 1.1x tabl_cnet.skp y 1.1x tabl_mlb.skp y 1.1x tabl_cuteoverload.skp y 1.1x desk_booking.skp y 1.1x tabl_deviantart.skp y 1.1x desk_twitter.skp y 1.1x tabl_cnn.skp y 1.1x tabl_gamedeksiam.skp y 1.1x tabl_gmail.skp y 1.1x tabl_nofolo.skp y 1.1x tabl_mozilla.skp y 1.1x desk_pinterest.skp Overall relative speed: 1.0x (I'd take this to mean that the microbenches are probably drifting away from relevance.) BUG= R=reed@google.com Review URL: https://codereview.chromium.org/21564008 git-svn-id: http://skia.googlecode.com/svn/trunk@10825 2bbb7eff-a529-9590-31e7-b0007b416f81
* + ,fLastAllocated(NULL)Gravatar commit-bot@chromium.org2013-07-30
| | | | | | | | | | | BUG= R=scroggo@google.com Author: mtklein@google.com Review URL: https://chromiumcodereview.appspot.com/21046011 git-svn-id: http://skia.googlecode.com/svn/trunk@10446 2bbb7eff-a529-9590-31e7-b0007b416f81
* Start from scratch on a faster SkFlatDictionary.Gravatar commit-bot@chromium.org2013-07-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is like codereview.chromium.org/19276003, except it fits in better with the existing code, doesn't leak memory, and because it's back using SkChunkFlatController it's a little faster too, now a win across the board: Slowdown bench -1.59% desk_youtubetvbrowse.skp -2.56% desk_googlehome.skp -6.40% tabl_androidpolice.skp -6.45% desk_youtubetvvideo.skp -6.91% tabl_googlecalendar.skp ... -29.70% desk_yahoogames.skp -32.17% desk_googlespreadsheet.skp -32.23% mobi_wikipedia.skp -37.16% desk_chalkboard.skp -41.57% desk_pokemonwiki.skp Overall slowdown: -22.74% running bench [640 480] picture_record_recurring_paint_dictionary NONRENDERING: cmsecs = 9.92 running bench [640 480] picture_record_unique_paint_dictionary NONRENDERING: cmsecs = 22.16 running bench [640 480] picture_record_dictionaries NONRENDERING: cmsecs = 9.18 BUG= Committed: http://code.google.com/p/skia/source/detail?r=10328 R=tomhudson@google.com, reed@google.com, scroggo@google.com Author: mtklein@google.com Review URL: https://chromiumcodereview.appspot.com/19564007 git-svn-id: http://skia.googlecode.com/svn/trunk@10336 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "Start from scratch on a faster SkFlatDictionary."Gravatar mtklein@google.com2013-07-24
| | | | | | This reverts commit fec9bfa02d5d2b27bfa2dad3e37e5825a720784d. git-svn-id: http://skia.googlecode.com/svn/trunk@10331 2bbb7eff-a529-9590-31e7-b0007b416f81
* Start from scratch on a faster SkFlatDictionary.Gravatar commit-bot@chromium.org2013-07-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is like codereview.chromium.org/19276003, except it fits in better with the existing code, doesn't leak memory, and because it's back using SkChunkFlatController it's a little faster too, now a win across the board: Slowdown bench -1.59% desk_youtubetvbrowse.skp -2.56% desk_googlehome.skp -6.40% tabl_androidpolice.skp -6.45% desk_youtubetvvideo.skp -6.91% tabl_googlecalendar.skp ... -29.70% desk_yahoogames.skp -32.17% desk_googlespreadsheet.skp -32.23% mobi_wikipedia.skp -37.16% desk_chalkboard.skp -41.57% desk_pokemonwiki.skp Overall slowdown: -22.74% running bench [640 480] picture_record_recurring_paint_dictionary NONRENDERING: cmsecs = 9.92 running bench [640 480] picture_record_unique_paint_dictionary NONRENDERING: cmsecs = 22.16 running bench [640 480] picture_record_dictionaries NONRENDERING: cmsecs = 9.18 BUG= R=tomhudson@google.com, reed@google.com, scroggo@google.com Author: mtklein@google.com Review URL: https://chromiumcodereview.appspot.com/19564007 git-svn-id: http://skia.googlecode.com/svn/trunk@10328 2bbb7eff-a529-9590-31e7-b0007b416f81
* First pass at Comment APIGravatar robertphillips@google.com2013-05-29
| | | | | | | | https://codereview.chromium.org/13957009/ git-svn-id: http://skia.googlecode.com/svn/trunk@9310 2bbb7eff-a529-9590-31e7-b0007b416f81
* One SkTSearch to rule them all. Allow key to be of different type than the ↵Gravatar bsalomon@google.com2013-05-17
| | | | | | | | | | array. R=bungeman@google.com Review URL: https://codereview.chromium.org/15070011 git-svn-id: http://skia.googlecode.com/svn/trunk@9182 2bbb7eff-a529-9590-31e7-b0007b416f81
* Refactor PictureRecord optimization & added ↵Gravatar robertphillips@google.com2013-03-12
| | | | | | | | | | saveLayer/save/clipR/DBM*/restore/restore optimization https://codereview.appspot.com/7485043/ git-svn-id: http://skia.googlecode.com/svn/trunk@8106 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2013-03-11
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8061 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add a map from index to SkFlatData* in SkFlatDictionaryGravatar robertphillips@google.com2013-03-10
| | | | | | | | https://codereview.appspot.com/7531043/ git-svn-id: http://skia.googlecode.com/svn/trunk@8060 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2013-03-02
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7939 2bbb7eff-a529-9590-31e7-b0007b416f81
* Reland r7918 & r7916Gravatar robertphillips@google.com2013-03-01
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7931 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert r7918 & r7916 due to Linux rendering issuesGravatar robertphillips@google.com2013-03-01
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7925 2bbb7eff-a529-9590-31e7-b0007b416f81
* Collapse saveLayer/drawBitmapRect/restore trios to drawBitmapRect when possibleGravatar robertphillips@google.com2013-03-01
| | | | | | | | https://codereview.appspot.com/7387045/ git-svn-id: http://skia.googlecode.com/svn/trunk@7916 2bbb7eff-a529-9590-31e7-b0007b416f81
* Make SkTDArray accessors const-friendly.Gravatar commit-bot@chromium.org2013-02-28
| | | | | | | | This change creates const and non-const versions of SkTDArray::begin(), end(), operator[]() and getAt(). This will keep us from inadvertently changing a const SkTDArray, which the previous signatures allowed. Review URL: https://chromiumcodereview.appspot.com/12315131 git-svn-id: http://skia.googlecode.com/svn/trunk@7902 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add NOOP "command" to picture formatGravatar robertphillips@google.com2013-02-15
| | | | | | | | https://codereview.appspot.com/7343044/ git-svn-id: http://skia.googlecode.com/svn/trunk@7752 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix errors when compiling with -Wall -Werror on Android.Gravatar djsollen@google.com2013-02-07
| | | | | | | | This CL also turns those features on by default on Android Review URL: https://codereview.appspot.com/7313049 git-svn-id: http://skia.googlecode.com/svn/trunk@7645 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fixing invalid text clipping on SkPicture playbackGravatar junov@chromium.org2013-01-22
| | | | | | | | | | | | | | | The bug was caused by an invalid assumption that a flattend object's index is related to its array index in SkFlatDictionary::fData. The data in SkFlatDictionary is sorted by flattened data content, not by index number. Problem was solved by passing down the SkFlatData* through addPaint, rather than the index value. The bug was causing SkPictureRecord::addFontMetricsTopBottom to use cached font metrics from the wrong SkPaint instance. BUG=https://code.google.com/p/chromium/issues/detail?id=170964 Review URL: https://codereview.appspot.com/7178045 git-svn-id: http://skia.googlecode.com/svn/trunk@7312 2bbb7eff-a529-9590-31e7-b0007b416f81
* Don't die when there are no fonts available.Gravatar bungeman@google.com2013-01-17
| | | | | | | https://codereview.appspot.com/7147044/ git-svn-id: http://skia.googlecode.com/svn/trunk@7265 2bbb7eff-a529-9590-31e7-b0007b416f81
* revert 6766, thereby re-landing 6762-6763 now that the bots are readyGravatar reed@google.com2012-12-12
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@6770 2bbb7eff-a529-9590-31e7-b0007b416f81
* revert 6762-6763, since those require new skps to be generated, and we can'tGravatar reed@google.com2012-12-12
| | | | | | | | do that immediately right now... will re-submit when we can. git-svn-id: http://skia.googlecode.com/svn/trunk@6766 2bbb7eff-a529-9590-31e7-b0007b416f81
* make RRect and Oval first-class drawing primitives in SkCanvas.Gravatar reed@google.com2012-12-12
| | | | | | | add RRect as a first-class clip primitive. Review URL: https://codereview.appspot.com/6923058 git-svn-id: http://skia.googlecode.com/svn/trunk@6762 2bbb7eff-a529-9590-31e7-b0007b416f81
* cache fontmetrics in picture-recordGravatar reed@google.com2012-12-07
| | | | | | Review URL: https://codereview.appspot.com/6908049 git-svn-id: http://skia.googlecode.com/svn/trunk@6706 2bbb7eff-a529-9590-31e7-b0007b416f81
* In SkBitmapHeap, defer adding owners for new bitmaps.Gravatar scroggo@google.com2012-11-16
| | | | | | | | | | | | | | | | | | | | | | When using an SkFlatDictionary to flatten shaders, the dictionary can try to insert a duplicate bitmap shader that uses a bitmap which has been removed from the bitmap heap. This change was originally suggested by junov in https://codereview.appspot.com/6713048/. Add a test to verify that deferring the owners works. Without the change to bitmap heap the test would fail (and crash in debug mode). Also remove an unused function from SkFlatDictionary. BUG=http://code.google.com/p/chromium/issues/detail?id=143923 Review URL: https://codereview.appspot.com/6842051 git-svn-id: http://skia.googlecode.com/svn/trunk@6471 2bbb7eff-a529-9590-31e7-b0007b416f81
* re-re-land 5578Gravatar reed@google.com2012-09-18
| | | | | | | | will follow w/ new .skp files to keep the waterfall green (I hope) git-svn-id: http://skia.googlecode.com/svn/trunk@5584 2bbb7eff-a529-9590-31e7-b0007b416f81
* revert 5580Gravatar reed@google.com2012-09-18
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@5581 2bbb7eff-a529-9590-31e7-b0007b416f81
* re-land 5578 w/ pipe fixGravatar reed@google.com2012-09-18
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@5580 2bbb7eff-a529-9590-31e7-b0007b416f81
* revert 5578 -- broke pipeGravatar reed@google.com2012-09-18
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@5579 2bbb7eff-a529-9590-31e7-b0007b416f81
* Change drawBitmapRect to take a float-src-rect instead of integer-src-rect. ThisGravatar reed@google.com2012-09-18
| | | | | | | | | | | | | | | | | | allows the client more control over the scaling. Because of virtual overrides and wanting to keep the old call-sites up and running, this CL renames the virtual entry-point to drawBitmapRectToRect, and downgrades drawBitmapRect to a non-virtual helper function. The implementation is to use the float-rect for computing the matrix, but still cons-up an integer rect for the purposes of subsetting the original bitmap. We do this by calling float_src->roundOut(&int_src) so that we include all (partially) covered src pixels. No change needed on SkDevice, since that signature is explicitly passed the computed matrix. Review URL: https://codereview.appspot.com/6501140 git-svn-id: http://skia.googlecode.com/svn/trunk@5578 2bbb7eff-a529-9590-31e7-b0007b416f81
* peephole optimize save/restore brackets that contain no draw calls.Gravatar reed@google.com2012-08-30
| | | | | | Review URL: https://codereview.appspot.com/6443149 git-svn-id: http://skia.googlecode.com/svn/trunk@5347 2bbb7eff-a529-9590-31e7-b0007b416f81
* Result of running tools/sanitize_source_files.py (which was added in ↵Gravatar rmistry@google.com2012-08-23
| | | | | | | | | https://codereview.appspot.com/6465078/) This CL is part I of IV (I broke down the 1280 files into 4 CLs). Review URL: https://codereview.appspot.com/6485054 git-svn-id: http://skia.googlecode.com/svn/trunk@5262 2bbb7eff-a529-9590-31e7-b0007b416f81
* Extended Inst counting to find "unknown" leaked object (SkTMaskGamma)Gravatar robertphillips@google.com2012-08-16
| | | | | | | | http://codereview.appspot.com/6453127/ git-svn-id: http://skia.googlecode.com/svn/trunk@5123 2bbb7eff-a529-9590-31e7-b0007b416f81
* Move write buffer flags used by SkFlataData::Create into SkFlatController.Gravatar scroggo@google.com2012-08-14
| | | | | | Review URL: https://codereview.appspot.com/6446135 git-svn-id: http://skia.googlecode.com/svn/trunk@5091 2bbb7eff-a529-9590-31e7-b0007b416f81
* refactor some subclasses in SkFlattenable.h into SkPtrRecorder.h, in ↵Gravatar mike@reedtribe.org2012-08-12
| | | | | | | | | | preparation for privatizing SkPtrRecorder.h git-svn-id: http://skia.googlecode.com/svn/trunk@5046 2bbb7eff-a529-9590-31e7-b0007b416f81
* Refactor Bitmap Storage for SkPicture using SkPipe's design.Gravatar djsollen@google.com2012-08-07
| | | | | | | | | | | | | | | | | | | | | Refactor Picture and Pipe bitmap storage into common data structure Update SkFlattenable buffers to be more modular. This CL is an effort to stage the conversion to named parameters for all SkFlattenable commands. This particular stage only does the following two things... 1. Move flattenable buffers from SkFlattenable.h into their own header. 2. Update and Add new read write methods for better clarity and convenience. BUG= Review URL: https://codereview.appspot.com/6445079 git-svn-id: http://skia.googlecode.com/svn/trunk@4994 2bbb7eff-a529-9590-31e7-b0007b416f81
* Update SkFlattenable buffers to be more modular.Gravatar djsollen@google.com2012-08-07
| | | | | | | | | | | | | | | | | This CL is an effort to stage the conversion to named parameters for all SkFlattenable commands. This particular stage only does the following two things... 1. Move flattenable buffers from SkFlattenable.h into their own header. 2. Update and Add new read write methods for better clarity and convenience. BUG= Review URL: https://codereview.appspot.com/6448095 git-svn-id: http://skia.googlecode.com/svn/trunk@4980 2bbb7eff-a529-9590-31e7-b0007b416f81
* Store more behavior of SkFlatDictionary in SkFlatController.Gravatar scroggo@google.com2012-08-02
| | | | | | | | Code refactoring for simplicity. Review URL: https://codereview.appspot.com/6427046 git-svn-id: http://skia.googlecode.com/svn/trunk@4929 2bbb7eff-a529-9590-31e7-b0007b416f81
* Pipe factory names independently from the flattenables using them.Gravatar scroggo@google.com2012-08-01
| | | | | | | | | | | | | | | | Avoids an issue where a flattenable written twice might be written differently (the first time the flat data may have a name, whereas the second time it will have an index). Also add a test which confirms that identical flattenables will have the same SkFlatData representation. BUG=https://code.google.com/p/skia/issues/detail?id=721 TEST=FlatDataTest.cpp Review URL: https://codereview.appspot.com/6431057 git-svn-id: http://skia.googlecode.com/svn/trunk@4896 2bbb7eff-a529-9590-31e7-b0007b416f81
* use SkTRefArray to share readonly data between picturesGravatar reed@google.com2012-07-23
| | | | | | Review URL: https://codereview.appspot.com/6351121 git-svn-id: http://skia.googlecode.com/svn/trunk@4720 2bbb7eff-a529-9590-31e7-b0007b416f81
* Use SkFlatDictionary in SkGPipe to take advantage of its new features.Gravatar scroggo@google.com2012-07-17
| | | | | | | | | | | | Add a controller class to perform the allocation/unallocation for the dictionary and to provide an entry to be replaced, if replacements are allowed. TODO: Use LRU caching in my custom controller so replacements will be done less often. More refactoring on SkFlatDictionary so picture recording's use of the dictionary does not require going through the path to replace. Review URL: https://codereview.appspot.com/6345102 git-svn-id: http://skia.googlecode.com/svn/trunk@4639 2bbb7eff-a529-9590-31e7-b0007b416f81
* check a hashtable before using a bsearchGravatar reed@google.com2012-07-12
| | | | | | Review URL: https://codereview.appspot.com/6345097 git-svn-id: http://skia.googlecode.com/svn/trunk@4572 2bbb7eff-a529-9590-31e7-b0007b416f81
* Change SkFlatData to have a sentinel value, allowing the Compare function toGravatar reed@google.com2012-07-10
| | | | | | | not need a loop-end-test. Review URL: https://codereview.appspot.com/6355086 git-svn-id: http://skia.googlecode.com/svn/trunk@4517 2bbb7eff-a529-9590-31e7-b0007b416f81
* bug fix: take the fAllocSize into account when we perform the compare, otherwiseGravatar reed@google.com2012-07-10
| | | | | | | | we can read past the end of one of the flatdatas if we're unlucky. git-svn-id: http://skia.googlecode.com/svn/trunk@4503 2bbb7eff-a529-9590-31e7-b0007b416f81
* restore 4478 w/ fixed assert (no long need 8-byte alignment)Gravatar reed@google.com2012-07-09
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@4480 2bbb7eff-a529-9590-31e7-b0007b416f81
* revert 4478Gravatar reed@google.com2012-07-09
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@4479 2bbb7eff-a529-9590-31e7-b0007b416f81
* switch callers to SkChecksum::Compute (no 32/64 preference)Gravatar reed@google.com2012-07-09
| | | | | | Review URL: https://codereview.appspot.com/6377043 git-svn-id: http://skia.googlecode.com/svn/trunk@4478 2bbb7eff-a529-9590-31e7-b0007b416f81
* Adding checksum to SkFlatData to accelerate SkPicture recording.Gravatar junov@chromium.org2012-06-27
| | | | | | | | | | | | The checksum triggers an early exit in the mem compare use to search for duplicate flattened objects. Also, call to memcmp was replaced with 64-bit at a time comparison loop. Review URL: http://codereview.appspot.com/6339046/ BUG=http://code.google.com/p/chromium/issues/detail?id=54079 TEST=Checksum and PictureRecord tests in bench.exe git-svn-id: http://skia.googlecode.com/svn/trunk@4378 2bbb7eff-a529-9590-31e7-b0007b416f81
* Adding option to serialize mutable bitmaps in SkPictureGravatar junov@chromium.org2012-06-01
| | | | | | | | | BUG=http://code.google.com/p/chromium/issues/detail?id=115654 REVIEW=http://codereview.appspot.com/6221066/ git-svn-id: http://skia.googlecode.com/svn/trunk@4130 2bbb7eff-a529-9590-31e7-b0007b416f81
* Refactor dictionaries for use by entities other than just SkPictureGravatar djsollen@google.com2012-05-30
| | | | | | Review URL: https://codereview.appspot.com/6101043 git-svn-id: http://skia.googlecode.com/svn/trunk@4077 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fixing a reader size overflow with SkOrderedReadBuffer, when unflattening ↵Gravatar junov@chromium.org2012-05-29
| | | | | | | | | | large bitmaps. REVIEW=http://codereview.appspot.com/6250054/ git-svn-id: http://skia.googlecode.com/svn/trunk@4059 2bbb7eff-a529-9590-31e7-b0007b416f81