skia2/samplecode
reed 320a40d773 Always return ImageShader, even from SkShader::MakeBitmapShader
Lessons learned

1. ImageShader (correctly) always compresses (typically via PNG) during serialization. This has the surprise results of
- if the image was marked opaque, but has some non-opaque pixels (i.e. bug in blitter or caller), then compressing may "fix" those pixels, making the deserialized version draw differently. bug filed.
- 565 compressess/decompresses to 8888 (at least on Mac), which draws differently (esp. under some filters). bug filed.

2. BitmapShader did not enforce a copy for mutable bitmaps, but ImageShader does (since it creates an Image). Thus the former would see subsequent changes to the pixels after shader creation, while the latter does not, hence the change to the BlitRow test to avoid this modify-after-create pattern. I sure hope this prev. behavior was a bug/undefined-behavior, since this CL changes that.

BUG=skia:5595
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2195893002

Review-Url: https://codereview.chromium.org/2195893002
2016-08-02 06:12:06 -07:00
..
ClockFaceView.cpp Add samples to Viewer. 2016-06-16 09:52:35 -07:00
DecodeFile.h Remove uses of SkImageDecoder from samplecode 2016-03-18 15:48:49 -07:00
GMSampleView.cpp move colorshader into its own .cpp, add color4f variant 2016-05-04 13:09:39 -07:00
GMSampleView.h C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla} 2015-03-25 18:17:32 -07:00
OverView.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
OverView.h Add a header for OverView.cpp as well. 2012-09-18 01:52:20 +00:00
PerlinPatch.cpp switch xfermodes over to sk_sp 2016-03-29 11:32:50 -07:00
Sample2PtRadial.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleAAClip.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleAAGeometry.cpp toy to play with antialias raytracing 2016-05-27 05:13:26 -07:00
SampleAARectModes.cpp Rein in the use of SkDevice.h 2016-04-20 05:29:51 -07:00
SampleAARects.cpp Rein in the use of SkDevice.h 2016-04-20 05:29:51 -07:00
SampleAll.cpp SkTypeface::MakeFromName to take SkFontStyle. 2016-05-31 11:42:37 -07:00
SampleAnimatedText.cpp Move SkTypeface to sk_sp. 2016-05-12 10:09:31 -07:00
SampleAnimator.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleAnimBlur.cpp switch maskfilters to sk_sp 2016-04-04 10:02:58 -07:00
SampleApp.cpp Remove GrContext::applyGamma 2016-07-29 08:28:25 -07:00
SampleApp.h Remove use of MakeRenderTargetDirect from view system 2016-07-28 15:17:34 -07:00
SampleArc.cpp return pictures as sk_sp 2016-03-18 07:25:55 -07:00
SampleAtlas.cpp Add samples to Viewer. 2016-06-16 09:52:35 -07:00
SampleBigBlur.cpp switch maskfilters to sk_sp 2016-04-04 10:02:58 -07:00
SampleBigGradient.cpp use Make instead of Create to return a shared shader 2016-03-08 18:50:00 -08:00
SampleBitmapRect.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleBlur.cpp switch maskfilters to sk_sp 2016-04-04 10:02:58 -07:00
SampleCamera.cpp move setshader to sk_sp, re-using SK_SUPPORT_LEGACY_CREATESHADER_PTR 2016-03-25 09:08:00 -07:00
SampleChart.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
SampleCircle.cpp Factor code to rotate a canvas about a point. 2016-07-12 15:01:19 -07:00
SampleClamp.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleClip.cpp Rein in the use of SkDevice.h 2016-04-20 05:29:51 -07:00
SampleClipDrawMatch.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleClock.cpp Add samples to Viewer. 2016-06-16 09:52:35 -07:00
SampleCode.cpp Add samples to Viewer. 2016-06-16 09:52:35 -07:00
SampleCode.h Add samples to Viewer. 2016-06-16 09:52:35 -07:00
SampleColorFilter.cpp Rein in the use of SkDevice.h 2016-04-20 05:29:51 -07:00
SampleComplexClip.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleConcavePaths.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleDash.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleDegenerateTwoPtRadials.cpp use Make instead of Create to return a shared shader 2016-03-08 18:50:00 -08:00
SampleDither.cpp Factor code to rotate a canvas about a point. 2016-07-12 15:01:19 -07:00
SampleDitherBitmap.cpp use Make instead of Create to return a shared shader 2016-03-08 18:50:00 -08:00
SampleDraw.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleEffects.cpp switch maskfilters to sk_sp 2016-04-04 10:02:58 -07:00
SampleEmboss.cpp switch maskfilters to sk_sp 2016-04-04 10:02:58 -07:00
SampleFatBits.cpp switch surface to sk_sp 2016-03-23 18:59:25 -07:00
SampleFillType.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleFilter2.cpp Remove uses of SkImageDecoder from samplecode 2016-03-18 15:48:49 -07:00
SampleFilter.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleFilterFuzz.cpp remove DownSample imagefilter 2016-06-25 14:30:44 -07:00
SampleFilterQuality.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleFontCache.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleFontScalerTest.cpp Factor code to rotate a canvas about a point. 2016-07-12 15:01:19 -07:00
SampleFuzz.cpp switch maskfilters to sk_sp 2016-04-04 10:02:58 -07:00
SampleGradients.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleHairCurves.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleHairline.cpp Remove uses of SkImageDecoder from samplecode 2016-03-18 15:48:49 -07:00
SampleHairModes.cpp Rein in the use of SkDevice.h 2016-04-20 05:29:51 -07:00
SampleHT.cpp Factor code to rotate a canvas about a point. 2016-07-12 15:01:19 -07:00
SampleIdentityScale.cpp Remove uses of SkImageDecoder from samplecode 2016-03-18 15:48:49 -07:00
SampleLayerMask.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
SampleLayers.cpp Hide SkCanvas::LayerIter 2016-04-21 11:05:33 -07:00
SampleLCD.cpp Rein in the use of SkDevice.h 2016-04-20 05:29:51 -07:00
SampleLighting.cpp Always return ImageShader, even from SkShader::MakeBitmapShader 2016-08-02 06:12:06 -07:00
SampleLines.cpp Remove uses of SkImageDecoder from samplecode 2016-03-18 15:48:49 -07:00
SampleLitAtlas.cpp Always return ImageShader, even from SkShader::MakeBitmapShader 2016-08-02 06:12:06 -07:00
SampleLua.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
SampleManyRects.cpp Rein in the use of SkDevice.h 2016-04-20 05:29:51 -07:00
SampleMeasure.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleMegaStroke.cpp add new tests 2016-01-30 10:11:21 -08:00
SamplePatch.cpp Remove uses of SkImageDecoder from samplecode 2016-03-18 15:48:49 -07:00
SamplePath.cpp Reverse dependency between SkScalar.h and SkFixed.h. 2016-04-07 08:49:31 -07:00
SamplePathClip.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SamplePathEffects.cpp guard rasterizer and drawlooper setters 2016-03-21 13:25:16 -07:00
SamplePathFill.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SamplePathFuzz.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SamplePathOverstroke.cpp Add cubic example and draw original path 2016-06-30 10:04:21 -07:00
SamplePdfFileViewer.cpp Remove uses of SkImageDecoder from samplecode 2016-03-18 15:48:49 -07:00
SamplePictFile.cpp Remove uses of SkImageDecoder from samplecode 2016-03-18 15:48:49 -07:00
SamplePoints.cpp Remove uses of SkImageDecoder from samplecode 2016-03-18 15:48:49 -07:00
SamplePolyToPoly.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleQuadStroker.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleRectanizer.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleRegion.cpp Remove uses of SkImageDecoder from samplecode 2016-03-18 15:48:49 -07:00
SampleRepeatTile.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleShaders.cpp switch xfermodes over to sk_sp 2016-03-29 11:32:50 -07:00
SampleShaderText.cpp use Make instead of Create to return a shared shader 2016-03-08 18:50:00 -08:00
SampleShip.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleSkLayer.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleSlides.cpp SkTypeface::MakeFromName to take SkFontStyle. 2016-05-31 11:42:37 -07:00
SampleStringArt.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
SampleStrokePath.cpp switch maskfilters to sk_sp 2016-04-04 10:02:58 -07:00
SampleStrokeRect.cpp Rein in the use of SkDevice.h 2016-04-20 05:29:51 -07:00
SampleSubpixelTranslate.cpp Remove uses of SkImageDecoder from samplecode 2016-03-18 15:48:49 -07:00
SampleSVGFile.cpp Initial SVG model 2016-07-26 18:46:34 -07:00
SampleText.cpp Move SkTypeface to sk_sp. 2016-05-12 10:09:31 -07:00
SampleTextAlpha.cpp Rein in the use of SkDevice.h 2016-04-20 05:29:51 -07:00
SampleTextBox.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleTextOnPath.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleTextureDomain.cpp switch maskfilters to sk_sp 2016-04-04 10:02:58 -07:00
SampleTiling.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleTinyBitmap.cpp use Make instead of Create to return a shared shader 2016-03-08 18:50:00 -08:00
SampleUnpremul.cpp guard rasterizer and drawlooper setters 2016-03-21 13:25:16 -07:00
SampleVertices.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleWritePixels.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleXfer.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleXfermodesBlur.cpp SkTypeface::MakeFromName to take SkFontStyle. 2016-05-31 11:42:37 -07:00
vertexdump.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00