aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPicturePlayback.cpp
Commit message (Collapse)AuthorAge
...
* This CL plumbs in the drawBitmapRectToRect "bleed" flag and makes it live on ↵Gravatar commit-bot@chromium.org2013-08-16
| | | | | | | | | | | | the simplest GPU path. R=bsalomon@google.com, reed@google.com, edisonn@google.com, scroggo@google.com, jvanverth@google.com, mtklein@google.com Author: robertphillips@google.com Review URL: https://chromiumcodereview.appspot.com/20806003 git-svn-id: http://skia.googlecode.com/svn/trunk@10765 2bbb7eff-a529-9590-31e7-b0007b416f81
* Replace SkPicture(SkStream) constructors with a factory.Gravatar scroggo@google.com2013-06-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SkPicture: Remove the constructors which take an SkStream as an argument. Rather than having to check a variable for success, the factory will return NULL on failure. Add a protected function for determining if an SkStream is an SKP to share code with SkTimedPicture. In the factory, check for a NULL SkStream. Use a default decoder (from BUG: https://code.google.com/p/skia/issues/detail?id=1325) SkDebuggerGUI: Call SkPicture::CreateFromStream when necessary. Write a factory for creating SkTimedPictures and use it. Use the factory throughout tools. Add include/lazy to utils and effects gyp include_dirs so SkPicture.h can reference SkImageDecoder.h which references SkBitmapFactory.h (in include/lazy). Changes code Chromium uses, so this will require a temporary Skia and then a change to Chromium to use the new Skia code. TODO: Create a decoder that does nothing to be used by pinspect, lua pictures, etc, and allow it to not assert in SkOrderedReadBuffer. R=reed@google.com Review URL: https://codereview.chromium.org/17113004 git-svn-id: http://skia.googlecode.com/svn/trunk@9822 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
* Remove offsetcanvas from debuggerGravatar robertphillips@google.com2013-05-23
| | | | | | | | https://codereview.chromium.org/15746003/ git-svn-id: http://skia.googlecode.com/svn/trunk@9253 2bbb7eff-a529-9590-31e7-b0007b416f81
* add SkDrawPictureCallback optional parameter to drawPicture(), which can ↵Gravatar reed@google.com2013-05-20
| | | | | | | | | | abort the picture drawing. R=bsalomon@google.com Review URL: https://codereview.chromium.org/14598023 git-svn-id: http://skia.googlecode.com/svn/trunk@9197 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "Allow supporting 1 older PICTURE_VERSION."Gravatar scroggo@google.com2013-05-07
| | | | | | | | | | | | | | This reverts commit deb9d6990ef2d153230340d960d86b0966f261e1. That change was just to allow us to bump the PICTURE_VERSION without changing the SKPs to the new one. Since it is not entirely reliable, I am removing it. R=rmistry@google.com Review URL: https://codereview.chromium.org/14741007 git-svn-id: http://skia.googlecode.com/svn/trunk@9035 2bbb7eff-a529-9590-31e7-b0007b416f81
* Allow supporting 1 older PICTURE_VERSION.Gravatar scroggo@google.com2013-04-30
| | | | | | | | | | | Allows https://codereview.chromium.org/14230022/ to be submitted without breaking bench_pictures and render_pictures. After DEPS roll and SKP capture, this will be reverted. Review URL: https://codereview.chromium.org/14158015 git-svn-id: http://skia.googlecode.com/svn/trunk@8918 2bbb7eff-a529-9590-31e7-b0007b416f81
* Catch failures to SkTypeface::Deserialize() and use the default in that case.Gravatar reed@google.com2013-04-22
| | | | | | | | | This fixes cros bots, who are (for whatever reason) failing to deserialize one of their fonts during picture-deserialization. git-svn-id: http://skia.googlecode.com/svn/trunk@8796 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fixing SkPicture command pattern optimizations to make them work correctly ↵Gravatar commit-bot@chromium.org2013-03-15
| | | | | | | | | | | | | | | with bounding box hierarchies BUG=https://code.google.com/p/chromium/issues/detail?id=180645 TEST=render_pictures -r <skp_dir> --validate --bbh <grid|rtree> --mode tile 256 256 Author: junov@chromium.org Reviewed By: robertphillips@google.com Review URL: https://chromiumcodereview.appspot.com/12817011 git-svn-id: http://skia.googlecode.com/svn/trunk@8171 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove bogus ability for creating an SkPicturePlayback to fail.Gravatar scroggo@google.com2013-02-25
| | | | | | | | | | | | | | | | | | | Change SkPicturePlayback::parseBufferTag to return void, since it can never return false. Change SkPicturePlayback::parseStreamTag to return void, since the only way it can return false is if parseBufferTag returns false, or if creating a sub picture failed, both of which are nonsensical. Due to the above, there is no reason for creating an SkPicturePlayback to fail, so remove the isValid parameter. Update subclasses in SkDebuggerGUI. Review URL: https://codereview.appspot.com/7388050 git-svn-id: http://skia.googlecode.com/svn/trunk@7844 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove SkSerializationHelpers.Gravatar scroggo@google.com2013-02-22
| | | | | | | | | | Move the function definition for EncodeBitmap to SkPicture, where InstallPixelRefProc has already moved (and where it is relevant). Review URL: https://codereview.appspot.com/7386053 git-svn-id: http://skia.googlecode.com/svn/trunk@7837 2bbb7eff-a529-9590-31e7-b0007b416f81
* Create SkLazyPixelRef which performs lazy decoding.Gravatar scroggo@google.com2013-02-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new pixel ref behaves similarly to SkImageRef, with some key differences: It does not depend on the images project. It requires an SkImageCache, which handles allocation and caching of the pixel memory. It takes a function signature for decoding which decodes into already allocated pixel memory rather than into an SkBitmap. Add two implementations of SkImageCache: SkLruImageCache and SkAshmemImageCache. Replace SkSerializationHelpers::DecodeBitmap with SkPicture::InstallPixelRefProc, and update sites that referenced it. SkBitmapFactory now sets the pixel ref to a new object of the new class SkLazyPixelRef, provided it has an SkImageCache for caching. Provide an option to do lazy decodes in render_pictures and bench_pictures. SkPicture: Eliminate the default parameters in the constructor. If a proc for decoding bitmaps is installed, use it to decode any encoded data in subpictures. When parsing deserializing subpictures, check for success. When serializing subpictures, pass the picture's bitmap encoder to the subpicture's call to serialize. Update BitmapFactoryTest to test its new behavior. BUG=https://code.google.com/p/skia/issues/detail?id=1008 BUG=https://code.google.com/p/skia/issues/detail?id=1009 Review URL: https://codereview.appspot.com/7060052 git-svn-id: http://skia.googlecode.com/svn/trunk@7835 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix a warning on Android.Gravatar scroggo@google.com2013-02-22
| | | | | | | | | Only define/use haveBuffer in debug mode, since it's only used for assertions. Review URL: https://codereview.appspot.com/7384051 git-svn-id: http://skia.googlecode.com/svn/trunk@7824 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2013-02-16
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7755 2bbb7eff-a529-9590-31e7-b0007b416f81
* non-SK_DEVELOPER-mode patch for r7752Gravatar robertphillips@google.com2013-02-15
| | | | | | | | unreviewed git-svn-id: http://skia.googlecode.com/svn/trunk@7753 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
* Now store chunk size in skp file formatGravatar robertphillips@google.com2013-02-15
| | | | | | | | https://codereview.appspot.com/7308087/ git-svn-id: http://skia.googlecode.com/svn/trunk@7747 2bbb7eff-a529-9590-31e7-b0007b416f81
* Only support SkPicture abort for Android due to the fragility of the ↵Gravatar djsollen@google.com2013-02-01
| | | | | | | | existing API Review URL: https://codereview.appspot.com/7225083 git-svn-id: http://skia.googlecode.com/svn/trunk@7515 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fixing crash in cloning empty SkPicture objectGravatar junov@chromium.org2013-01-28
| | | | | | | | BUG=https://code.google.com/p/chromium/issues/detail?id=172062 TEST=Pictures unit test, test_clone_empty Review URL: https://codereview.appspot.com/7223048 git-svn-id: http://skia.googlecode.com/svn/trunk@7430 2bbb7eff-a529-9590-31e7-b0007b416f81
* Switch debugger profiling stubs over to being guarded by SK_DEVELOPERGravatar robertphillips@google.com2013-01-17
| | | | | | | | https://codereview.appspot.com/7134053/ git-svn-id: http://skia.googlecode.com/svn/trunk@7246 2bbb7eff-a529-9590-31e7-b0007b416f81
* Follow up on the previous patch :Gravatar sugoi@google.com2012-12-17
| | | | | | | | | | | | | | | - Moved the SkStrokeRec class in its own file - Replaced SkStroke by SkStrokeRec in Ganesh - Moved path stroking to the Ganesh level in some cases (everytime it isn't required to do it directly in SkGpuDevice). PathEffect and MaskFilter still require path stroking at the SkGpuDevice for now. - Renamed static functions in SkPath with proper names * No functionality shold have changed with this patch. This is a step towards enabling Ganesh Path Renderers to decide whether or not to stroke the path rather than always receiving the stroked path as an input argument. BUG=chromium:135111 TEST=Try path rendering tests from the gm Review URL: https://codereview.appspot.com/6946072 git-svn-id: http://skia.googlecode.com/svn/trunk@6861 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
* When cloning picture, use a bitmap heap to avoid flattening bitmaps.Gravatar scroggo@google.com2012-12-10
| | | | | | | | | | | | | When cloning a picture, the paints are reflattened. Use a bitmap heap so the bitmaps do not get unnecessarily get flattened as well. For br.337, this speeds up bench_pictures timing the clone operation (not yet checked in, but currently timing making five clones) from around 180 ms to around 24ms. Review URL: https://codereview.appspot.com/6903063 git-svn-id: http://skia.googlecode.com/svn/trunk@6740 2bbb7eff-a529-9590-31e7-b0007b416f81
* optimize for paints that don't require deep copy during cloneGravatar reed@google.com2012-12-10
| | | | | | Review URL: https://codereview.appspot.com/6903062 git-svn-id: http://skia.googlecode.com/svn/trunk@6739 2bbb7eff-a529-9590-31e7-b0007b416f81
* Make debugger profiling honor deleted commandsGravatar robertphillips@google.com2012-12-07
| | | | | | | | https://codereview.appspot.com/6906043/ git-svn-id: http://skia.googlecode.com/svn/trunk@6713 2bbb7eff-a529-9590-31e7-b0007b416f81
* mark bitmaps as immutable as we deserialize them into picture-playbackGravatar reed@google.com2012-12-07
| | | | | | Review URL: https://codereview.appspot.com/6900045 git-svn-id: http://skia.googlecode.com/svn/trunk@6703 2bbb7eff-a529-9590-31e7-b0007b416f81
* Added profiling stubs to SkPicturePlaybackGravatar robertphillips@google.com2012-11-13
| | | | | | | | https://codereview.appspot.com/6851044/ git-svn-id: http://skia.googlecode.com/svn/trunk@6397 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add the ability to provide function pointers to SkPicture serializationGravatar scroggo@google.com2012-10-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and deserialization for encoding and decoding bitmaps. Remove kForceFlattenBitmapPixels_Flag, which is no longer used. When an SkOrderedReadBuffer needs to read a bitmap, if it does not have an image decoder, use a dummy bitmap. In GM, add a tolerance option for color differences, used when testing picture serialization, so it can assume two images are the same even though PNG encoding/decoding may have resulted in small differences. Create dummy implementations for SkImageDecoder and SkImageEncoder functions in SkImageDecoder_empty so that a project that does not want to include the images project it can still build. Allow ports to build without images project. In Mac's image encoder, copy 4444 to 8888 before encoding. Add SkWriter32::reservePad, to provide a pointer to write non 4 byte aligned data, padded with zeroes. In bench_ and render_ pictures, pass decode function to SkPicture creation from a stream. BUG=https://code.google.com/p/skia/issues/detail?id=842 Review URL: https://codereview.appspot.com/6551071 git-svn-id: http://skia.googlecode.com/svn/trunk@5818 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
* For a picture playback with nothing written, use an empty SkData.Gravatar scroggo@google.com2012-09-14
| | | | | | | | | | This prevents crashing when attempting to access fOpData. BUG=https://code.google.com/p/skia/issues/detail?id=870 Review URL: https://codereview.appspot.com/6499108 git-svn-id: http://skia.googlecode.com/svn/trunk@5550 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix some nits from http://codereview.appspot.com/6506103/Gravatar rileya@google.com2012-09-14
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@5547 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2012-09-14
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@5539 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add R-Tree record flag to SkPicture, plus some cleanup/fixes in associated ↵Gravatar rileya@google.com2012-09-13
| | | | | | | | classes. Review URL: https://codereview.appspot.com/6506103 git-svn-id: http://skia.googlecode.com/svn/trunk@5537 2bbb7eff-a529-9590-31e7-b0007b416f81
* Record the initial matrix when we begin picture-playback, and concat withGravatar reed@google.com2012-09-05
| | | | | | | | that if we see a setMatrix command. In this way we can respect the caller's overall playback matrix environment. Review URL: https://codereview.appspot.com/6495092 git-svn-id: http://skia.googlecode.com/svn/trunk@5409 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Nightly_House_KeepingGravatar skia.committer@gmail.com2012-08-30
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@5346 2bbb7eff-a529-9590-31e7-b0007b416f81
* Implement multi-threaded picture playback via cloning.Gravatar djsollen@google.com2012-08-29
| | | | | | | | | | | | | | The CL adds SkPicture.clone() which produces a thread-safe copy by creating a shallow copy of the thread-safe data within the picture and a deep copy of the data that is not (e.g. SkPaint). This implementation re-flattens the paints when cloning instead of retaining the flattened paints from the recording process. Changes were also needed to various classes to ensure thread safety Review URL: https://codereview.appspot.com/6459105 git-svn-id: http://skia.googlecode.com/svn/trunk@5335 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
* remove EdgeType enum. Unimportant distinction, and removing speeds up ↵Gravatar reed@google.com2012-08-16
| | | | | | | | quickReject Review URL: https://codereview.appspot.com/6448161 git-svn-id: http://skia.googlecode.com/svn/trunk@5140 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
* 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 SkData to share between record and playbackGravatar reed@google.com2012-07-21
| | | | | | | | use SkReader32 on the stack, as a step towards thread-reentrant playback git-svn-id: http://skia.googlecode.com/svn/trunk@4711 2bbb7eff-a529-9590-31e7-b0007b416f81
* Adding bracketing save/restore calls to SkPicture at record time andGravatar junov@chromium.org2012-07-16
| | | | | | | | | | preparing tests for enforcing save/restore balancing constraints on SkPicture Review URL: http://codereview.appspot.com/6354105/ git-svn-id: http://skia.googlecode.com/svn/trunk@4618 2bbb7eff-a529-9590-31e7-b0007b416f81