aboutsummaryrefslogtreecommitdiffhomepage
path: root/include/core/SkPicture.h
Commit message (Collapse)AuthorAge
* change old picture serialization to really handle imagesGravatar reed2015-06-22
| | | | | | BUG=skia:3965 Review URL: https://codereview.chromium.org/1199473002
* skia: Add runtime option to disable picture IO security precautionsGravatar hendrikw2015-06-16
| | | | | | | | Replaced the compile time file IO security setting with a runtime setting. Unfortunately the setting is global. Review URL: https://codereview.chromium.org/1183853003
* Remove the SkCanvas comment APIGravatar fmalita2015-06-15
| | | | | | | | No longer used in Chromium/Blink. R=reed@google.com,robertphillips@google.com,mtklein@google.com Review URL: https://codereview.chromium.org/1153593003
* Don't serialize SkPictures in SkPictureShaders when in untrusted mode.Gravatar mtklein2015-05-20
| | | | | | | | This requires we "first" add a has-picture bool to SkPictureShader serialized format. BUG=chromium:486947, billions and billions of others. Review URL: https://codereview.chromium.org/1151663002
* Have SkPicture inherit from SkRefCnt.Gravatar mtklein2015-05-20
| | | | | | | | | This re-enables adoption tracking for SkPictures in Blink, which should be green now that crrev.com/1136123011 has landed. BUG=skia:3847 Review URL: https://codereview.chromium.org/1145153002
* Sketch splitting SkPicture into an interface and SkBigPicture.Gravatar mtklein2015-05-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds small pictures for drawRect(), drawTextBlob(), and drawPath(). These cover about 89% of draw calls from Blink SKPs, and about 25% of draw calls from our GMs. SkPicture handles: - serialization and deserialization - unique IDs Everything else is left to the subclasses: - playback(), cullRect() - hasBitmap(), hasText(), suitableForGPU(), etc. - LayerInfo / AccelData if applicable. The time to record a 1-op picture improves a good chunk (2 mallocs to 1), and the time to record a 0-op picture greatly improves (2 mallocs to none): picture_overhead_draw: 450ns -> 350ns picture_overhead_nodraw: 300ns -> 90ns BUG=skia: Committed: https://skia.googlesource.com/skia/+/c92c129ff85b05a714bd1bf921c02d5e14651f8b Latest blink_linux_rel: http://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/61248 Committed: https://skia.googlesource.com/skia/+/15877b6eae33a9282458bdb904a6d00440eca0ec http://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/62015 Review URL: https://codereview.chromium.org/1112523006
* Revert of Sketch splitting SkPicture into an interface and SkBigPicture. ↵Gravatar mtklein2015-05-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (patchset #25 id:480001 of https://codereview.chromium.org/1112523006/) Reason for revert: win_chromium_compile_dbg_ng FAILED: ninja -t msvc -e environment.x86 -- E:\b\build\goma/gomacc "E:\b\depot_tools\win_toolchain\vs2013_files\VC\bin\amd64_x86\cl.exe" /nologo /showIncludes /FC @obj\third_party\skia\src\core\skia.SkBitmapHeap.obj.rsp /c ..\..\third_party\skia\src\core\SkBitmapHeap.cpp /Foobj\third_party\skia\src\core\skia.SkBitmapHeap.obj /Fdobj\skia\skia.cc.pdb e:\b\build\slave\win\build\src\third_party\skia\include\core\skpicture.h(176) : error C2487: 'CURRENT_PICTURE_VERSION' : member of dll interface class may not be declared with dll interface Original issue's description: > Sketch splitting SkPicture into an interface and SkBigPicture. > > Adds small pictures for drawRect(), drawTextBlob(), and drawPath(). > These cover about 89% of draw calls from Blink SKPs, > and about 25% of draw calls from our GMs. > > SkPicture handles: > - serialization and deserialization > - unique IDs > > Everything else is left to the subclasses: > - playback(), cullRect() > - hasBitmap(), hasText(), suitableForGPU(), etc. > - LayerInfo / AccelData if applicable. > > The time to record a 1-op picture improves a good chunk > (2 mallocs to 1), and the time to record a 0-op picture > greatly improves (2 mallocs to none): > > picture_overhead_draw: 450ns -> 350ns > picture_overhead_nodraw: 300ns -> 90ns > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/c92c129ff85b05a714bd1bf921c02d5e14651f8b > > Latest blink_linux_rel: > > http://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/61248 > > Committed: https://skia.googlesource.com/skia/+/15877b6eae33a9282458bdb904a6d00440eca0ec TBR=reed@google.com,robertphillips@google.com,fmalita@chromium.org,mtklein@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1130283004
* Sketch splitting SkPicture into an interface and SkBigPicture.Gravatar mtklein2015-05-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds small pictures for drawRect(), drawTextBlob(), and drawPath(). These cover about 89% of draw calls from Blink SKPs, and about 25% of draw calls from our GMs. SkPicture handles: - serialization and deserialization - unique IDs Everything else is left to the subclasses: - playback(), cullRect() - hasBitmap(), hasText(), suitableForGPU(), etc. - LayerInfo / AccelData if applicable. The time to record a 1-op picture improves a good chunk (2 mallocs to 1), and the time to record a 0-op picture greatly improves (2 mallocs to none): picture_overhead_draw: 450ns -> 350ns picture_overhead_nodraw: 300ns -> 90ns BUG=skia: Committed: https://skia.googlesource.com/skia/+/c92c129ff85b05a714bd1bf921c02d5e14651f8b Latest blink_linux_rel: http://build.chromium.org/p/tryserver.blink/builders/linux_blink_rel/builds/61248 Review URL: https://codereview.chromium.org/1112523006
* Perform SkPicture analysis lazily.Gravatar mtklein2015-05-13
| | | | | | | | | | I realized when writing the comment on https://crrev.com/1135363002/ that I'd really just sketched out the entire thing, so I couldn't help but actually write up a working CL. How does this do for your benchmark? BUG=chromium:487075 Review URL: https://codereview.chromium.org/1130123006
* Revert of Sketch splitting SkPicture into an interface and SkBigPicture. ↵Gravatar reed2015-05-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (patchset #22 id:420001 of https://codereview.chromium.org/1112523006/) Reason for revert: speculative revert to fix failures in DEPS roll Original issue's description: > Sketch splitting SkPicture into an interface and SkBigPicture. > > Adds small pictures for drawRect(), drawTextBlob(), and drawPath(). > These cover about 89% of draw calls from Blink SKPs, > and about 25% of draw calls from our GMs. > > SkPicture handles: > - serialization and deserialization > - unique IDs > > Everything else is left to the subclasses: > - playback(), cullRect() > - hasBitmap(), hasText(), suitableForGPU(), etc. > - LayerInfo / AccelData if applicable. > > The time to record a 1-op picture improves a good chunk > (2 mallocs to 1), and the time to record a 0-op picture > greatly improves (2 mallocs to none): > > picture_overhead_draw: 450ns -> 350ns > picture_overhead_nodraw: 300ns -> 90ns > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/c92c129ff85b05a714bd1bf921c02d5e14651f8b TBR=reed@google.com,robertphillips@google.com,mtklein@google.com,mtklein@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1130333002
* Sketch splitting SkPicture into an interface and SkBigPicture.Gravatar mtklein2015-05-07
| | | | | | | | | | | | | | | | | | | | | | | | | | Adds small pictures for drawRect(), drawTextBlob(), and drawPath(). These cover about 89% of draw calls from Blink SKPs, and about 25% of draw calls from our GMs. SkPicture handles: - serialization and deserialization - unique IDs Everything else is left to the subclasses: - playback(), cullRect() - hasBitmap(), hasText(), suitableForGPU(), etc. - LayerInfo / AccelData if applicable. The time to record a 1-op picture improves a good chunk (2 mallocs to 1), and the time to record a 0-op picture greatly improves (2 mallocs to none): picture_overhead_draw: 450ns -> 350ns picture_overhead_nodraw: 300ns -> 90ns BUG=skia: Review URL: https://codereview.chromium.org/1112523006
* Straighten out SkPicture::AccelData APIs.Gravatar mtklein2015-04-29
| | | | | | | | | | Must have been we needed them to be weird (mutable, const setter) before. It doesn't look like that's necessary now... we can just pass it to the constructor. BUG=skia: Review URL: https://codereview.chromium.org/1112833003
* Reduce ref counting in SkPictureRecorder.Gravatar mtklein2015-04-27
| | | | | | | | | | | | | | | | This may be a small help to slimming paint: picture_overhead_draw 1.25us -> 1.22us 0.98x picture_overhead_nodraw 318ns -> 276ns 0.87x It certainly cannot hurt performance. BUG=chromium:470553 TBR=reed@google.com No public API changes. Review URL: https://codereview.chromium.org/1098183003
* Reduce sizeof(SkPicture::Analysis) from 24 bytes to 2 bytes.Gravatar jbroman2015-04-27
| | | | | | | | | | | | | | | | | | This saves "up to" 22 bytes per SkPicture. Due to alignment, this reduces sizeof(SkPicture): - from 88 to 72 bytes on Linux x64 - from 68 to 48 bytes on Android (with Chrome's build settings) It also somewhat simplifies the GPU veto logic. BUG=skia: [mtklein] No public API changes. TBR=reed@google.com Review URL: https://codereview.chromium.org/1060863004
* Fix some lingering typosGravatar robertphillips2015-04-24
| | | | Review URL: https://codereview.chromium.org/1101293003
* O(1) SkPictureUtils::ApproxBytesUsed()Gravatar mtklein2015-04-21
| | | | | | | | | | Chrome wants to call this more often, and it's quite slow today. Seems like this could be clearer if SkPictureUtils::ApproxBytesUsed() were SkPicture::approxBytesUsed(). BUG=chromium:471873 Review URL: https://codereview.chromium.org/1090943004
* Remove filename from SkFontDescriptor.Gravatar bungeman2015-04-17
| | | | | | | | | | No one actually uses it, so remove it. Keep the string id for backward compatibility. TBR=reed@google.com This doesn't change any public API. Review URL: https://codereview.chromium.org/1057413005
* Add serialization of SkBitmapSource's new filterQuality member variableGravatar robertphillips2015-04-10
| | | | | | Missed this in https://codereview.chromium.org/1072603002/ (Add GM to repro crbug.com/472795) Review URL: https://codereview.chromium.org/1078113002
* Send SkPicture deletion message lazily.Gravatar mtklein2015-04-07
| | | | | | | | | | | | | | | | | | If no one has read the picture's unique ID, there's no point invalidating it. This is the same trick we pull with SkPixelRefs. Before: 26M 1 1.49µs 1.6µs 1.77µs 6.25µs 42% picture_overhead_draw 13M 32 742ns 749ns 756ns 823ns 2% picture_overhead_nodraw After: 26M 1 1.27µs 1.33µs 1.49µs 5.51µs 45% picture_overhead_draw 14M 43 677ns 680ns 681ns 701ns 1% picture_overhead_nodraw BUG=skia: Review URL: https://codereview.chromium.org/1061283002
* Bump picture version for uniqueID-less SkImageFilter.Gravatar senorblanco2015-03-18
| | | | | | | | Remove writing of the uniqueID, and put reading behind a version check. BUG=skia:3559 Review URL: https://codereview.chromium.org/1010433003
* Remove unused parameters to SkDocument::CreatePDFGravatar halcanary2015-02-19
| | | | | | | | | | All image compression currently uses (losseless) Deflate, not Jpeg. All clients simply use SkDocument::CreatePDF(stream). SampleApp and SkLua still use SkDocument::CreatePDF(path). Review URL: https://codereview.chromium.org/935843007
* remove unneeded prerollGravatar reed2015-02-15
| | | | | | | BUG=skia: TBR=robertphilips Review URL: https://codereview.chromium.org/927443006
* initial preroll apiGravatar reed2015-01-25
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/855473002
* Make SkStream *not* ref counted.Gravatar scroggo2015-01-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SkStream is a stateful object, so it does not make sense for it to have multiple owners. Make SkStream inherit directly from SkNoncopyable. Update methods which previously called SkStream::ref() (e.g. SkImageDecoder::buildTileIndex() and SkFrontBufferedStream::Create(), which required the existing owners to call SkStream::unref()) to take ownership of their SkStream parameters and delete when done (including on failure). Switch all SkAutoTUnref<SkStream>s to SkAutoTDelete<SkStream>s. In some cases this means heap allocating streams that were previously stack allocated. Respect ownership rules of SkTypeface::CreateFromStream() and SkImageDecoder::buildTileIndex(). Update the comments for exceptional methods which do not affect the ownership of their SkStream parameters (e.g. SkPicture::CreateFromStream() and SkTypeface::Deserialize()) to be explicit about ownership. Remove test_stream_life, which tested that buildTileIndex() behaved correctly when SkStream was a ref counted object. The test does not make sense now that it is not. In SkPDFStream, remove the SkMemoryStream member. Instead of using it, create a new SkMemoryStream to pass to fDataStream (which is now an SkAutoTDelete). Make other pdf rasterizers behave like SkPDFDocumentToBitmap. SkPDFDocumentToBitmap delete the SkStream, so do the same in the following pdf rasterizers: SkPopplerRasterizePDF SkNativeRasterizePDF SkNoRasterizePDF Requires a change to Android, which currently treats SkStreams as ref counted objects. Review URL: https://codereview.chromium.org/849103004
* Rename SkDrawPictureCallback to SkPicture::AbortCallbackGravatar robertphillips2015-01-07
| | | | | | Committed: https://skia.googlesource.com/skia/+/7ef197255deb4e2fa64c03c7130d56ddf164e83c Review URL: https://codereview.chromium.org/829983003
* Revert of Rename SkDrawPictureCallback to SkPicture::AbortCallback (patchset ↵Gravatar reed2015-01-06
| | | | | | | | | | | | | | | | | | #2 id:20001 of https://codereview.chromium.org/829983003/) Reason for revert: speculative revert to unblock DEPS roll Original issue's description: > Rename SkDrawPictureCallback to SkPicture::AbortCallback > > Committed: https://skia.googlesource.com/skia/+/7ef197255deb4e2fa64c03c7130d56ddf164e83c TBR=reed@google.com,robertphillips@google.com NOTREECHECKS=true NOTRY=true Review URL: https://codereview.chromium.org/824013004
* Rename SkDrawPictureCallback to SkPicture::AbortCallbackGravatar robertphillips2015-01-06
| | | | Review URL: https://codereview.chromium.org/829983003
* Remove last trace of SK_LEGACY_ENCODE_BITMAPGravatar scroggo2014-12-22
| | | | Review URL: https://codereview.chromium.org/819173002
* remove dead SK_LEGACY_ENCODE_BITMAP flagGravatar reed2014-12-20
| | | | | | | BUG=skia: TBR= Review URL: https://codereview.chromium.org/820903002
* Remove legacy Picture defines.Gravatar scroggo2014-12-19
| | | | | | No longer needed by Android. Review URL: https://codereview.chromium.org/788903006
* Replace EncodeBitmap with an interface.Gravatar scroggo2014-12-11
| | | | | | | | | | | | | | Gives more flexibility to the caller to decide whether to use the encoded data returned by refEncodedData(). Provides an implementation that supports the old version of SkPicture::serialize(). TODO: Update Chrome, so we can remove SK_LEGACY_ENCODE_BITMAP entirely BUG=skia:3190 Review URL: https://codereview.chromium.org/784643002
* Adding an option for pixelated rendering in SkPictureImageFilterGravatar junov2014-12-09
| | | | | | BUG=skia:3209 Review URL: https://codereview.chromium.org/787073003
* Revert of Replace EncodeBitmap with an interface. (patchset #12 id:210001 of ↵Gravatar scroggo2014-12-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/784643002/) Reason for revert: Failing serialization tasks in DM: http://build.chromium.org/p/client.skia/builders/Test-Win8-ShuttleA-GTX660-x86-Debug/builds/352/steps/dm/logs/stdio Original issue's description: > Replace EncodeBitmap with an interface. > > Gives more flexibility to the caller to decide whether to use the > encoded data returned by refEncodedData(). > > Provides an implementation that supports the old version of > SkPicture::serialize(). > > TODO: Update Chrome, so we can remove SK_LEGACY_ENCODE_BITMAP entirely > > BUG=skia:3190 > > Committed: https://skia.googlesource.com/skia/+/0c4aba6edb9900c597359dfa49d3ce4a41bc5dd1 > > Committed: https://skia.googlesource.com/skia/+/02b217f80b01a7dda8493422e5257c36a9ce8464 TBR=reed@google.com,rmistry@google.com NOTREECHECKS=true NOTRY=true BUG=skia:3190 Review URL: https://codereview.chromium.org/783393004
* Replace EncodeBitmap with an interface.Gravatar scroggo2014-12-09
| | | | | | | | | | | | | | | | Gives more flexibility to the caller to decide whether to use the encoded data returned by refEncodedData(). Provides an implementation that supports the old version of SkPicture::serialize(). TODO: Update Chrome, so we can remove SK_LEGACY_ENCODE_BITMAP entirely BUG=skia:3190 Committed: https://skia.googlesource.com/skia/+/0c4aba6edb9900c597359dfa49d3ce4a41bc5dd1 Review URL: https://codereview.chromium.org/784643002
* Revert of Replace EncodeBitmap with an interface. (patchset #11 id:190001 of ↵Gravatar robertphillips2014-12-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/784643002/) Reason for revert: Compilation is failing on some bots Original issue's description: > Replace EncodeBitmap with an interface. > > Gives more flexibility to the caller to decide whether to use the > encoded data returned by refEncodedData(). > > Provides an implementation that supports the old version of > SkPicture::serialize(). > > TODO: Update Chrome, so we can remove SK_LEGACY_ENCODE_BITMAP entirely > > BUG=skia:3190 > > Committed: https://skia.googlesource.com/skia/+/0c4aba6edb9900c597359dfa49d3ce4a41bc5dd1 TBR=reed@google.com,scroggo@google.com NOTREECHECKS=true NOTRY=true BUG=skia:3190 Review URL: https://codereview.chromium.org/787833002
* Replace EncodeBitmap with an interface.Gravatar scroggo2014-12-09
| | | | | | | | | | | | | | Gives more flexibility to the caller to decide whether to use the encoded data returned by refEncodedData(). Provides an implementation that supports the old version of SkPicture::serialize(). TODO: Update Chrome, so we can remove SK_LEGACY_ENCODE_BITMAP entirely BUG=skia:3190 Review URL: https://codereview.chromium.org/784643002
* Change clear() to respect the clipGravatar reed2014-12-04
| | | | | | | | | This reverts commit af641a1c10f176cb9617026d3cc93c117a85d13d. BUG=skia: TBR= Review URL: https://codereview.chromium.org/783493002
* Revert "Change clear() to respect the clip"Gravatar reed2014-12-02
| | | | | | | | | This reverts commit 3729469d6a12266037b697c2192768545e097ab0. BUG=skia: TBR= Review URL: https://codereview.chromium.org/778563002
* Adding a PictureResolution option to SkPictureImageFilterGravatar Justin Novosad2014-12-02
| | | | | | | | | | | This change adds an option to SkPictureImageFilter to make it rasterize SkPicture in a resolution that matches the local coordinate space (equivalent to the record-time device space). BUG=skia:3176 R=reed@google.com, senorblanco@chromium.org Review URL: https://codereview.chromium.org/753073010
* Change clear() to respect the clipGravatar reed2014-12-02
| | | | | | | | patch from issue 769703002 at patchset 1 (http://crrev.com/769703002#ps1) BUG=skia: Review URL: https://codereview.chromium.org/772533004
* Bump min picture version.Gravatar mtklein2014-12-01
| | | | | | | | | | | | | Chrome Stable is M39, which produces picture format v35: https://chromium.googlesource.com/skia/+/chrome/m39/include/core/SkPicture.h We don't need any code to deal with pictures older than v35. (When M40 goes stable, we can step up to v37, the current latest version.) BUG=skia: Review URL: https://codereview.chromium.org/770703002
* 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
* 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
* use int instead of size_t to match skia conventionGravatar reed2014-11-23
| | | | | | | BUG=skia: TBR=mtklein@google.com Review URL: https://codereview.chromium.org/753903002
* SkPicture::SnapshotArray doesn't really stand to benefit from refcounting.Gravatar mtklein2014-11-21
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/748803005
* public SkNVRefCnt<SnapshotArray>Gravatar mtklein2014-11-21
| | | | | | | | | | | Should fix broken build. NOTRY=true TBR=reed@google.com BUG=skia: Review URL: https://codereview.chromium.org/748143002
* SkData -> SkPicture::SnapshotArrayGravatar mtklein2014-11-21
| | | | | | | | | | Restores type safety with all the same features. (Also note, less code: 29 insertions, 50 deletions.) BUG=skia: Review URL: https://codereview.chromium.org/746553002
* simplify uniqueID code in pictureGravatar reed2014-11-21
| | | | | | | | patch from issue 750003002 at patchset 1 (http://crrev.com/750003002#ps1) BUG=skia: Review URL: https://codereview.chromium.org/752573002
* 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