aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkWriteBuffer.cpp
Commit message (Collapse)AuthorAge
* remove SkPixelRef::refEncodedData()Gravatar Hal Canary2016-11-22
| | | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5001 Change-Id: I15dba4f44c762ab69a23eb8a77adff5f63763e30 Reviewed-on: https://skia-review.googlesource.com/5001 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Mike Reed <reed@google.com>
* Remove SkAutoTUnref and SkAutoTDelete from public includes.Gravatar bungeman2016-10-27
| | | | | | | | | | | | | | | This also makes the required changed to src, tests, and tools. The few public APIs modified by this change appear to be unused outside of Skia. Removing these from the public API makes it easier to ensure users are no longer using them. This also updates GrGpu::wrapBackendXXX and the ::onWrapBackendXXX methods to clarify ownership. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2448593002 Review-Url: https://codereview.chromium.org/2448593002
* Add SkColor4f serializationGravatar brianosman2016-09-25
| | | | | | | | | | Adjusted usage in color shader, and will also be using this in gradients, soon. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2334123003 Review-Url: https://codereview.chromium.org/2334123003
* add pipecanvasGravatar reed2016-09-13
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2201323003 Review-Url: https://codereview.chromium.org/2201323003
* Convert SkAutoTUnref<SkData> to sk_sp<SkData>.Gravatar bungeman2016-08-03
| | | | | | | | | With the move from SkData::NewXXX to SkData::MakeXXX most SkAutoTUnref<SkData> were changed to sk_sp<SkData>. However, there are still a few SkAutoTUnref<SkData> around, so clean them up. Review-Url: https://codereview.chromium.org/2212493002
* Move off SK_SUPPORT_LEGACY_DATA_FACTORIES.Gravatar bungeman2016-08-02
| | | | | | | This moves Skia code off of SK_SUPPORT_LEGACY_DATA_FACTORIES. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2206633004 Review-Url: https://codereview.chromium.org/2206633004
* Add raw pixel serialization fallback for SkImages that cannot be encoded.Gravatar mtklein2016-06-09
| | | | | | | | | | | | | | | | | | | This fixes serialize-8888 for 2 GMs on Mac that I'm now unblacklisting. I think another was already fixed, and two more were Windows-only. Seems safe to use encoded_size=1 as another sentinel here (like we already use =0); I can't imagine any encoded image format that can encode an image in a single byte. I suspect this is the root of the referenced bug too, but this is a good idea even if not. BUG=chromium:601851 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2039813007 CQ_EXTRA_TRYBOTS=client.skia:Test-Win-MSVC-GCE-CPU-AVX2-x86_64-Release-Trybot,Test-Mac-Clang-MacMini6.2-CPU-AVX-x86_64-Release-Trybot;client.skia.android:Test-Android-GCC-Nexus5-CPU-NEON-Arm7-Release-Trybot,Test-Android-GCC-Nexus9-CPU-Denver-Arm64-Release-Trybot Review-Url: https://codereview.chromium.org/2039813007
* Prototype code that turns any/every flattenable into JSONGravatar brianosman2016-05-04
| | | | | | | | | | | | | | | | | | | | | This makes inspecting things in SkDebugger far more useful - any filter or other complex object on the paint is ultimately visible. You still have to do some guess work to figure out what the fields actually mean, but you can at least cross-reference with the code in flatten(). Screenshots: Before: https://screenshot.googleplex.com/a6JM5HBBe6G.png After : https://screenshot.googleplex.com/XQfr4YJ6mnH.png Changes to public API are just removals and changes to make some functions virtual. TBR=reed@google.com BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1920423002 Review-Url: https://codereview.chromium.org/1920423002
* Remove SkBitmapHeap and SkBitmapHeapReader. They're unused.Gravatar brianosman2016-05-03
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1938033002 Review-Url: https://codereview.chromium.org/1938033002
* Remove unused encodedString API on SkWriteBuffer/SkReadBufferGravatar brianosman2016-05-02
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1936103002 Review-Url: https://codereview.chromium.org/1936103002
* remove SkWriteBuffer::getWriter32().Gravatar mtklein2016-04-29
| | | | | | | | | | | | | | | | | | | SkWriteBuffer exposes its lower-level implementation SkWriter32 through this one call. It's not currently used in any interesting way: - write_encoded_bitmap() uses it to manually re-create writeDataAsByteArray(); - unit tests use it incidentally as a quick way to read the serialized bytes. This should be SkWriteBuffer no longer necessarily needs to have an SkWriter32. Landing this will let us then remove SkWriter32::contiguousArray(). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1936563002 TBR=reed@google.com Just deleting API Review-Url: https://codereview.chromium.org/1936563002
* Enable flattening/unflattening with custom unflatten procsGravatar msarett2016-04-22
| | | | | | | | | | | | | | | | | | Now flattenables are serialized using a string name, so that flattenables do not necessarily need to be registered before serialization. They just need to override getTypeName(). Allows custom unflatten procs to be set on the SkReadBuffer. This is optional if the flattenable is registered, but otherwise must be called. This was split off from: https://codereview.chromium.org/1837913003/ BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1858323002 Review URL: https://codereview.chromium.org/1858323002
* Delete unused fNamedFactorySet from SkWriteBufferGravatar msarett2016-04-19
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1903483002 Review URL: https://codereview.chromium.org/1903483002
* Reverse dependency between SkScalar.h and SkFixed.h.Gravatar benjaminwagner2016-04-07
| | | | | | | | | | | | | | | The following are unused in Chromium, Android, Mozilla, and Google3: - SkFixedToScalar - SkScalarToFixed The following are additionally unused in Skia: - SkStrAppendFixed - SkWriteBuffer::writeFixed BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1841123002 Review URL: https://codereview.chromium.org/1841123002
* 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
* SkPixelSerializer: support indexed pixelsGravatar halcanary2015-12-07
| | | | | | By taking a SkPixmap, SkPixelSerializer::encode() can now handle colortables. Review URL: https://codereview.chromium.org/1501303002
* Revert of change pixel-serializer to support reencoding existing data ↵Gravatar reed2015-09-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | (patchset #5 id:80001 of https://codereview.chromium.org/1373683003/ ) Reason for revert: Need to somehow get access to encoders in chrome -- link error on the roll since SkImageEncoder is not built as part of chrome. Original issue's description: > change pixel-serializer to support reencoding existing data > > Trying to evolve this interface so it can > - support rich set of backend-encoders (including ones like ETC1 that can cheaply convert to KXT > - allow for encoding images as well as bitmaps (e.g. for picture serialization) > - perhaps replace SkImageEncoder as an API (assuming we create a factory that returns a serializer given a format) > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/13f48dc85aa68a60da66aaf39c93d527d11d1278 TBR=scroggo@google.com,msarett@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1371983003
* change pixel-serializer to support reencoding existing dataGravatar reed2015-09-28
| | | | | | | | | | | Trying to evolve this interface so it can - support rich set of backend-encoders (including ones like ETC1 that can cheaply convert to KXT - allow for encoding images as well as bitmaps (e.g. for picture serialization) - perhaps replace SkImageEncoder as an API (assuming we create a factory that returns a serializer given a format) BUG=skia: Review URL: https://codereview.chromium.org/1373683003
* Handle zero-length encoded images gracefully during deserializationGravatar fmalita2015-09-04
| | | | | | | | | | | | | Image encoding may fail during serialization, resulting in zero-length encoded data in the SKP. Instead of invalidating the stream (and preventing deserialization of the whole picture) we can instantiate placeholder images. BUG=skia:4285 R=reed@google.com,robertphillips@google.com Review URL: https://codereview.chromium.org/1308273011
* Add a SkPixelSerializer SkImage encode variantGravatar fmalita2015-09-03
| | | | | | | R=reed@google.com BUG=skia:4285 Review URL: https://codereview.chromium.org/1310633006
* Style Change: NULL->nullptrGravatar halcanary2015-08-27
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316233002 Review URL: https://codereview.chromium.org/1316233002
* change old picture serialization to really handle imagesGravatar reed2015-06-22
| | | | | | BUG=skia:3965 Review URL: https://codereview.chromium.org/1199473002
* add SkPixmap and external locking to bitmapsGravatar reed2015-05-22
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1074983003
* 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
* 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
* Cleanup public includes directory.Gravatar djsollen2014-11-13
| | | | | | | | | | | | | | | | | This CL updates various files in the includes directory to ensure that (1) they do not depend on headers in /src and (2) that they minimize their dependence on external headers. To ensure that we don't regress this behavior a new build target has been added to build a single cpp file that contains all* public includes and is compiled with only those directories in the include path. * The exception is those includes that depend on OS specific headers BUG=skia:2941 NOTRY=true Review URL: https://codereview.chromium.org/721903002
* stop calling SkBitmap::flattenGravatar commit-bot@chromium.org2014-05-23
| | | | | | | | | | | BUG=skia: R=scroggo@google.com, halcanary@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/295793002 git-svn-id: http://skia.googlecode.com/svn/trunk@14867 2bbb7eff-a529-9590-31e7-b0007b416f81
* getFactory() must return a factory.Gravatar commit-bot@chromium.org2014-03-07
| | | | | | | | | | | BUG=348821 R=reed@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/190843002 git-svn-id: http://skia.googlecode.com/svn/trunk@13702 2bbb7eff-a529-9590-31e7-b0007b416f81
* Templetized SkWriter32 readTAt() & overwriteTAt()Gravatar commit-bot@chromium.org2014-02-11
| | | | | | | | | | | | | | | Convert SkWriter32::{read,write}32At() to ::{read,overwrite}TAt<>() to allow peeking/updating arbitrary records. BUG=skia: R=mtklein@google.com, reed@google.com, robertphillips@google.com, iancottrell@chromium.org Author: fmalita@chromium.org Review URL: https://codereview.chromium.org/130913018 git-svn-id: http://skia.googlecode.com/svn/trunk@13416 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix samplefuzz, fix some 32/64bit warningsGravatar reed@google.com2014-02-04
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@13303 2bbb7eff-a529-9590-31e7-b0007b416f81
* Have peek32 return uint32_t& to make it harder to look at more than 4 bytes.Gravatar commit-bot@chromium.org2014-01-31
| | | | | | | | | | | BUG=skia: R=reed@google.com, robertphillips@google.com Author: mtklein@google.com Review URL: https://codereview.chromium.org/145053003 git-svn-id: http://skia.googlecode.com/svn/trunk@13265 2bbb7eff-a529-9590-31e7-b0007b416f81
* Set write buffer flags only in SkWriteBuffer and SkFlatController constructors.Gravatar commit-bot@chromium.org2014-01-30
| | | | | | | | | | | | | | | This is a baby step toward refactored (and faster in-process) typeface and flattenable factory encoding and decoding. The sooner SkWriteBuffer knows its flags, the better. Next steps will be to rearrange Sk{Read,Write}Buffer members into disjoint strategies to handle typefaces and flattenable factories: one for in-process, one for cross-process, one when validating. BUG=skia: R=reed@google.com, scroggo@google.com Author: mtklein@google.com Review URL: https://codereview.chromium.org/138803005 git-svn-id: http://skia.googlecode.com/svn/trunk@13253 2bbb7eff-a529-9590-31e7-b0007b416f81
* Refactor read and write buffers.Gravatar commit-bot@chromium.org2014-01-30
Eliminates SkFlattenable{Read,Write}Buffer, promoting SkOrdered{Read,Write}Buffer a step each in the hierarchy. What used to be this: SkFlattenableWriteBuffer -> SkOrderedWriteBuffer SkFlattenableReadBuffer -> SkOrderedReadBuffer SkFlattenableReadBuffer -> SkValidatingReadBuffer is now SkWriteBuffer SkReadBuffer -> SkValidatingReadBuffer Benefits: - code is simpler, names are less wordy - the generic SkFlattenableFooBuffer code in SkPaint was incorrect; removed - write buffers are completely devirtualized, important for record speed This refactoring was mostly mechanical. You aren't going to find anything interesting in files with less than 10 lines changed. BUG=skia: R=reed@google.com, scroggo@google.com, djsollen@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/134163010 git-svn-id: http://skia.googlecode.com/svn/trunk@13245 2bbb7eff-a529-9590-31e7-b0007b416f81