aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkWriter32.cpp
Commit message (Collapse)AuthorAge
* Make sp variants for SkDataGravatar reed2016-03-11
| | | | Review URL: https://codereview.chromium.org/1779263003
* Style Change: NULL->nullptrGravatar halcanary2015-08-27
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316233002 Review URL: https://codereview.chromium.org/1316233002
* Make SkWriter32::snapshotAsData() a dumb copy.Gravatar mtklein2015-01-29
| | | | | | | | | SkWriter32::snapshotAsData() is no longer performance critical. It's only used when we're serializing to disk. BUG=skia:2289 Review URL: https://codereview.chromium.org/875403005
* Fixed issue found by clusterfuzzGravatar commit-bot@chromium.org2014-04-29
| | | | | | | | | | | | | An integer overflow was causing an issue when reading a string with a very large (or negative) size. BUG=367764 R=senorblanco@google.com, senorblanco@chromium.org, reed@google.com, borenet@google.com Author: sugoi@chromium.org Review URL: https://codereview.chromium.org/255693003 git-svn-id: http://skia.googlecode.com/svn/trunk@14434 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix size_t/int warningsGravatar commit-bot@chromium.org2014-04-23
| | | | | | | | | | | BUG=skia: R=mtklein@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/247753003 git-svn-id: http://skia.googlecode.com/svn/trunk@14332 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add capture snapshot as data to SkWriter32, use it to optimise record->playback.Gravatar commit-bot@chromium.org2014-03-12
| | | | | | | | | | | | | | This is a new way of implementing https://codereview.chromium.org/155863005/ It uses copy on write semantics to return a buffer without copying it, so that record -> playback does not need to copy the buffer. BUG=skia:2125 R=tomhudson@google.com, mtklein@google.com, reed@google.com, iancottrell@chromium.org Author: iancottrell@google.com Review URL: https://codereview.chromium.org/167113003 git-svn-id: http://skia.googlecode.com/svn/trunk@13769 2bbb7eff-a529-9590-31e7-b0007b416f81
* SkWriter32: throw in the SkTDArray towel.Gravatar commit-bot@chromium.org2014-02-13
| | | | | | | | | | | | | | | | | | | I think it's looking more clear we don't have a clean way to use SkTDArray in SkWriter32. We can't give SkWriter32 meaningful control over SkTDArray's reallocation without making moot SkTDArray's raison d'etre. Let's just use an SkAutoTMalloc<uint8_t> instead. It wants SkWriter32 to control it. Also, it's lower overhead: SkAutoTMalloc<uint8_t> is just a smart poiter: no size or capacity stored. BUG=skia: R=reed@google.com, iancottrell@google.com, reed@chromium.org, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/163983002 git-svn-id: http://skia.googlecode.com/svn/trunk@13436 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
* Reland SkWriter32 growth change with build fixes.Gravatar commit-bot@chromium.org2014-02-11
| | | | | | | | | | | | | | - SkSWriter32 resets itself with its stack block; - Track the full capacity of fInternal (which may be >size after a reset). BUG=skia:2125 R=reed@google.com, iancottrell@chromium.org, iancottrell@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/158953003 git-svn-id: http://skia.googlecode.com/svn/trunk@13412 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert of Change growth function for SkWriter32 ↵Gravatar commit-bot@chromium.org2014-02-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/150663014/) Reason for revert: See https://codereview.chromium.org/152703007/. Original issue's description: > Change growth function for SkWriter32 > > Add setCountExact to SkTDArray to allow external control of array growth. > Use it to allow SkWriter to control the buffer growth pattern. > Change buffer growth pattern to 1.5n+4096 > > BUG=skia:2125 > > Committed: http://code.google.com/p/skia/source/detail?r=13401 R=tomhudson@google.com, reed@google.com, iancottrell@google.com TBR=iancottrell@google.com, reed@google.com, tomhudson@google.com NOTREECHECKS=true NOTRY=true BUG=skia:2125 Author: mtklein@google.com Review URL: https://codereview.chromium.org/132313013 git-svn-id: http://skia.googlecode.com/svn/trunk@13406 2bbb7eff-a529-9590-31e7-b0007b416f81
* Change growth function for SkWriter32Gravatar commit-bot@chromium.org2014-02-11
| | | | | | | | | | | | | | | Add setCountExact to SkTDArray to allow external control of array growth. Use it to allow SkWriter to control the buffer growth pattern. Change buffer growth pattern to 1.5n+4096 BUG=skia:2125 R=tomhudson@google.com, mtklein@google.com, reed@google.com Author: iancottrell@google.com Review URL: https://codereview.chromium.org/150663014 git-svn-id: http://skia.googlecode.com/svn/trunk@13401 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix broken debug buildGravatar commit-bot@chromium.org2014-02-11
| | | | | | | | | | | BUG=skia: R=tomhudson@google.com Author: iancottrell@google.com Review URL: https://codereview.chromium.org/143223005 git-svn-id: http://skia.googlecode.com/svn/trunk@13397 2bbb7eff-a529-9590-31e7-b0007b416f81
* Cleaner external buffer handling in SkWriter32Gravatar commit-bot@chromium.org2014-02-11
| | | | | | | | | | | | | | This unifies the internal and external buffer handling so that the difference only has to be noticed when growing. Removing the branches from the common read and write cases gives a significant speedup. BUG=skia:2125 R=tomhudson@google.com, mtklein@google.com, reed@google.com Author: iancottrell@google.com Review URL: https://codereview.chromium.org/156683004 git-svn-id: http://skia.googlecode.com/svn/trunk@13396 2bbb7eff-a529-9590-31e7-b0007b416f81
* Convert SkWriter32 to use an SkTDArray for its internal storage.Gravatar commit-bot@chromium.org2014-01-14
| | | | | | | | | | | | | | | | | | | | | | | | This reduces the allocation overhead of a null picture (create, beginRecording(), endRecording) from about 18K to about 1.9K. (There's still lots more to prune.) SkPictureFlat can exploit the fact that Writer32 is contiguous simplify its memory management. The Writer32 itself becomes the scratch buffer. Remove lots and lots of arbitrary magic numbers that were size guesses and minimum allocation sizes. Keep your eyes open for the big obvious DUH why we save 16K per picture! (Spoiler alert. It's because that first save we issue in beginRecording() forces the old SkWriter32 to allocate 16K.) Tests passing, DM passing. bench --match writer: ~20% faster null bench_record: ~30% faster bench_record on buildbot .skps: ~3-6% slower, ranging 25% faster to 20% slower bench_pictures on buildbot .skps: ~1-2% faster, ranging 13% faster to 28% slower BUG=skia:1850 R=reed@google.com Author: mtklein@google.com Review URL: https://codereview.chromium.org/137433003 git-svn-id: http://skia.googlecode.com/svn/trunk@13073 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix bug in SkWriter32.Gravatar mtklein@google.com2013-09-03
| | | | | | | | | | | | | | If you give SkWriter32 external storage but that external storage is too small for the first reservation you make, you'll hit an assert in debug mode. I think the answer is to simply remove the SkASSERT. Added a test. BUG= R=reed@google.com Review URL: https://codereview.chromium.org/23646007 git-svn-id: http://skia.googlecode.com/svn/trunk@11062 2bbb7eff-a529-9590-31e7-b0007b416f81
* Write NULL as "" so readString() always returns a non-NULL string.Gravatar mtklein@google.com2013-08-15
| | | | | | | | | BUG= R=reed@google.com Review URL: https://codereview.chromium.org/22862002 git-svn-id: http://skia.googlecode.com/svn/trunk@10754 2bbb7eff-a529-9590-31e7-b0007b416f81
* allow NULL in writeString/readStringGravatar commit-bot@chromium.org2013-08-09
| | | | | | | | | | | BUG=skia:1469, code.google.com/p/android/issues/detail?id=58257 R=scroggo@google.com Author: mtklein@google.com Review URL: https://chromiumcodereview.appspot.com/22359003 git-svn-id: http://skia.googlecode.com/svn/trunk@10662 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2013-01-26
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@7406 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2012-12-22
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@6930 2bbb7eff-a529-9590-31e7-b0007b416f81
* unify how we handle externally-provided storage in SkWriter32, with the goalGravatar reed@google.com2012-12-21
| | | | | | | of simplifying the logic in reserve() so it can be inlined/accelerated. Review URL: https://codereview.appspot.com/6962048 git-svn-id: http://skia.googlecode.com/svn/trunk@6923 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2012-12-08
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@6721 2bbb7eff-a529-9590-31e7-b0007b416f81
* speedup peek32() when the offset is in the last block (fTail)Gravatar reed@google.com2012-12-07
| | | | | | Review URL: https://codereview.appspot.com/6906047 git-svn-id: http://skia.googlecode.com/svn/trunk@6708 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
* truncate our llist w/ null during rewind.Gravatar reed@google.com2012-08-31
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@5375 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
* add SkWriter32::rewindToOffset() -- used for peephole edits in picture recordingGravatar reed@google.com2012-08-30
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@5345 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
* Avoid a loop in writeString and writePad by zeroing padding first.Gravatar scroggo@google.com2012-07-24
| | | | | | | | | | | | | Also add a benchmark to time the new improved writeString. Before my change the bench took ~1.23ms and afterwards it takes ~.95ms. Add some testing to ensure that writePad works properly. TEST=Writer32Test, WriterBench Review URL: https://codereview.appspot.com/6438045 git-svn-id: http://skia.googlecode.com/svn/trunk@4742 2bbb7eff-a529-9590-31e7-b0007b416f81
* In SkWriter32::writeString, initialize all memory reserved.Gravatar scroggo@google.com2012-07-23
| | | | | | | | | | | | SkFlatData compares data which is sometimes created by writeString. Initialize all the memory in writeString so it does not compare uninitialized memory. See http://code.google.com/p/skia/issues/detail?id=721&thanks=721 Review URL: https://codereview.appspot.com/6428054 git-svn-id: http://skia.googlecode.com/svn/trunk@4715 2bbb7eff-a529-9590-31e7-b0007b416f81
* add assertGravatar reed@google.com2012-05-09
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@3874 2bbb7eff-a529-9590-31e7-b0007b416f81
* add optional storage parameter to SkWriter32Gravatar reed@google.com2012-04-24
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@3759 2bbb7eff-a529-9590-31e7-b0007b416f81
* Automatic update of all copyright notices to reflect new license terms.Gravatar epoger@google.com2011-07-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I have manually examined all of these diffs and restored a few files that seem to require manual adjustment. The following files still need to be modified manually, in a separate CL: android_sample/SampleApp/AndroidManifest.xml android_sample/SampleApp/res/layout/layout.xml android_sample/SampleApp/res/menu/sample.xml android_sample/SampleApp/res/values/strings.xml android_sample/SampleApp/src/com/skia/sampleapp/SampleApp.java android_sample/SampleApp/src/com/skia/sampleapp/SampleView.java experimental/CiCarbonSampleMain.c experimental/CocoaDebugger/main.m experimental/FileReaderApp/main.m experimental/SimpleCocoaApp/main.m experimental/iOSSampleApp/Shared/SkAlertPrompt.h experimental/iOSSampleApp/Shared/SkAlertPrompt.m experimental/iOSSampleApp/SkiOSSampleApp-Base.xcconfig experimental/iOSSampleApp/SkiOSSampleApp-Debug.xcconfig experimental/iOSSampleApp/SkiOSSampleApp-Release.xcconfig gpu/src/android/GrGLDefaultInterface_android.cpp gyp/common.gypi gyp_skia include/ports/SkHarfBuzzFont.h include/views/SkOSWindow_wxwidgets.h make.bat make.py src/opts/memset.arm.S src/opts/memset16_neon.S src/opts/memset32_neon.S src/opts/opts_check_arm.cpp src/ports/SkDebug_brew.cpp src/ports/SkMemory_brew.cpp src/ports/SkOSFile_brew.cpp src/ports/SkXMLParser_empty.cpp src/utils/ios/SkImageDecoder_iOS.mm src/utils/ios/SkOSFile_iOS.mm src/utils/ios/SkStream_NSData.mm tests/FillPathTest.cpp Review URL: http://codereview.appspot.com/4816058 git-svn-id: http://skia.googlecode.com/svn/trunk@1982 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add option in flattening to write factory names inline, as we are recording.Gravatar reed@google.com2011-06-21
| | | | | | | | | | | | | | | | | | | SkGPipe needs this, since it cannot (unlike SkPicture) see all of the factories before it hands its data to the reader. In this mode, the writer embedds the factory name the first time it sees it, and then after that writes an index (referencing the fFactorySet). The reader installs an empty array, and as it encounters names, appends them to that array so that subsequent indices can be used to retrieve the previously named factory. Some of the existing patheffects did not register their factory names, so those changes are also part of this CL. Annoyingly, to register your factory using the current scheme, it has to be in the public section of the class definition. git-svn-id: http://skia.googlecode.com/svn/trunk@1663 2bbb7eff-a529-9590-31e7-b0007b416f81
* change string read/write to store length as full 32-bit value. This simplifiesGravatar reed@google.com2011-06-21
| | | | | | | | | the internal logic, and allows SkFlattenable to rely on this when distinguishing between 0 and indices (which will soon be negative) and string-lengths. git-svn-id: http://skia.googlecode.com/svn/trunk@1660 2bbb7eff-a529-9590-31e7-b0007b416f81
* add cross-process option to gpipeGravatar reed@google.com2011-05-23
| | | | | | | | add unittests for reader32 and writer32 git-svn-id: http://skia.googlecode.com/svn/trunk@1397 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix precendence error (== binds tighter than &)Gravatar reed@google.com2011-05-04
| | | | | | | | add new samples to solution git-svn-id: http://skia.googlecode.com/svn/trunk@1240 2bbb7eff-a529-9590-31e7-b0007b416f81
* updated pipeGravatar reed@google.com2011-05-03
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@1231 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix warningsGravatar reed@android.com2009-01-15
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@68 2bbb7eff-a529-9590-31e7-b0007b416f81
* grab from latest androidGravatar reed@android.com2008-12-17
git-svn-id: http://skia.googlecode.com/svn/trunk@27 2bbb7eff-a529-9590-31e7-b0007b416f81