aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/RecordTest.cpp
Commit message (Collapse)AuthorAge
* trim #include <new> from SkPostConfig.hGravatar Mike Klein2018-06-11
| | | | | | | Change-Id: I693ddcd4ade101ba4eb4102e03adce183aa1d672 Reviewed-on: https://skia-review.googlesource.com/133829 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Style bikeshed - remove extraneous whitespaceGravatar halcanary2016-03-29
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1842753002 Review URL: https://codereview.chromium.org/1842753002
* SkRecord: infer return type for visit() and mutate().Gravatar mtklein2016-03-22
| | | | Review URL: https://codereview.chromium.org/1824983003
* Add SkRecord::defrag().Gravatar mtklein2015-11-19
| | | | | | | | | | | | | Called by SkRecordOptimize(), this moves all the NoOps to the end and slices them off. This implementation with std::remove_if() is linear and doesn't malloc. No diffs: https://gold.skia.org/search2?issue=1461663003&unt=true&query=source_type%3Dgm&master=false BUG=skia: Review URL: https://codereview.chromium.org/1461663003
* simplify code in SkRecords.hGravatar mtklein2015-09-28
| | | | | | | | | | | | | | | | - use C++11 features ({} init, move constructors) to eliminate the need for explicit constructors - collapse RECORD0...RECORD8 into just one RECORD macro - explicitly tag record types instead of using member detectors. Removing member detectors makes this code significantly less fragile. This exposes a few places where we didn't really think through what to do with SkDrawable. I've marked them TODO for now. BUG=skia: Review URL: https://codereview.chromium.org/1360943003
* Style Change: SkNEW->new; SkDELETE->deleteGravatar halcanary2015-08-26
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316123003 Review URL: https://codereview.chromium.org/1316123003
* unsigned -> int for counts and indices in picture-related codeGravatar mtklein2015-08-19
| | | | | | | | also, (C) BUG=skia: Review URL: https://codereview.chromium.org/1300163002
* Deparameterize SkVarAlloc.Gravatar mtklein2014-11-13
| | | | | | | | | | | | | | | | | | | | | | | | SkRecord performance is not sensitive to these values, so we can cut some storage. This rearranges the space-remaining logic to use a count of bytes left rather than a pointer to the end, cutting memory usage a little more. An SkVarAlloc used to weigh 20 or 32 bytes which now becomes 16 or 24. I think if I think about it a bit more I can trim off that Block* too, getting us to 12 or 16 bytes. Because we now just always grow by doubling, this CL switches from storing fSmallest to its log base 2. This has the nice effect of never having to worry about it overflowing, and means we can probably squeeze it down into a byte if we want, even 6 bits. BUG=skia: Committed: https://skia.googlesource.com/skia/+/bc415389855888af5a1282ca4b6bee30afa3d69d CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu12-ShuttleA-GTX660-x86-Debug-Trybot Review URL: https://codereview.chromium.org/721313002
* Align all SkRecord::alloc() calls up to at least a pointer size.Gravatar mtklein2014-08-28
| | | | | | | | | | | This should make the LSAN bots able to see all our pointers. BUG=skia: R=reed@google.com, robertphillips@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/517073002
* Move the code over using the same template type approach previously used for ↵Gravatar tomhudson2014-08-20
| | | | | | | | | | | | | | | willPlayBackBitmaps in http://skbug.com/2702. Also unifies that flag and this one into a struct so they and others can be computed together. The struct is stored const to enforce lifetime expectations. Adds a few new cases to the unit test. BUG=skia:2700 R=mtklein@google.com, reed@google.com, robertphillips@google.com, tomhudson@google.com Committed: https://skia.googlesource.com/skia/+/60c2a79cfa8ceebcbafc243407564dc71f5e3b4f Author: tomhudson@chromium.org Review URL: https://codereview.chromium.org/364823009
* Revert "Move the code over using the same template type approach previously ↵Gravatar Mike Klein2014-08-18
| | | | | | | | | | used for willPlayBackBitmaps in http://skbug.com/2702." This reverts commit 60c2a79cfa8ceebcbafc243407564dc71f5e3b4f. BUG=skia: Review URL: https://codereview.chromium.org/481173003
* Move the code over using the same template type approach previously used for ↵Gravatar tomhudson2014-08-18
| | | | | | | | | | | | | willPlayBackBitmaps in http://skbug.com/2702. Also unifies that flag and this one into a struct so they and others can be computed together. The struct is stored const to enforce lifetime expectations. Adds a few new cases to the unit test. BUG=skia:2700 R=mtklein@google.com, reed@google.com, robertphillips@google.com, tomhudson@google.com Author: tomhudson@chromium.org Review URL: https://codereview.chromium.org/364823009
* Only you can prevent memory leaks.Gravatar mtklein2014-07-07
| | | | | | | | | | | | | | | SkPaint::setFoo() refs the foo, leaving the foo with a bonus ref unless you call ->unref(). Valgrind caught this: http://108.170.220.120:10117/builders/Test-Ubuntu12-ShuttleA-GTX550Ti-x86_64-Release-Valgrind/builds/317/steps/RunTests/logs/stdio BUG=skia: R=tomhudson@chromium.org, mtklein@google.com, tomhudson@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/377523002
* Linear-time implementation of willPlaybackBitmaps(), computed & cachedGravatar tomhudson2014-07-05
| | | | | | | | | | | | | on construction in SkPicture. Unit test. Template trickery thanks to mtklein@. BUG=skia:2702 R=mtklein@google.com, reed@android.com, reed@google.com, tomhudson@google.com, mtklein, reed Author: tomhudson@chromium.org Review URL: https://codereview.chromium.org/366443002
* Move paints to the front of draw structs.Gravatar commit-bot@chromium.org2014-05-07
| | | | | | | | | | | | | | | The order of arguments in these structs is arbitrary, so we might as well arrange them to optimize something. Putting the paints at the front means the logic to find the paint is a lot more concise: it's usually just ptr+0, or *(ptr+0) when the SkPaint is optional. This considerably reduces the size of the jump table in IsDraw::operator(). BUG=skia:2378 R=fmalita@chromium.org, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/272673002 git-svn-id: http://skia.googlecode.com/svn/trunk@14634 2bbb7eff-a529-9590-31e7-b0007b416f81
* Convert all SkRecordPattern matchers into SkRecord mutators.Gravatar commit-bot@chromium.org2014-05-07
| | | | | | | | | | | | | | | | | | | - Allow any return type from SkRecord mutators and visitors; - update existing calls to mutate and visit; - convert match to operator() in SkRecordPattern; - tidy up a few inelegant bits of old code in tests. The net result is that the generated code is much clearer. All the mutate() calls inline as you'd hope, and you can now actually follow along with the disassembly. BUG=skia:2378 R=fmalita@chromium.org, bungeman@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/273643007 git-svn-id: http://skia.googlecode.com/svn/trunk@14631 2bbb7eff-a529-9590-31e7-b0007b416f81
* Refactor SkRecord opts, converting playback optimizations where possible.Gravatar commit-bot@chromium.org2014-04-22
| | | | | | | | | | | | | | | | | This adds back two optimizations from SkPicture: drawPosText strength reduction to drawPosTextH, and pointless save-foo-restore blocks are noop'd away. The small-T optimization in SkRecord gets in the way of implementing replace(), so I removed it. Just to keep the API focused, I removed the methods on SkRecord that iterate over i for you; it's just as efficient to do it yourself, and all of the interesting code does its own custom iteration. BUG=skia:2378 R=fmalita@chromium.org, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/245853002 git-svn-id: http://skia.googlecode.com/svn/trunk@14300 2bbb7eff-a529-9590-31e7-b0007b416f81
* Mark our territory with (C).Gravatar commit-bot@chromium.org2014-04-11
| | | | | | | | | | | BUG=skia: R=reed@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/235253002 git-svn-id: http://skia.googlecode.com/svn/trunk@14158 2bbb7eff-a529-9590-31e7-b0007b416f81
* SkRecord: make culling work if SkRecordAnnotateCullingPairs is called.Gravatar commit-bot@chromium.org2014-04-08
| | | | | | | | | | | | | | | | - Allow stateful functors; allow visit()/mutate() at a given index; add count(). - Annotate cull push/pop pairs on the PushCull records. (tested) - Use those annotations to skip ahead in SkRecordDraw. (not yet tested beyond dm --skr) - Make SkRecordDraw a function, move its implementation to a .cpp. BUG=skia:2378 R=fmalita@chromium.org, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/229523002 git-svn-id: http://skia.googlecode.com/svn/trunk@14101 2bbb7eff-a529-9590-31e7-b0007b416f81
* Start on some unwritten SkRecord TODOs:Gravatar commit-bot@chromium.org2014-04-08
- add SK_OVERRIDE for SkCanvas methods in SkRecorder - start on unit tests, here just for SkRecord itself BUG=skia:2378 R=fmalita@google.com, mtklein@google.com, fmalita@chromium.org Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/228723003 git-svn-id: http://skia.googlecode.com/svn/trunk@14097 2bbb7eff-a529-9590-31e7-b0007b416f81