skia2/samplecode
halcanary@google.com 3d50ea1b87 Add Options to SkDecodingImageGenerator, simplify API.
Motivation: We want to remove redundant classes from Skia.  To
that end we want to remove SkImageRef and its subclasses and
replace their uses with SkDiscardablePixelRef +
SkDecodingImageGenerator.  Since Android uses SkImageRef, we need
to make sure that SkDecodingImageGenerator allows all of the
settings that Android exposes in BitmapFactory.Options.

To that end, we have created an Options struct for the
SkDecodingImageGenerator which lets the client of the generator set
sample size, dithering, and bitmap config.

We have made the SkDecodingImageGenerator constructor private
and replaced the SkDecodingImageGenerator::Install functions
with a SkDecodingImageGenerator::Create functions (one for
SkData and one for SkStream) which now take a
SkDecodingImageGenerator::Options struct.

Also added a ImageDecoderOptions test which loops through a list
of sets of options and tries them on a set of 5 small encoded
images.

Also updated several users of SkDecodingImageGenerator::Install to
follow new call signature - gm/factory.cpp, LazyDecodeBitmap.cpp,
and PictureTest.cpp, CachedDecodingPixelRefTest.cpp.

We also added a new ImprovedBitmapFactory Test which simulates the
exact function that Android will need to modify to use this,
installPixelRef() in BitmapFactory.

R=reed@google.com, scroggo@google.com

Committed: https://code.google.com/p/skia/source/detail?r=12744

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

git-svn-id: http://skia.googlecode.com/svn/trunk@12855 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-01-02 13:15:13 +00:00
..
ClockFaceView.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
GMSampleView.h Fix clang warning in GMSampleView.h 2012-11-20 16:36:20 +00:00
OverView.cpp Removes uses of unnamed namespace from samplecode. 2013-09-13 12:39:55 +00: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 Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleAARectModes.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleAARects.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
SampleAll.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
SampleAnimatedGradient.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleAnimator.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleAnimBlur.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
SampleApp.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
SampleApp.h Add SkTileGridPicture SampleApp playback support. 2013-12-10 21:51:06 +00:00
SampleArc.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
SampleAvoid.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleBigBlur.cpp Push sigma-based blur interface into our GMs/benches/tests/samplecode 2013-09-06 14:16:12 +00:00
SampleBigGradient.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleBitmapRect.cpp 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
SampleBlur.cpp Revert "Revert "change SkColorTable to be immutable"" 2013-10-10 14:44:56 +00:00
SampleBox.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleCamera.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleChart.cpp Removes uses of unnamed namespace from samplecode. 2013-09-13 12:39:55 +00:00
SampleCircle.cpp remove SK_SCALAR_IS_[FLOAT,FIXED] and assume floats 2013-12-17 16:44: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 Add Clock Sample. 2013-09-17 19:52:05 +00:00
SampleCode.h Add SkTileGridPicture SampleApp playback support. 2013-12-10 21:51:06 +00:00
SampleColorFilter.cpp Prototype for build warning as error. 2013-06-14 15:44:11 +00:00
SampleComplexClip.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +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 Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleDegenerateTwoPtRadials.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
SampleDither.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
SampleDitherBitmap.cpp store SkAlphaType inside SkBitmap, on road to support unpremul 2013-10-21 14:00:07 +00:00
SampleDraw.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleEffects.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
SampleEmboss.cpp Push sigma-based blur interface into our GMs/benches/tests/samplecode 2013-09-06 14:16:12 +00:00
SampleEmptyPath.cpp Clean up SkTypes.h. 2013-10-11 18:50:45 +00:00
SampleEncode.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleFatBits.cpp move SkImage::ColorType into SkColorType 2013-11-01 13:46:54 +00:00
SampleFillType.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleFilter2.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
SampleFilter.cpp Reverting r12427 2013-12-02 13:50:38 +00:00
SampleFilterFuzz.cpp Fixed more fuzzer issues 2013-12-17 20:49:46 +00:00
SampleFontCache.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
SampleFontScalerTest.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
SampleFuzz.cpp Sanitizing source files in Housekeeper-Nightly 2013-09-07 07:01:16 +00:00
SampleGradients.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +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 remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
SampleHairModes.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleLayerMask.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
SampleLayers.cpp Guard against most unintentionally ephemeral SkAutoFoo instantiations. 2013-11-18 16:03:59 +00:00
SampleLCD.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleLines.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
SampleLua.cpp add drawImage to lua 2013-06-11 02:20:28 +00:00
SampleManyRects.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
SampleMeasure.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleMipMap.cpp Sanitizing source files in Housekeeper-Nightly 2013-07-25 07:01:00 +00:00
SampleMovie.cpp Fix more clang errors. 2013-04-05 21:13:14 +00:00
SampleOvalTest.cpp Fixing some warnings on Linux 2013-03-07 20:52:59 +00:00
SamplePatch.cpp 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
SamplePath.cpp Clean up SkTypes.h. 2013-10-11 18:50:45 +00:00
SamplePathClip.cpp Fixing some warnings on Linux 2013-03-07 20:52:59 +00:00
SamplePathEffects.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
SamplePathFill.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SamplePathUtils.cpp Sanitizing source files in Housekeeper-Nightly 2013-07-10 07:00:58 +00:00
SamplePdfFileViewer.cpp Pdfviewer refactoring. 2013-11-14 19:09:27 +00:00
SamplePictFile.cpp More signed/unsigned comparison warnings. 2013-12-10 22:25:53 +00:00
SamplePicture.cpp Add Options to SkDecodingImageGenerator, simplify API. 2014-01-02 13:15:13 +00:00
SamplePoints.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
SamplePolyToPoly.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
SampleRegion.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
SampleRepeatTile.cpp Removed unused parameters 2013-03-12 14:36:57 +00:00
SampleRotateCircles.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
SampleShaders.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleShaderText.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00: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 remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
SampleSpiral.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleStringArt.cpp Type warning fix for: Add string art GM and sample. 2013-09-19 16:32:49 +00:00
SampleStrokePath.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
SampleStrokeRect.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleTests.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleText.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
SampleTextAlpha.cpp Change old PRG to be SkLCGRandom; change new one to SkRandom 2013-09-09 20:09:12 +00:00
SampleTextBox.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleTextOnPath.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
SampleTextureDomain.cpp 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
SampleTiling.cpp 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
SampleTinyBitmap.cpp Remove deprecated setIsOpaque() API from SkBitmap. 2013-11-12 18:16:34 +00:00
SampleUnitMapper.cpp Fixing some warnings on Linux 2013-03-07 20:52:59 +00:00
SampleUnpremul.cpp Push sigma-based blur interface into our GMs/benches/tests/samplecode 2013-09-06 14:16:12 +00:00
SampleVertices.cpp 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
SampleWarp.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleWritePixels.cpp Sanitizing source files in Skia_Periodic_House_Keeping 2013-01-26 07:06:02 +00:00
SampleXfermodesBlur.cpp store SkAlphaType inside SkBitmap, on road to support unpremul 2013-10-21 14:00:07 +00:00
TransitionView.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00
TransitionView.h Add a header for OverView.cpp as well. 2012-09-18 01:52:20 +00:00
vertexdump.cpp remove SkFloatToScalar macro 2013-11-25 19:44:07 +00:00