skia2/samplecode
Jim Van Verth 999ec57291 Use int when possible to calculate atlas indices in shaders.
On certain iOS devices half has a mantissa of only 10 bits, which is not
enough to perform the floating point trickery to get the lower bits
out of the "texture coordinates". Instead we use int if available, and
float if not available.

Also re-enables multitexturing for iOS and adds a sample which
stresses the issue.

Bug: skia:7285
Change-Id: I365532c7cbbcca7c7753af209bef46e05be49e11
Reviewed-on: https://skia-review.googlesource.com/71181
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
2017-11-20 18:07:08 +00:00
..
ClockFaceView.cpp Remove internal use of SkTypeface::Style. 2017-07-27 21:30:45 +00:00
DecodeFile.h use unique_ptr for codec factories 2017-07-25 15:35:23 +00:00
GMSampleView.cpp move files out of private, and fix up callers to IWYU 2017-05-16 21:29:03 +00:00
GMSampleView.h Mark overridden destructors with 'override' and remove 'virtual' 2017-03-22 16:06:18 +00:00
OverView.cpp add drawString helper to canvas 2017-04-28 20:41:04 +00:00
OverView.h Add a header for OverView.cpp as well. 2012-09-18 01:52:20 +00:00
PerlinPatch.cpp Remove trailing whitespace. 2017-10-09 21:20:34 +00: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 move parts of SkPoint to SkPointPriv 2017-11-08 18:25:17 +00:00
SampleAARectModes.cpp Use SkBlendMode_Name rather than one-off tables 2017-03-15 16:52:49 +00:00
SampleAARects.cpp Rein in the use of SkDevice.h 2016-04-20 05:29:51 -07:00
SampleAll.cpp Alloc glyph image correctly for SkMask::k3D_Format. 2017-11-14 17:38:34 +00:00
SampleAndroidShadows.cpp Add tonal color support for shadows. 2017-06-09 17:18:58 +00:00
SampleAnimatedText.cpp Revert "Revert "Reland: Remove SkLights include from SkCanvas.h"" 2017-05-03 19:17:11 +00:00
SampleAnimator.cpp SkFontData to use smart pointers. 2016-09-16 06:24:20 -07:00
SampleAnimBlur.cpp switch maskfilters to sk_sp 2016-04-04 10:02:58 -07:00
SampleApp.cpp clean up cruft about --portableFonts and --resourceFonts 2017-11-06 15:09:09 +00:00
SampleApp.h Add measurement command line args to SampleApp 2017-09-25 19:12:50 +00:00
SampleArc.cpp add drawString helper to canvas 2017-04-28 20:41:04 +00:00
SampleAtlas.cpp remove xfermode from public api 2016-10-28 20:06:17 +00:00
SampleBigBlur.cpp switch maskfilters to sk_sp 2016-04-04 10:02:58 -07:00
SampleBigGradient.cpp Remove trailing whitespace. 2017-10-09 21:20:34 +00:00
SampleBitmapRect.cpp add drawString helper to canvas 2017-04-28 20:41:04 +00:00
SampleBlur.cpp remove unneeded code for index8 imagse 2017-07-03 19:07:25 +00:00
SampleCamera.cpp move setshader to sk_sp, re-using SK_SUPPORT_LEGACY_CREATESHADER_PTR 2016-03-25 09:08:00 -07:00
SampleCCPRGeometry.cpp Convert geometry shaders to operate in Skia device space 2017-10-25 15:59:18 +00:00
SampleChart.cpp hide trivial helpers on canvas 2017-02-22 19:41:04 +00:00
SampleChineseFling.cpp Miscellaneous dynamic atlas fixes. 2017-09-28 19:38:42 +00: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 add drawString helper to canvas 2017-04-28 20:41:04 +00:00
SampleClipDrawMatch.cpp hide trivial helpers on canvas 2017-02-22 19:41:04 +00:00
SampleClock.cpp Add samples to Viewer. 2016-06-16 09:52:35 -07:00
SampleCode.cpp Misc batch->op cleanup Part 1 of 2 2016-12-21 16:45:40 +00:00
SampleCode.h Add samples to Viewer. 2016-06-16 09:52:35 -07:00
SampleColorFilter.cpp remove xfermode from public api 2016-10-28 20:06:17 +00:00
SampleComplexClip.cpp add drawString helper to canvas 2017-04-28 20:41:04 +00:00
SampleConcavePaths.cpp Revert "Revert "make it illegal to include SkXfermode.h"" 2016-11-23 22:17:17 +00:00
SampleCowboy.cpp Remove trailing whitespace. 2017-10-09 21:20:34 +00:00
SampleDash.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleDegenerateTwoPtRadials.cpp add drawString helper to canvas 2017-04-28 20:41:04 +00:00
SampleDither.cpp Revert "Revert "Delete copyTo(Allocator), hide copyTo() behind flag"" 2017-04-28 15:49:04 +00:00
SampleEffects.cpp Alloc glyph image correctly for SkMask::k3D_Format. 2017-11-14 17:38:34 +00:00
SampleEmboss.cpp Revert "Revert "make it illegal to include SkXfermode.h"" 2016-11-23 22:17:17 +00:00
SampleFatBits.cpp move parts of SkPoint to SkPointPriv 2017-11-08 18:25:17 +00:00
SampleFillType.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleFilter2.cpp add drawString helper to canvas 2017-04-28 20:41:04 +00:00
SampleFilterFuzz.cpp Remove SkTypeface::Style from fuzzers and lua. 2017-08-08 15:27:19 +00:00
SampleFilterQuality.cpp Move expensive initialization to onOnceBeforeDraw 2017-07-12 20:30:50 +00:00
SampleFlutterAnimate.cpp Use int when possible to calculate atlas indices in shaders. 2017-11-20 18:07:08 +00:00
SampleFontCache.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleFontScalerTest.cpp Remove internal use of SkTypeface::Style. 2017-07-27 21:30:45 +00:00
SampleFuzz.cpp Revert "Revert "make it illegal to include SkXfermode.h"" 2016-11-23 22:17:17 +00: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 SkCanvas: Helpers for draw{Point,Line,Circle} 2017-05-16 12:59:11 +00:00
SampleHairModes.cpp Use SkBlendMode_Name rather than one-off tables 2017-03-15 16:52:49 +00:00
SampleHT.cpp move parts of SkPoint to SkPointPriv 2017-11-08 18:25:17 +00:00
SampleIdentityScale.cpp add drawString helper to canvas 2017-04-28 20:41:04 +00:00
SampleLayerMask.cpp Revert "Revert "Reland: Remove SkLights include from SkCanvas.h"" 2017-05-03 19:17:11 +00:00
SampleLayers.cpp Initial clip-mask-layer support 2017-05-01 14:07:10 +00:00
SampleLCD.cpp Rein in the use of SkDevice.h 2016-04-20 05:29:51 -07:00
SampleLines.cpp Revert "Revert "make it illegal to include SkXfermode.h"" 2016-11-23 22:17:17 +00:00
SampleLua.cpp Mark ~LuaView as override. 2017-10-09 14:53:15 +00:00
SampleManyRects.cpp hide trivial helpers on canvas 2017-02-22 19:41:04 +00: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 move vertex-mode enum into SkVertices 2017-04-03 15:50:16 +00:00
SamplePath.cpp Remove trailing whitespace. 2017-10-09 21:20:34 +00:00
SamplePathClip.cpp SkCanvas: Helpers for draw{Point,Line,Circle} 2017-05-16 12:59:11 +00:00
SamplePathEffects.cpp begin to hide details of SkPathEffect 2017-02-26 18:36:11 +00:00
SamplePathFill.cpp stop using SkScalarMul 2017-02-14 19:45:24 +00:00
SamplePathFinder.cpp Add a SampleApp flag to automate keystrokes on startup 2017-10-18 17:25:56 +00:00
SamplePathFuzz.cpp simplify path validate 2017-08-29 18:37:11 +00:00
SamplePathOverstroke.cpp Add cubic example and draw original path 2016-06-30 10:04:21 -07:00
SamplePathText.cpp Add clipping options to path text bench and samples 2017-11-07 01:51:31 +00:00
SamplePdfFileViewer.cpp Revert "Revert "make it illegal to include SkXfermode.h"" 2016-11-23 22:17:17 +00:00
SamplePictFile.cpp Remove trailing whitespace. 2017-10-09 21:20:34 +00:00
SamplePoints.cpp Revert "Revert "make it illegal to include SkXfermode.h"" 2016-11-23 22:17:17 +00:00
SamplePolyToPoly.cpp add drawString helper to canvas 2017-04-28 20:41:04 +00:00
SampleQuadStroker.cpp move parts of SkPoint to SkPointPriv 2017-11-08 18:25:17 +00:00
SampleRectanizer.cpp add drawString helper to canvas 2017-04-28 20:41:04 +00:00
SampleRegion.cpp add drawString helper to canvas 2017-04-28 20:41:04 +00:00
SampleRepeatTile.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleShaders.cpp hide trivial helpers on canvas 2017-02-22 19:41:04 +00:00
SampleShaderText.cpp use Make instead of Create to return a shared shader 2016-03-08 18:50:00 -08:00
SampleShadowColor.cpp Add tonal color support for shadows. 2017-06-09 17:18:58 +00:00
SampleShadowReference.cpp Add Material Design shadow reference sample 2017-05-23 18:12:15 +00:00
SampleShadowUtils.cpp Revert "Revert "Delete SkGaussianEdgeShader"" 2017-05-31 14:52:12 +00:00
SampleShip.cpp add drawString helper to canvas 2017-04-28 20:41:04 +00:00
SampleSlides.cpp Remove internal use of SkTypeface::Style. 2017-07-27 21:30:45 +00:00
SampleStringArt.cpp Style Change: NULL->nullptr 2015-08-27 07:41:16 -07:00
SampleStrokePath.cpp add drawString helper to canvas 2017-04-28 20:41:04 +00:00
SampleStrokeRect.cpp Rein in the use of SkDevice.h 2016-04-20 05:29:51 -07:00
SampleSubpixelTranslate.cpp add drawString helper to canvas 2017-04-28 20:41:04 +00:00
SampleSVGFile.cpp Mark overridden destructors with 'override' and remove 'virtual' 2017-03-22 16:06:18 +00:00
SampleSVGPong.cpp [SVGDom] Expose intrinsic size info 2016-09-14 12:04:30 -07:00
SampleText.cpp add drawString helper to canvas 2017-04-28 20:41:04 +00:00
SampleTextAlpha.cpp add drawString helper to canvas 2017-04-28 20:41:04 +00:00
SampleTextBox.cpp Revert "Revert "make it illegal to include SkXfermode.h"" 2016-11-23 22:17:17 +00:00
SampleTextOnPath.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleTextureDomain.cpp hide lockpixels api behind flag 2017-04-17 15:33:36 +00:00
SampleTiling.cpp add drawString helper to canvas 2017-04-28 20:41:04 +00:00
SampleUnpremul.cpp add drawString helper to canvas 2017-04-28 20:41:04 +00:00
SampleVertices.cpp hide lockpixels api behind flag 2017-04-17 15:33:36 +00:00
SampleWritePixels.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00
SampleXfer.cpp add drawString helper to canvas 2017-04-28 20:41:04 +00:00
SampleXfermodesBlur.cpp add drawString helper to canvas 2017-04-28 20:41:04 +00:00
vertexdump.cpp Style bikeshed - remove extraneous whitespace 2016-03-29 09:03:53 -07:00