aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/PictureTest.cpp
Commit message (Collapse)AuthorAge
* option to return drawable from recordingGravatar reed2014-11-24
| | | | | | | | patch from issue 747033005 at patchset 80001 (http://crrev.com/747033005#ps80001) BUG=skia: Review URL: https://codereview.chromium.org/732653004
* add some debugging to SkNVRefCntGravatar reed2014-11-24
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/745383003
* Remove Picture deletion listeners.Gravatar mtklein2014-11-24
| | | | | | | | Looks like we can just have ~SkPicture put the message on the bus directly. BUG=skia:3144 Review URL: https://codereview.chromium.org/751663002
* Add SkNVRefCnt, prune down SkPicture's sizeGravatar mtklein2014-11-20
| | | | | | | | | | | | | | SkNVRefCnt is a variant of SkRefCnt that's Not Virtual, so weighs 4 bytes instead of 8 or 16. There's only benefit to doing this if the deriving class does not otherwise need a vtable, e.g. SkPicture. I've stripped out some cruft from SkPicture, rearranged fields to pack tightly, and added compile asserts for the sizes of SkPicture, SkRecord, and SkVarAlloc. BUG=skia:3144 Review URL: https://codereview.chromium.org/741793002
* Implement SkPicture::bytesUsed() for SkRecord backendGravatar tomhudson2014-11-19
| | | | | | | BUG=chromium:230419 R=mtklein@google.com,reed@google.com Review URL: https://codereview.chromium.org/490253003
* Allow pictures to have a full boundsGravatar reed2014-11-19
| | | | | | | | This reverts commit 7c4cdd2c5b7b6c71fa0e7612594f7885f2dbf264. BUG=skia: Review URL: https://codereview.chromium.org/738083002
* Revert of allow pictures to have a full bounds (patchset #3 id:40001 of ↵Gravatar reed2014-11-19
| | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/736583004/) Reason for revert: needed to update legacy width() helpers Original issue's description: > allow pictures to have a full bounds > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/7e76bff26e7c74902841ca4f607eb0b24a833a4a TBR=fmalita@google.com,mtklein@google.com,robertphillips@google.com,fmalita@chromium.org NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/722043005
* allow pictures to have a full boundsGravatar reed2014-11-19
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/736583004
* Rename GrAccelData to SkLayerInfo and move it to src/coreGravatar robertphillips2014-11-12
| | | | Review URL: https://codereview.chromium.org/719133002
* Move SkRecordComputeLayers and CollectLayers into SkRecordDraw.cppGravatar robertphillips2014-11-12
| | | | | | Rather then exposing parts of FillBounds (as in Expose FillBounds to allow GrPictureUtils::CollectLayers to be layered on top of it - https://codereview.chromium.org/698643002/), this CL moves CollectLayers into SkRecordDraw.cpp to accomplish the layering. Review URL: https://codereview.chromium.org/716913003
* Change where layer hoisting data is gatheredGravatar robertphillips2014-11-11
| | | | | | | | | | | | This CL: 1) removes the EXPERIMENTAL_optimize on SkCanvas & SkDevice 2) moves the saveLayer gathering step to endRecording 3) Replaces GPUOptimize with SkRecordComputeLayers 4) Update bench_pictures & render_pictures to provide the new flag #2 also necessitated moving the BBH computation (and record optimization) out of SkPicture's ctor (and into endRecording) Review URL: https://codereview.chromium.org/718443002
* Fix PictureTest for new GPU vetoGravatar jvanverth2014-11-04
| | | | | | NOTREECHECKS=true Review URL: https://codereview.chromium.org/702733002
* Upgrade GPUOptimizeGravatar robertphillips2014-10-30
| | | | | | | | | | | | This will be a bit hairy to review. The FillBounds and CollectLayers code has diverged significantly resulting in the rendering path seeing different bounds than the hoisting path. This CL merges the FillBounds changes into CollectLayers. A follow on CL will, hopefully, find a way to layer CollectLayers on top of FillBounds. The only code in CollectLayers that is different from FillBounds is bracketed by "LAYER HOISTING" comments. NOTREECHECKS=true Review URL: https://codereview.chromium.org/685263004
* Make RTree handle the case where the playback canvas has empty clip boundsGravatar junov2014-10-30
| | | | | | BUG=skia:3074 Review URL: https://codereview.chromium.org/678303004
* Cut down SkBBH API more.Gravatar mtklein2014-10-27
| | | | | | | | | | | | | | - The expected case is now a single bulk-load insert() call instead of N; - reserve() and flushDeferredInserts() can fold into insert() now; - SkBBH subclasses may take ownership of the bounds This appears to be a performance no-op on both my Mac and N5. I guess even the simplest indirect branch predictor ("same as last time") can predict the repeated virtual calls to SkBBH::insert() perfectly. BUG=skia: Review URL: https://codereview.chromium.org/670213002
* Track nested picture xform state for layer hoistingGravatar robertphillips2014-10-22
| | | | | | The accumulated matrix state of any enclosing SkPictures must be stored separate from the picture-local CTM. Any setMatrix calls inside a layer need to replace the picture-local CTM but concatenate with the enclosing SkPicture transform state (and the transform state needed to translate the layer to the correct location in the cached GrTexture). Review URL: https://codereview.chromium.org/639863005
* Add clip to layer cacheGravatar robertphillips2014-10-20
| | | | | | | | | | | This CL adds the clip region to the GPU layer hoisting image cache. It also switches back to the old caching behavior of using the entire CTM in the cache key rather then just the upper 2x2. This latter change is to focus more on hoisting rather then caching. It also includes 2 smaller fixes: a) layer's that have an image filter are no longer atlased (b.c. doing so complicates applying the image filter) b) the result of clipping the layer's bounds to the current clip is used as the hoisted layer's size. This reduces the amount of pixels drawn to match a normal (non-hoisted) draw pass. Review URL: https://codereview.chromium.org/640773004
* Remove unused SaveLayerInfo::fValid fieldGravatar robertphillips2014-10-09
| | | | | | Minor code cleanup Review URL: https://codereview.chromium.org/643713002
* Add SkBBoxHierarchy::reserve() as an optional size hint.Gravatar mtklein2014-10-09
| | | | | | | | | | | | I want to play around with how SkTileGrid stores its tiles. Having a cap on the number of insert() calls can be pretty handy. While I'm at it, I gave flush() a default empty impl. Like reserve(), it's really an optional hook for subclasses. BUG=skia: Review URL: https://codereview.chromium.org/639933003
* Demote getCount, getDepth, and clear to RTree-only methods.Gravatar mtklein2014-10-02
| | | | | | | | We use them only to test RTree. BUG=skia: Review URL: https://codereview.chromium.org/622773003
* BBHs: void* data -> unsigned dataGravatar mtklein2014-10-02
| | | | | | | | | | | | | | Now that the old backend's not using BBHs, we can specialize them for SkRecord's needs. The only thing we really want to store is op index, which should always be small enough to fit into an unsigned (unsigned also helps keep it straight from other ints floating around). This means we'll need half (32-bit) or a quarter (64-bit) the bytes in SkTileGrid, because we don't have to store an extra int for ordering. BUG=skia:2834 Review URL: https://codereview.chromium.org/617393004
* Remove DEPRECATED_beginRecording().Gravatar mtklein2014-10-01
| | | | | | | | | | | | | | | This removes: 1) ability to record old pictures with SkPictureRecorder; 2) a couple tests specific to the old backend. The functionality of DEPRECATED_beginRecording() now lives in (private) SkPicture::Backport(), which is the only place we need it now. BUG=skia: TBR=reed@google.com Review URL: https://codereview.chromium.org/618303002
* Update layer hoisting code to correctly render sub-picture layersGravatar robertphillips2014-09-24
| | | | | | | | | | | The prior code assumed all layers came from a single picture. BUG=skia:2315 R=bsalomon@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/595543002
* Fix bug in layer hoisting transition to SkRecord backendGravatar robertphillips2014-09-16
| | | | | | | | | | Care must be taken when setting up the initial CTM matrix for partial SkRecord playbacks b.c. all the setMatrix calls will concatenate with the initial matrix (which may be different then the CTM that is required to draw correctly). R=mtklein@google.com, bsalomon@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/549143003
* Revert of Revert of allow canvas to force conservative clips (for speed) ↵Gravatar reed2014-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (patchset #1 id:1 of https://codereview.chromium.org/554033003/) Reason for revert: May just rebaseline, plus want to see the results of the chrome tests, so re-trying this CL. Original issue's description: > Revert of allow canvas to force conservative clips (for speed) (patchset #7 id:120001 of https://codereview.chromium.org/541593005/) > > Reason for revert: > multipicturedraw failed on nvprmsaa -- don't know why yet > > Original issue's description: > > Allow SkCanvas to be initialized to force conservative rasterclips. This has the following effects: > > > > 1. Queries to the current clip will be conservatively large. This can mean the quickReject may return false more often. > > > > 2. The conservative clips mean less work is done. > > > > 3. Enabled by default for Gpu, Record, and NoSaveLayer canvases. > > > > 4. API is private for now. > > > > Committed: https://skia.googlesource.com/skia/+/27a5e656c3d6ef22f9cb34de18e1b960da3aa241 > > TBR=robertphillips@google.com,bsalomon@google.com,mtklein@google.com,junov@google.com > NOTREECHECKS=true > NOTRY=true > > Committed: https://skia.googlesource.com/skia/+/6f09709519b79a1159f3826645f1c5fbc101ee11 R=robertphillips@google.com, bsalomon@google.com, mtklein@google.com, junov@google.com, reed@google.com TBR=bsalomon@google.com, junov@google.com, mtklein@google.com, reed@google.com, robertphillips@google.com NOTREECHECKS=true NOTRY=true Author: reed@chromium.org Review URL: https://codereview.chromium.org/560713002
* Revert of allow canvas to force conservative clips (for speed) (patchset #7 ↵Gravatar reed2014-09-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | id:120001 of https://codereview.chromium.org/541593005/) Reason for revert: multipicturedraw failed on nvprmsaa -- don't know why yet Original issue's description: > Allow SkCanvas to be initialized to force conservative rasterclips. This has the following effects: > > 1. Queries to the current clip will be conservatively large. This can mean the quickReject may return false more often. > > 2. The conservative clips mean less work is done. > > 3. Enabled by default for Gpu, Record, and NoSaveLayer canvases. > > 4. API is private for now. > > Committed: https://skia.googlesource.com/skia/+/27a5e656c3d6ef22f9cb34de18e1b960da3aa241 R=robertphillips@google.com, bsalomon@google.com, mtklein@google.com, junov@google.com TBR=bsalomon@google.com, junov@google.com, mtklein@google.com, robertphillips@google.com NOTREECHECKS=true NOTRY=true Author: reed@google.com Review URL: https://codereview.chromium.org/554033003
* Allow SkCanvas to be initialized to force conservative rasterclips. This has ↵Gravatar reed2014-09-09
| | | | | | | | | | | | | | | | | | the following effects: 1. Queries to the current clip will be conservatively large. This can mean the quickReject may return false more often. 2. The conservative clips mean less work is done. 3. Enabled by default for Gpu, Record, and NoSaveLayer canvases. 4. API is private for now. R=robertphillips@google.com, bsalomon@google.com, mtklein@google.com, junov@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/541593005
* Turn on the save-layer optimization.Gravatar mtklein2014-09-08
| | | | | | | | | BUG=skia: R=robertphillips@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/551853002
* Turn on all pixel-perfect SkRecord optimizations.Gravatar mtklein2014-09-08
| | | | | | | | | BUG=skia: R=robertphillips@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/550083006
* "NULL !=" = NULLGravatar bsalomon2014-09-05
| | | | | | | | R=reed@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/544233002
* Change SkPicture::draw to playbackGravatar robertphillips2014-09-04
| | | | | | | | R=reed@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/540963002
* Try out scalar picture sizesGravatar robertphillips2014-08-29
| | | | | | | | | | This paves the way for removing the 'fTile' parameter from SkPictureShader (although that should be a different CL). If we like this we could also move to providing an entire cull SkRect. R=reed@google.com, mtklein@google.com, fmalita@google.com, fmalita@chromium.org Author: robertphillips@google.com Review URL: https://codereview.chromium.org/513983002
* Add test that confirms Pictures don't leak pixel refs.Gravatar mtklein2014-08-27
| | | | | | | | | | | | | | | Have been investigating memory leak failures that show SkRecords' ImmutableBitmap copy leaking. I think this test proves its not an obvious problem with ImmutableBitmap or SkRecord. http://build.chromium.org/p/chromium.memory/builders/Linux%20Chromium%20OS%20ASan%20LSan%20Tests%20%282%29/builds/2509/steps/interactive_ui_tests/logs/stdio BUG=skia: R=bungeman@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/516593002
* Switch GPU Optimization code to SkRecordGravatar robertphillips2014-08-27
| | | | | | | | R=mtklein@google.com, bsalomon@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/504393002
* Convert BBH APIs to use SkRect.Gravatar mtklein2014-08-27
| | | | | | | | | | | | | Still TODO: convert internals of SkTileGrid.cpp and SkRTree.cpp to work in floats too. NOTREECHECKS=true BUG=skia:1021 R=robertphillips@google.com, reed@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/511613002
* Remove SkQuadTree.Gravatar mtklein2014-08-26
| | | | | | | | | | | | | | We're not testing it to the same degree we do RTree and TileGrid. Any changes we'll make to BBH APIs become 33% easier without it. If find we want it again, we can always resurrect it. BUG=skia:1021,skia:2834 R=robertphillips@google.com, mtklein@google.com TBR=reed Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/500373005
* Install a hook to swap between SkPicture backends with a single define.Gravatar mtklein2014-08-21
| | | | | | | | | BUG=skia: R=robertphillips@google.com, reed@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/492023002
* Our SkPicture::Analysis visitors should recurse into nested pictures.Gravatar mtklein2014-08-21
| | | | | | | | | BUG=skia: R=tomhudson@google.com, mtklein@google.com, reed@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/495793002
* Implement SkPicture::hasText() for SkRecord backend.Gravatar mtklein2014-08-20
| | | | | | | | | | | | Plus, some small tweaks to the existing code surrounding it. Just proposals, will undo whatever you don't like. BUG=skia: R=mtklein@google.com, tomhudson@google.com, reed@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/494683003
* 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
* Counterproposal for skirting the BBH when the query fully contains the picture.Gravatar mtklein2014-08-18
| | | | | | | | | BUG=skia: R=reed@google.com, robertphillips@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/485703002
* Expose API for whether an SkPicture contains textGravatar ajuma2014-08-18
| | | | | | | | | BUG=chromium:399728 R=reed@google.com, nduca@chromium.org Author: ajuma@chromium.org Review URL: https://codereview.chromium.org/478673002
* Rename GPUAccelData to GrAccelDataGravatar robertphillips2014-08-18
| | | | | | | | | | | This is calved off of (Add new API to allow layer hoisting/atlasing across picture piles - https://codereview.chromium.org/474623002/) R=bsalomon@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/482773002
* Fix end-of-pattern matching for Skia recording optimization.Gravatar dneto2014-07-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The recorder optimizer's pattern matcher was accepting command sequences when it shouldn't have. In the submitted case, and the pattern matcher was looking for: saveLayer, drawBitmap, restore and in the rendering for the submitted case, the sequence of commands were: saveLayer, drawBitmap, drawBitmap, restore This sequence was improperly accepted by the matcher, and the optimizer reduced the sequence to: drawBitmap, drawBitmap where the opacity from the saveLayer paint argument was applied to the first drawBitmap only. The user-visible effect in Chrome was a flashing effect on an image caused by incorrect (too-high) opacity. The patch adds a Skia test to check for pixel colour values in a similarly structured recording. All other Skia tests pass. Blink layout tests also pass with this change. BUG=chromium:344987 R=robertphillips@google.com, reed@google.com, mtklein@google.com Author: dneto@chromium.org Review URL: https://codereview.chromium.org/430503004
* Fix alpha textures in NV ES3 contexts on Windows.Gravatar bsalomon2014-07-17
| | | | | | | | | | | | Make unit tests iterate over all the rendering GL context types rather than using kNative. Fix the extension printing when gStartupSpew is set. R=jvanverth@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/398183002
* Remove Skia's use of the default SkPicture constructor and multi-cloneGravatar Robert Phillips2014-07-13
| | | | | | | | | This cannot be landed until (Chrome: Switch to one-at-a-time SkPicture::clone interface - https://codereview.chromium.org/380323002/) has landed. R=mtklein@google.com TBR=reed@google.com Review URL: https://codereview.chromium.org/388833003
* Remove SkPicture copy constructorGravatar robertphillips2014-07-13
| | | | | | | | | | Given where we're heading with SkPicture why would you need to make a copy? R=reed@google.com, mtklein@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/381133002
* Rename SkPicturePlayback to SkPictureDataGravatar robertphillips2014-07-01
| | | | | | | | | | This is in preparation for splitting the playback portion of the new SkPictureData class into a new SkPicturePlayback class. R=reed@google.com, mtklein@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/362773002