skia2/samplecode
scroggo a1193e4b0e Make SkStream *not* ref counted.
SkStream is a stateful object, so it does not make sense for it to have
multiple owners. Make SkStream inherit directly from SkNoncopyable.

Update methods which previously called SkStream::ref() (e.g.
SkImageDecoder::buildTileIndex() and SkFrontBufferedStream::Create(),
which required the existing owners to call SkStream::unref()) to take
ownership of their SkStream parameters and delete when done (including
on failure).

Switch all SkAutoTUnref<SkStream>s to SkAutoTDelete<SkStream>s. In some
cases this means heap allocating streams that were previously stack
allocated.

Respect ownership rules of SkTypeface::CreateFromStream() and
SkImageDecoder::buildTileIndex().

Update the comments for exceptional methods which do not affect the
ownership of their SkStream parameters (e.g.
SkPicture::CreateFromStream() and SkTypeface::Deserialize()) to be
explicit about ownership.

Remove test_stream_life, which tested that buildTileIndex() behaved
correctly when SkStream was a ref counted object. The test does not
make sense now that it is not.

In SkPDFStream, remove the SkMemoryStream member. Instead of using it,
create a new SkMemoryStream to pass to fDataStream (which is now an
SkAutoTDelete).

Make other pdf rasterizers behave like SkPDFDocumentToBitmap.

SkPDFDocumentToBitmap delete the SkStream, so do the same in the
following pdf rasterizers:

SkPopplerRasterizePDF
SkNativeRasterizePDF
SkNoRasterizePDF

Requires a change to Android, which currently treats SkStreams as ref
counted objects.

Review URL: https://codereview.chromium.org/849103004
2015-01-21 12:09:53 -08:00
..
ClockFaceView.cpp Revert of remove unused SkAvoidXfermode (patchset #2 id:20001 of https://codereview.chromium.org/860583002/) 2015-01-20 06:33:14 -08:00
GMSampleView.h Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
OverView.cpp Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
OverView.h Add a header for OverView.cpp as well. 2012-09-18 01:52:20 +00:00
Sample2PtRadial.cpp Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/) 2012-08-23 18:19:56 +00:00
SampleAAClip.cpp replace SkBitmap::Config with SkColorType in gms 2014-02-17 21:21:46 +00:00
SampleAARectModes.cpp Move SkShader::fLocalMatrix into SkShader constructor. 2014-04-28 14:55:39 +00:00
SampleAARects.cpp use SkColorType instead of SkBitmap::Config in samplecode 2014-02-17 02:55:57 +00:00
SampleAll.cpp Revert of remove unused SkAvoidXfermode (patchset #2 id:20001 of https://codereview.chromium.org/860583002/) 2015-01-20 06:33:14 -08:00
SampleAnimatedGradient.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleAnimator.cpp Make SkStream *not* ref counted. 2015-01-21 12:09:53 -08:00
SampleAnimBlur.cpp move common blur types into central header 2014-04-28 16:25:35 +00:00
SampleApp.cpp delete the dreaded TransitionView 2015-01-13 19:43:04 -08:00
SampleApp.h Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SampleArc.cpp Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SampleAvoid.cpp Revert of remove unused SkAvoidXfermode (patchset #2 id:20001 of https://codereview.chromium.org/860583002/) 2015-01-20 06:33:14 -08:00
SampleBigBlur.cpp move common blur types into central header 2014-04-28 16:25:35 +00:00
SampleBigGradient.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleBitmapRect.cpp use surface in SkView/SampleApp 2014-09-18 11:29:01 -07:00
SampleBlur.cpp move common blur types into central header 2014-04-28 16:25:35 +00:00
SampleBox.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleCamera.cpp Move SkShader::fLocalMatrix into SkShader constructor. 2014-04-28 14:55:39 +00:00
SampleChart.cpp Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SampleCircle.cpp add peekPixels to SkCanvas and SkSurface 2014-02-13 17:14:46 +00:00
SampleClamp.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleClip.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
SampleClock.cpp Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SampleCode.h Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SampleColorFilter.cpp Move SkShader::fLocalMatrix into SkShader constructor. 2014-04-28 14:55:39 +00:00
SampleComplexClip.cpp fix more 64bit warnings 2014-01-27 13:42:58 +00:00
SampleConcavePaths.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleCull.cpp 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
SampleDash.cpp Move SkShader::fLocalMatrix into SkShader constructor. 2014-04-28 14:55:39 +00:00
SampleDegenerateTwoPtRadials.cpp remove remaining references to Sk64 (obsolete) 2014-01-13 14:53:55 +00:00
SampleDither.cpp add new copyTo version to SkBitmap, which takes SkColorType 2014-02-23 03:59:35 +00:00
SampleDitherBitmap.cpp remove alphatype from colortable 2014-09-29 12:10:27 -07:00
SampleDraw.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleEffects.cpp move common blur types into central header 2014-04-28 16:25:35 +00:00
SampleEmboss.cpp remove unused Kernel33MaskFilter 2014-05-12 13:35:55 +00:00
SampleEmptyPath.cpp Clean up SkTypes.h. 2013-10-11 18:50:45 +00:00
SampleEncode.cpp add ImageGenerator::NewFromData to porting layer 2015-01-07 18:04:45 -08:00
SampleFatBits.cpp Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SampleFillType.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleFilter2.cpp hide Config in SkImageDecoder -- use SkColorType instead 2014-06-12 17:40:00 -07:00
SampleFilter.cpp hide SkBitmap::Config entirely (behind a flag) 2014-06-17 08:38:31 -07:00
SampleFilterFuzz.cpp remove unused drawData 2015-01-02 06:39:51 -08:00
SampleFilterQuality.cpp fatbits for all 4 views 2015-01-17 19:36:08 -08:00
SampleFontCache.cpp use SkColorType instead of SkBitmap::Config in samplecode 2014-02-17 02:55:57 +00:00
SampleFontScalerTest.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
SampleFuzz.cpp move common blur types into central header 2014-04-28 16:25:35 +00:00
SampleGradients.cpp Remove unused (by clients) SkUnitMapper 2014-05-22 12:27:41 +00:00
SampleHairCurves.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
SampleHairline.cpp Revert "Revert of add colortable support to imagegenerator (https://codereview.chromium.org/304443003/)" 2014-05-29 15:57:20 +00:00
SampleHairModes.cpp Move SkShader::fLocalMatrix into SkShader constructor. 2014-04-28 14:55:39 +00:00
SampleHT.cpp add sample to exercising hittesting 2014-11-26 08:45:36 -08:00
SampleIdentityScale.cpp Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SampleLayerMask.cpp Reduce internal explicit SaveFlags usage. 2014-04-18 14:19:31 +00:00
SampleLayers.cpp Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SampleLCD.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleLines.cpp Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SampleLua.cpp Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SampleManyRects.cpp Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SampleMeasure.cpp remove (unused) scale parameter from measureText 2014-08-26 11:30:01 -07:00
SampleMipMap.cpp use SkColorType instead of SkBitmap::Config in samplecode 2014-02-17 02:55:57 +00:00
SampleMovie.cpp Fix more clang errors. 2013-04-05 21:13:14 +00:00
SampleOvalTest.cpp Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SamplePatch.cpp parameterize tesselation params 2014-08-06 09:54:19 -07:00
SamplePath.cpp Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SamplePathClip.cpp Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SamplePathEffects.cpp Builder class for SkLayerRasterizer. 2014-02-26 13:27:37 +00:00
SamplePathFill.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SamplePathUtils.cpp Factory methods for heap-allocated SkPathEffect and SkXfermode objects. 2014-02-20 20:40:19 +00:00
SamplePdfFileViewer.cpp remove remaining references to Sk64 (obsolete) 2014-01-13 14:53:55 +00:00
SamplePictFile.cpp Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SamplePicture.cpp add ImageGenerator::NewFromData to porting layer 2015-01-07 18:04:45 -08:00
SamplePoints.cpp remove unused Kernel33MaskFilter 2014-05-12 13:35:55 +00:00
SamplePolyToPoly.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
SampleRectanizer.cpp Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SampleRegion.cpp Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SampleRepeatTile.cpp Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SampleRotateCircles.cpp Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SampleShaders.cpp Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SampleShaderText.cpp remove unneeded inval 2014-06-02 14:41:24 -07:00
SampleSkLayer.cpp 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
SampleSlides.cpp Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SampleSpiral.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleStringArt.cpp Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SampleStrokePath.cpp Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SampleStrokeRect.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleSubpixelTranslate.cpp Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SampleText.cpp Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SampleTextAlpha.cpp Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SampleTextBox.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleTextOnPath.cpp Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SampleTextureDomain.cpp SkCanvas::drawImage is the new way for drawing a SkImage to a Canvas 2014-09-24 13:03:30 -07:00
SampleTiling.cpp "NULL !=" = NULL 2014-09-05 13:34:00 -07:00
SampleTinyBitmap.cpp use SkColorType instead of SkBitmap::Config in samplecode 2014-02-17 02:55:57 +00:00
SampleUnpremul.cpp Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SampleVertices.cpp Fix up all the easy virtual ... SK_OVERRIDE cases. 2015-01-09 10:06:40 -08:00
SampleWarp.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleWritePixels.cpp use SkColorType instead of SkBitmap::Config in samplecode 2014-02-17 02:55:57 +00:00
SampleXfermodesBlur.cpp Revert "Revert of add colortable support to imagegenerator (https://codereview.chromium.org/304443003/)" 2014-05-29 15:57:20 +00:00
vertexdump.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00