skia2/include/core
commit-bot@chromium.org f7efa502d6 Implement intra-frame cacheing in image filters.
When image filters are processed within Skia, they simply do
a blind recursion. This has the side-effect of turning the
DAG into a tree. I.e., nodes visited more than once during
the traversal will be processed more than once.

This change implements a very simple cacheing scheme: a
cache is created before traversing the DAG, and handed
into the processing traversal. Before recursing into a child
in SkImageFilter::filterImage(), the cache is checked for a
hit, and early-out is performed. Otherwise, the node is
processed, and its result bitmap and location (offset) are
cached, but only if it contains two or more children and
thus will be visited again during the traversal.

Currently, the child count is approximated with the
refcount. This is good enough in most cases (and exactly
correct for the Chrome use case). We could add an exact
child count to the image filter, but this will require
violating the immutability of image filters slightly in
order to bump the child count as nodes are connected. I
leave it up to the reviewer to decide which is better.

R=reed@google.com

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/230653005

git-svn-id: http://skia.googlecode.com/svn/trunk@14160 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-04-11 18:57:00 +00:00
..
SkAdvancedTypefaceMetrics.h Drop executable flag from headers so that they can be packaged 2014-03-11 19:55:51 +00:00
SkAnnotation.h Factory methods for heap-allocated SkAnnotation objects. 2014-02-27 11:47:36 +00:00
SkBitmap.h SkNonCopyable should be used with private inheritance. 2014-04-07 19:34:38 +00:00
SkBitmapDevice.h remove SK_SUPPORT_LEGACY_COMPATIBLEDEVICE_CONFIG 2014-04-07 21:33:06 +00:00
SkBlitRow.h
SkBounder.h
SkCanvas.h remove picture-backed surfaces 2014-04-11 18:34:35 +00:00
SkChecksum.h
SkChunkAlloc.h
SkClipStack.h Use SkTLazy to hold path in SkClipStack::Element 2014-02-27 17:39:46 +00:00
SkColor.h
SkColorFilter.h Allow toString capability to be toggled independent of developer mode. 2014-03-13 18:02:17 +00:00
SkColorPriv.h Revert "Revert of implement readPixels and writePixels natively, w/o using the (deprecated) (https://codereview.chromium.org/199733016/)" 2014-03-25 16:20:24 +00:00
SkColorShader.h Allow toString capability to be toggled independent of developer mode. 2014-03-13 18:02:17 +00:00
SkColorTable.h Refactor read and write buffers. 2014-01-30 18:58:24 +00:00
SkComposeShader.h Allow toString capability to be toggled independent of developer mode. 2014-03-13 18:02:17 +00:00
SkData.h SkOnce: add option to call another cleanup function once at exit. 2014-01-24 22:38:39 +00:00
SkDataTable.h
SkDeque.h
SkDevice.h Update bench to be able to preprocess skps 2014-04-11 15:54:14 +00:00
SkDeviceProperties.h Clean up the default gamma settings. 2014-04-10 22:26:29 +00:00
SkDither.h
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
SkDrawLooper.h SkNonCopyable should be used with private inheritance. 2014-04-07 19:34:38 +00:00
SkDynamicAnnotations.h TSAN: use somewhat pithier SK_ANNOTATE_UNPROTECTED_READ. 2014-02-04 18:00:23 +00:00
SkEmptyShader.h Allow toString capability to be toggled independent of developer mode. 2014-03-13 18:02:17 +00:00
SkEndian.h
SkError.h
SkFixed.h remove SK_SUPPORTED_DEPRECATED_FIXEDROUND, no longer needed 2014-01-06 18:49:32 +00:00
SkFlate.h
SkFlattenable.h Refactor read and write buffers. 2014-01-30 18:58:24 +00:00
SkFlattenableBuffers.h Refactor read and write buffers. 2014-01-30 18:58:24 +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
SkFont.h Sanitizing source files in Housekeeper-Nightly 2014-04-09 03:04:11 +00:00
SkFontHost.h Remove SK_FONTHOST_USES_FONTMGR. 2013-11-11 15:53:29 +00:00
SkFontLCDConfig.h
SkGeometry.h Stub for conic section max curvature 2014-02-21 19:49:10 +00:00
SkGraphics.h
SkImage.h Revert of Revert "Serialization of SkPictureImageFilter" (https://codereview.chromium.org/153583007/) 2014-02-07 12:20:04 +00:00
SkImageDecoder.h SkNonCopyable should be used with private inheritance. 2014-04-07 19:34:38 +00:00
SkImageEncoder.h
SkImageFilter.h Implement intra-frame cacheing in image filters. 2014-04-11 18:57:00 +00:00
SkImageGenerator.h Add Options to SkDecodingImageGenerator, simplify API. 2014-01-02 13:15:13 +00:00
SkImageInfo.h Revert of Revert of Rename kPMColor_SkColorType to kN32_SkColorType. (https://codereview.chromium.org/234243002/) 2014-04-11 17:15:40 +00:00
SkInstCnt.h Make leak counters thread-safe and turn them on by default for Debug 2014-01-17 17:55:02 +00:00
SkLineClipper.h
SkMallocPixelRef.h Refactor read and write buffers. 2014-01-30 18:58:24 +00:00
SkMask.h Guard against most unintentionally ephemeral SkAutoFoo instantiations. 2013-11-18 16:03:59 +00:00
SkMaskFilter.h Allow toString capability to be toggled independent of developer mode. 2014-03-13 18:02:17 +00:00
SkMath.h Revert "Revert of https://codereview.chromium.org/113823003/" 2013-12-30 14:40:38 +00:00
SkMatrix.h Remove SkCanvas matrix ops return value. 2014-03-18 12:51:48 +00:00
SkMetaData.h
SkOnce.h ARM Skia NEON patches - 35 - First AArch64 support 2014-04-02 15:03:56 +00:00
SkOSFile.h
SkPackBits.h
SkPaint.h Revert of Implement text rendering with NVPR (https://codereview.chromium.org/196133014/) 2014-03-27 14:19:17 +00:00
SkPaintOptionsAndroid.h Refactor read and write buffers. 2014-01-30 18:58:24 +00:00
SkPath.h Revert of r13379 (Move fLastMoveToIndex from SkPath to SkPathRef - https://codereview.chromium.org/146913002/) due to image quality regression in Chromium. See crbug.com/343123 (Regression - UI issue observed for any "Notification infobars" in Chrome browser) 2014-02-12 17:44:30 +00:00
SkPathEffect.h Factory methods for heap-allocated SkPathEffect and SkXfermode objects. 2014-02-20 20:40:19 +00:00
SkPathMeasure.h
SkPathRef.h Revert of r13379 (Move fLastMoveToIndex from SkPath to SkPathRef - https://codereview.chromium.org/146913002/) due to image quality regression in Chromium. See crbug.com/343123 (Regression - UI issue observed for any "Notification infobars" in Chrome browser) 2014-02-12 17:44:30 +00:00
SkPicture.h SkNonCopyable should be used with private inheritance. 2014-04-07 19:34:38 +00:00
SkPixelRef.h remove SK_SUPPORT_LEGACY_ONLOCKPIXELS completely 2014-02-10 15:43:29 +00:00
SkPoint.h remove SkScalarMul from public headers 2014-01-27 13:41:02 +00:00
SkPostConfig.h Clean up the default gamma settings. 2014-04-10 22:26:29 +00:00
SkPreConfig.h Define SK_CPU_X86 on x86 machines. 2014-04-09 16:50:55 +00:00
SkRasterizer.h Builder class for SkLayerRasterizer. 2014-02-26 13:27:37 +00:00
SkReadBuffer.h Relax the assert in SkReadBuffer::setPictureVersion(). 2014-04-08 14:11:26 +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 SkNonCopyable should be used with private inheritance. 2014-04-07 19:34:38 +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 nine patch type to SkRRect. 2014-03-17 21:17:30 +00:00
SkScalar.h remove SkScalarMul from public headers 2014-01-27 13:41:02 +00:00
SkShader.h Initial picture shader implementation 2014-04-08 15:19:34 +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 Add size_t bytesWritten() const to SkWStream. 2014-03-06 17:16:26 +00:00
SkString.h remove SK_SCALAR_IS_[FLOAT,FIXED] and assume floats 2013-12-17 16:44:46 +00:00
SkStringUtils.h
SkStrokeRec.h
SkSurface.h remove picture-backed surfaces 2014-04-11 18:34:35 +00:00
SkTArray.h Have SkTArray state that it default-initializes. 2014-03-24 15:55:01 +00:00
SkTDArray.h SkWriter32: throw in the SkTDArray towel. 2014-02-13 18:35:54 +00:00
SkTDict.h
SkTDStack.h
SkTemplates.h Fold SkTSetBit into SkOTSet*Bit. 2014-04-01 16:11:53 +00:00
SkThread.h SkOnce in is_lcd_supported instead of hand rolled double-checked locking. 2014-02-10 19:58:49 +00:00
SkTileGridPicture.h
SkTime.h Guard against most unintentionally ephemeral SkAutoFoo instantiations. 2013-11-18 16:03:59 +00:00
SkTInternalLList.h SkNonCopyable should be used with private inheritance. 2014-04-07 19:34:38 +00:00
SkTLazy.h Use SkTLazy to hold path in SkClipStack::Element 2014-02-27 17:39:46 +00:00
SkTRegistry.h
SkTSearch.h
SkTypeface.h move getAdvancedTypefaceMetrics into private, as only skia internals call it 2014-01-27 21:02:14 +00:00
SkTypes.h SkNonCopyable should be used with private inheritance. 2014-04-07 19:34:38 +00:00
SkUnitMapper.h Refactor read and write buffers. 2014-01-30 18:58:24 +00:00
SkUnPreMultiply.h Factor out UnPreMultiplyPreservingByteOrder 2014-01-15 22:24:58 +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
SkWriteBuffer.h Set write buffer flags only in SkWriteBuffer and SkFlatController constructors. 2014-01-30 22:16:32 +00:00
SkWriter32.h Add capture snapshot as data to SkWriter32, use it to optimise record->playback. 2014-03-12 17:04:28 +00:00
SkXfermode.h Real fix for SK_API / Windows shared lib problems. 2014-04-09 22:54:57 +00:00