skia2/include/core
commit-bot@chromium.org 19382421b9 Convert SkWriter32 to use an SkTDArray for its internal storage.
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
2014-01-14 20:51:26 +00:00
..
SkAdvancedTypefaceMetrics.h Revert "[PDF] Fix font embedding restrictions." 2013-12-10 17:22:41 +00:00
SkAnnotation.h All SkAnnotations are no-draw. Propose we fold that through. 2013-10-29 20:44:39 +00:00
SkBitmap.h Revert of https://codereview.chromium.org/132643007/ 2014-01-13 20:39:14 +00:00
SkBitmapDevice.h change offset to xy for pixelref subsetting 2014-01-08 15:42:01 +00:00
SkBlitRow.h remove dst/rendertarget support for kARGB_4444_Config 2013-06-21 18:30:53 +00:00
SkBounder.h Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SkCanvas.h remove SkScalarCompare type and header 2013-12-13 21:16:12 +00:00
SkChecksum.h Add SkChecksum::Murmur3. 2013-07-23 20:25:34 +00:00
SkChunkAlloc.h combine glyph and image bulk alloc, and adjust initial alloc size, to reduce total waste from 50% to 30% 2013-06-19 19:25:36 +00:00
SkClipStack.h Avoid re-rendering stencil clip for every draw with reducable clip stack 2013-11-05 15:03:08 +00:00
SkColor.h SkAlpha constant defs 2013-07-19 17:43:27 +00:00
SkColorFilter.h Initial error handling code 2013-10-23 17:06:21 +00:00
SkColorPriv.h SkSplay and SkUnsplay work on any uint32_t, not just SkPMColor. 2013-12-04 00:42:07 +00:00
SkColorShader.h Added print out of SkShader information to debugger 2013-01-15 20:17:47 +00:00
SkColorTable.h move SkImageInfo into its own header 2013-11-13 19:09:13 +00:00
SkComposeShader.h Added print out of SkShader information to debugger 2013-01-15 20:17:47 +00:00
SkData.h SK_ONCE for SkData and SkPathRef 2013-10-23 14:44:08 +00:00
SkDataTable.h Remove SkDataTable from SkFlattenable hierarchy. 2013-10-15 20:39:57 +00:00
SkDeque.h This CL addresses "SkCanvas::save flags are not respected by GPU backend" (https://code.google.com/p/skia/issues/detail?id=1503). 2013-08-16 00:53:34 +00:00
SkDevice.h Remove drawPosTextOnPath() from SkDevice API. 2014-01-13 21:42:25 +00:00
SkDeviceProperties.h Mask orientation and layout correctly. 2013-05-06 22:23:08 +00:00
SkDither.h Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:09:54 +00:00
SkDocument.h remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
SkDraw.h Move distance field font code into GrDistanceFieldTextContext. 2013-12-19 16:12:25 +00:00
SkDrawFilter.h Add GPU support for roundrects 2013-04-25 15:27:00 +00:00
SkDrawLooper.h Initial error handling code 2013-10-23 17:06:21 +00:00
SkEmptyShader.h Added print out of SkShader information to debugger 2013-01-15 20:17:47 +00:00
SkEndian.h SkBitmapHasher: use 64-bit-truncated MD5 instead of 64-bit CityHash 2013-05-03 17:35:39 +00:00
SkError.h Sanitizing source files in Housekeeper-Nightly 2013-09-05 07:01:19 +00:00
SkFixed.h remove SK_SUPPORTED_DEPRECATED_FIXEDROUND, no longer needed 2014-01-06 18:49:32 +00:00
SkFlate.h Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:09:54 +00:00
SkFlattenable.h Initial error handling code 2013-10-23 17:06:21 +00:00
SkFlattenableBuffers.h Fixed more fuzzer issues 2013-12-17 20:49:46 +00:00
SkFlattenableSerialization.h Removed unnecessary define 2013-11-08 15:24:12 +00:00
SkFloatBits.h remove SK_SCALAR_IS_[FLOAT,FIXED] and assume floats 2013-12-17 16:44:46 +00:00
SkFloatingPoint.h Add sk_float_rsqrt with SSE + NEON fast paths. 2013-11-08 20:14:16 +00:00
SkFontHost.h Remove SK_FONTHOST_USES_FONTMGR. 2013-11-11 15:53:29 +00:00
SkFontLCDConfig.h Sanitizing source files in Skia_Periodic_House_Keeping 2013-03-13 07:01:04 +00:00
SkGeometry.h Add implicit hairline conic rendering to GPU 2013-07-12 20:15:34 +00:00
SkGraphics.h Sanitizing source files in Housekeeper-Nightly 2013-09-27 07:01:29 +00:00
SkImage.h remove (now dead code) for SK_SUPPORT_LEGACY_COLORTYPE and SK_SUPPORT_LEGACY_ALPHATYPE 2014-01-13 15:04:50 +00:00
SkImageDecoder.h SkDecodingImageGenerator now uses SkStreamRewindable 2013-12-09 13:45:02 +00:00
SkImageEncoder.h Rewrite SkTRegistry to take any trivially-copyable type. 2013-09-04 17:20:18 +00:00
SkImageFilter.h Make SkImageFilter crop rects relative to the primitive origin, instead of relative to their parent's crop rect. This is required by SVG semantics, and is more sane anyway. 2014-01-03 21:48:22 +00:00
SkImageFilterUtils.h Added ctm matrix to GPU path 2013-08-05 16:53:50 +00:00
SkImageGenerator.h Add Options to SkDecodingImageGenerator, simplify API. 2014-01-02 13:15:13 +00:00
SkImageInfo.h Revert of https://codereview.chromium.org/132643007/ 2014-01-13 20:39:14 +00:00
SkInstCnt.h Make leak counters thread-safe and turn them on by default for Debug 2014-01-14 18:42:26 +00:00
SkLineClipper.h Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SkMallocPixelRef.h Revert "Revert "Revert "Revert of https://codereview.chromium.org/110593003/""" 2014-01-06 17:08:27 +00:00
SkMask.h Guard against most unintentionally ephemeral SkAutoFoo instantiations. 2013-11-18 16:03:59 +00:00
SkMaskFilter.h Rename GPU functions on SkBlurMaskFilter and pass ctm. 2014-01-08 22:25:53 +00:00
SkMath.h Revert "Revert of https://codereview.chromium.org/113823003/" 2013-12-30 14:40:38 +00:00
SkMatrix.h remove SK_SCALAR_IS_[FLOAT,FIXED] and assume floats 2013-12-17 16:44:46 +00:00
SkMetaData.h Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SkOnce.h Make leak counters thread-safe and turn them on by default for Debug 2014-01-14 18:42:26 +00:00
SkOSFile.h Fix bug in setting directories for tests. 2013-06-06 14:59:56 +00:00
SkPackBits.h Automatic update of all copyright notices to reflect new license terms. 2011-07-28 14:26:00 +00:00
SkPaint.h Move distance field font code into GrDistanceFieldTextContext. 2013-12-19 16:12:25 +00:00
SkPaintOptionsAndroid.h We don't flatten or unflatten SkPaintOptionsAndroid. Reproduce and fix. 2013-09-26 15:16:12 +00:00
SkPath.h Improved SkPathRef interface security 2013-12-13 19:36:25 +00:00
SkPathEffect.h Initial error handling code 2013-10-23 17:06:21 +00:00
SkPathMeasure.h add SK_API 2013-05-08 13:25:02 +00:00
SkPathRef.h Sanitizing source files in Housekeeper-Nightly 2013-12-16 07:01:40 +00:00
SkPicture.h change offset to xy for pixelref subsetting 2014-01-08 15:42:01 +00:00
SkPixelRef.h remove remaining references to Sk64 (obsolete) 2014-01-13 14:53:55 +00:00
SkPoint.h Add sk_float_rsqrt with SSE + NEON fast paths. 2013-11-08 20:14:16 +00:00
SkPostConfig.h Make leak counters thread-safe and turn them on by default for Debug 2014-01-14 18:42:26 +00:00
SkPreConfig.h remove SK_SCALAR_IS_[FLOAT,FIXED] and assume floats 2013-12-17 16:44:46 +00:00
SkRasterizer.h Initial error handling code 2013-10-23 17:06:21 +00:00
SkReader32.h Checking structure sizes before reading them from memory to avoid overflowing the buffer's stream. 2013-11-05 15:46:56 +00:00
SkRect.h speedup SkRect::intersect 2014-01-01 20:32:45 +00:00
SkRefCnt.h Split atomic and mutex implementations and make inlinable. 2013-12-18 15:27:39 +00:00
SkRegion.h Checking structure sizes before reading them from memory to avoid overflowing the buffer's stream. 2013-11-05 15:46:56 +00:00
SkRRect.h Add SkRRect::transform. 2013-11-05 15:54:42 +00:00
SkScalar.h Renamed JsCanvas to JsContext and moved into it's own file. 2014-01-06 18:17:24 +00:00
SkShader.h Update documentation around drawBitmap and shaders 2013-12-05 15:43:19 +00:00
SkSize.h deprecate SkScalarRound (and its ilk), use SkScalarRound[ToInt,ToScalar]. #define SK_SUPPORT_DEPRECATED_SCALARROUND for legacy clients 2013-12-17 19:22:07 +00:00
SkStream.h Remove backward compatibility shims from SkStream.h. 2013-11-13 19:53:46 +00:00
SkString.h remove SK_SCALAR_IS_[FLOAT,FIXED] and assume floats 2013-12-17 16:44:46 +00:00
SkStringUtils.h Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-29 07:05:52 +00:00
SkStrokeRec.h Make GrContext cache the gpu paths 2013-11-01 15:23:44 +00:00
SkSurface.h use SkImageInfo directly, instead of converting to SkBitmap::Config 2014-01-08 21:25:26 +00:00
SkTArray.h Repurpose GrGLCoordTransform as GrGLProgramEffects 2013-10-03 15:17:58 +00:00
SkTDArray.h Third wave of Win64 warning cleanup 2013-10-16 17:48:11 +00:00
SkTDict.h Make SkTDArray accessors const-friendly. 2013-02-28 19:03:13 +00:00
SkTDStack.h Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SkTemplates.h Revert r1784: SK_API on a non-concrete template is strange. 2013-10-30 22:22:05 +00:00
SkThread.h Use a spinlock in SkOnce. 2014-01-08 21:15:56 +00:00
SkTileGridPicture.h Sanitizing source files in Skia_Periodic_House_Keeping 2013-03-01 12:12:55 +00:00
SkTime.h Guard against most unintentionally ephemeral SkAutoFoo instantiations. 2013-11-18 16:03:59 +00:00
SkTInternalLList.h Make SkTInternalLList::validate validate all nodes 2013-12-04 14:51:31 +00:00
SkTLazy.h Sanitizing source files in Skia_Periodic_House_Keeping 2013-04-02 07:01:34 +00:00
SkTrace.h Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SkTRegistry.h Rewrite SkTRegistry to take any trivially-copyable type. 2013-09-04 17:20:18 +00:00
SkTSearch.h One SkTSearch to rule them all. Allow key to be of different type than the array. 2013-05-17 19:05:03 +00:00
SkTypeface.h Fix race on creating the default typeface. 2014-01-09 17:13:32 +00:00
SkTypes.h remove (now unused) Sk64 -- just use int64_t 2014-01-10 22:05:41 +00:00
SkUnitMapper.h Initial error handling code 2013-10-23 17:06:21 +00:00
SkUnPreMultiply.h Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:09:54 +00:00
SkUtils.h More Windows 64b compilation warning fixes 2013-11-21 14:24:16 +00:00
SkWeakRefCnt.h Split atomic and mutex implementations and make inlinable. 2013-12-18 15:27:39 +00:00
SkWriter32.h Convert SkWriter32 to use an SkTDArray for its internal storage. 2014-01-14 20:51:26 +00:00
SkXfermode.h Revert "Revert "add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it triggers a warning"" 2013-10-31 17:28:30 +00:00