aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode
Commit message (Collapse)AuthorAge
* Revert "efficiently dash very large rectangles and very long lines"Gravatar Cary Clark2017-12-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 1ad81981b0027e96ef0cecd78661ab2c22bdc4aa. Reason for revert: broke chrome layout tests Original change's description: > efficiently dash very large rectangles and very long lines > > Speed up dashing when lines and rects are absurdly large. > > Prior to this CL, only horizontal lines were detected. > > The onOnceBeforeDraw changes are there to make debugging easier. > > Also folded in a change to handle dashing of zero length lines. > > R=​reed@google.com, egdaniel@google.com > Bug: skia:7311 > Change-Id: Ia16fb124c7a78a5cc639e612fae29c879a37da1a > Reviewed-on: https://skia-review.googlesource.com/84862 > Commit-Queue: Cary Clark <caryclark@skia.org> > Reviewed-by: Mike Reed <reed@google.com> TBR=egdaniel@google.com,reed@google.com,caryclark@skia.org Change-Id: I5e8f04c54486f8cd1a931f6cade92feaaa4a7647 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7311 Reviewed-on: https://skia-review.googlesource.com/87282 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* Fix alpha contribution to tonal color.Gravatar Jim Van Verth2017-12-19
| | | | | | | | | | | Also adds a tonal color GM, a grayscale mode to shadowutils GM, and animated alpha to SampleAndroidShadows. Bug: skia: Change-Id: I1dcb5cab7e53ffa7a3bf1a07b6ebfed38df1a9ed Reviewed-on: https://skia-review.googlesource.com/85002 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
* efficiently dash very large rectangles and very long linesGravatar Cary Clark2017-12-19
| | | | | | | | | | | | | | | | | Speed up dashing when lines and rects are absurdly large. Prior to this CL, only horizontal lines were detected. The onOnceBeforeDraw changes are there to make debugging easier. Also folded in a change to handle dashing of zero length lines. R=reed@google.com, egdaniel@google.com Bug: skia:7311 Change-Id: Ia16fb124c7a78a5cc639e612fae29c879a37da1a Reviewed-on: https://skia-review.googlesource.com/84862 Commit-Queue: Cary Clark <caryclark@skia.org> Reviewed-by: Mike Reed <reed@google.com>
* CCPR: Don't use instanced draw calls with geometry shadersGravatar Chris Dalton2017-12-11
| | | | | | | | | | | | It isn't necessary for the vertex shader to know all the points because everything happens in the geometry shader. It's simpler to use regular vertex arrays instead. Bug: skia: Change-Id: I7bf83180476fbe0ab01492611cd72e72b3f7d4f2 Reviewed-on: https://skia-review.googlesource.com/82881 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Fix SampleLua buildGravatar Florin Malita2017-12-11
| | | | | | | Change-Id: Ie0114ab16b99aed4343f6255dbc86fb15554ea74 Reviewed-on: https://skia-review.googlesource.com/83380 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Revert "Revert "resources: remove most uses of GetResourcePath()""Gravatar Mike Reed2017-12-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit cca230055921d2df8708ed6f9abcc2d43468dc7f. Reason for revert: think I guessed wrong about g32 -- unreverting Original change's description: > Revert "resources: remove most uses of GetResourcePath()" > > This reverts commit 5093a539def3ae09df324018f2343827009b2e05. > > Reason for revert: google3 seems broken > > Original change's description: > > resources: remove most uses of GetResourcePath() > > > > Going forward, we will standardize on GetResourceAsData(), which will > > make it easier to run tests in environments without access to the > > filesystem. > > > > Also: GetResourceAsData() complains when a resource is missing. > > This is usually an error. > > > > Change-Id: Iaf70b71b0ca5ed8cd1a5538a60ef185ae8736188 > > Reviewed-on: https://skia-review.googlesource.com/82642 > > Reviewed-by: Hal Canary <halcanary@google.com> > > Commit-Queue: Hal Canary <halcanary@google.com> > > TBR=halcanary@google.com,scroggo@google.com > > Change-Id: Ic5a7c0167c995a672e6b06dc92abe00564432214 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Reviewed-on: https://skia-review.googlesource.com/83001 > Reviewed-by: Mike Reed <reed@google.com> > Commit-Queue: Mike Reed <reed@google.com> TBR=halcanary@google.com,scroggo@google.com,reed@google.com Change-Id: I5a46e4de61186a8a5eb9cacd3275e24e311d5a07 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/82942 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Revert "resources: remove most uses of GetResourcePath()"Gravatar Mike Reed2017-12-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 5093a539def3ae09df324018f2343827009b2e05. Reason for revert: google3 seems broken Original change's description: > resources: remove most uses of GetResourcePath() > > Going forward, we will standardize on GetResourceAsData(), which will > make it easier to run tests in environments without access to the > filesystem. > > Also: GetResourceAsData() complains when a resource is missing. > This is usually an error. > > Change-Id: Iaf70b71b0ca5ed8cd1a5538a60ef185ae8736188 > Reviewed-on: https://skia-review.googlesource.com/82642 > Reviewed-by: Hal Canary <halcanary@google.com> > Commit-Queue: Hal Canary <halcanary@google.com> TBR=halcanary@google.com,scroggo@google.com Change-Id: Ic5a7c0167c995a672e6b06dc92abe00564432214 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/83001 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* CCPR: Combine loops and serpentines back into a single shaderGravatar Chris Dalton2017-12-08
| | | | | | | | Bug: skia: Change-Id: I945471ccd2580a2d39afd9c80acb8d9e5e196435 Reviewed-on: https://skia-review.googlesource.com/82460 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* resources: resource identifiers don't begin with leading slashGravatar Hal Canary2017-12-08
| | | | | | | Change-Id: I52522ffffbf0f5176ac9156cd563b41d6fdde59f Reviewed-on: https://skia-review.googlesource.com/82940 Reviewed-by: Leon Scroggins <scroggo@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* resources: remove most uses of GetResourcePath()Gravatar Hal Canary2017-12-08
| | | | | | | | | | | | | | Going forward, we will standardize on GetResourceAsData(), which will make it easier to run tests in environments without access to the filesystem. Also: GetResourceAsData() complains when a resource is missing. This is usually an error. Change-Id: Iaf70b71b0ca5ed8cd1a5538a60ef185ae8736188 Reviewed-on: https://skia-review.googlesource.com/82642 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Hal Canary <halcanary@google.com>
* resources: orgainize directory.Gravatar Hal Canary2017-12-08
| | | | | | | | | Should make it easier to ask just for images. Change-Id: If821743dc924c4bfbc6b2b2d29b14affde7b3afd Reviewed-on: https://skia-review.googlesource.com/82684 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com>
* CCPR: Eliminate texel buffersGravatar Chris Dalton2017-12-05
| | | | | | | | | | | | | | | | | | Points cost 8 bytes and indices cost 4. If a point is accessed twice, it's a wash whether we duplicate it or index. This change eliminates texel buffers by duplicating points across instance arrays. This reduces our dependence on extensions as well as getting rid of our indirect memory access pattern in vertex shaders. As a result of this change, memory usage by GPU buffers will only be a fraction larger at worst, and slightly better at best. Bug: skia: Cq-Include-Trybots: skia.primary:Test-Debian9-Clang-GCE-CPU-AVX2-x86_64-Release-All-SKNX_NO_SIMD Change-Id: I3c7f03772edd4f850d5fdd7b55552647335c1b52 Reviewed-on: https://skia-review.googlesource.com/79185 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Add analytic clip FPs that read from the CCPR atlasGravatar Chris Dalton2017-12-05
| | | | | | | | Bug: skia:7190 Change-Id: Ie31d368f52910e6917efdeb1b024370b06fc11ee Reviewed-on: https://skia-review.googlesource.com/77160 Commit-Queue: Chris Dalton <csmartdalton@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* turn on extended Clang warnings on Windows tooGravatar Chris Dalton2017-12-04
| | | | | | | | | | Plus some small rearrangements of the various warning lists. Change-Id: Ied58f940341d69ddab971a529fd01b1e96b65641 Reviewed-on: https://skia-review.googlesource.com/67720 Commit-Queue: Chris Dalton <csmartdalton@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Fix SVGPong slide crash in ViewerGravatar Florin Malita2017-12-03
| | | | | | | | | | SVGPong relies on onOnceBeforeDraw() to initialize, but when switching slides via Viewer's UI, onAnimate() is fired before the first paint. Change-Id: I7be133072ec635975f7463538cd42edb69696b3f Reviewed-on: https://skia-review.googlesource.com/79424 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Remove more views code, just to simplify thingsGravatar Brian Osman2017-12-01
| | | | | | | | Bug: skia: Change-Id: Ie31a3c764e4f88f2b08f4198bd253841a2d8c264 Reviewed-on: https://skia-review.googlesource.com/79100 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Delete even more unused views codeGravatar Brian Osman2017-11-29
| | | | | | | | Bug: skia: Change-Id: I41480aa89dfcd8cb7e016e477cbabe354f35ce8a Reviewed-on: https://skia-review.googlesource.com/75480 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Remove a huge pile of views codeGravatar Brian Osman2017-11-22
| | | | | | | | | | | | | All of this is dead when not using the old SkWindow framework. TBR=reed@google.com Bug: skia: Change-Id: I0f6ab18987a98469bfd367d5bc10967300dfd3ca Reviewed-on: https://skia-review.googlesource.com/75384 Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Fix XferDemo by sending push button events directly to parentGravatar Brian Osman2017-11-22
| | | | | | | | Bug: skia: Change-Id: I3141dd34a9a04c7a660000cba9e483191f28ef03 Reviewed-on: https://skia-review.googlesource.com/75362 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Remove SampleApp and convert HelloWorld to sk_appGravatar Brian Osman2017-11-21
| | | | | | | | | | | | | There is still a large amount of views code that could be trimmed down, but which is used to implement samples (in viewer). Seemed simpler to remove some of this code in pieces. Bug: skia: Change-Id: Ia3415060d03c8de604a154e3dc38379b754daab6 Reviewed-on: https://skia-review.googlesource.com/72801 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Remove clutter from experimentalGravatar Brian Osman2017-11-21
| | | | | | | | | | | | | SkMatrix has the canonical version of setPolyToPoly, we don't need three other copies sitting around. SkBorder appears to be useless. Bug: skia: Change-Id: Ie747ff7af6cf1d03e6276e8d7fe57e9b3e4ad411 Reviewed-on: https://skia-review.googlesource.com/74141 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Revert "Use int when possible to calculate atlas indices in shaders."Gravatar Jim Van Verth2017-11-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 999ec57291dc7cf1d8e3a745627670e6cadc1c12. Reason for revert: Causing issues with NexusPlayer Vulkan. Original change's description: > 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> TBR=jvanverth@google.com,bsalomon@google.com,robertphillips@google.com Change-Id: I82801a73a2a8067588049b213f010ff25f4014f3 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7285 Reviewed-on: https://skia-review.googlesource.com/74001 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
* Enable tonal color for shadows by default.Gravatar Jim Van Verth2017-11-20
| | | | | | | | | | This change swaps the sense of the tonal color shadow flag, so tonal color will always be on unless explicitly disabled. Change-Id: I56ce4228022cf59b570cd7461327628cf7fe7173 Reviewed-on: https://skia-review.googlesource.com/73900 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
* Use int when possible to calculate atlas indices in shaders.Gravatar Jim Van Verth2017-11-20
| | | | | | | | | | | | | | | | 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>
* Alloc glyph image correctly for SkMask::k3D_Format.Gravatar Ben Wagner2017-11-14
| | | | | | | | | | | | | | | | | | | | | | Re-enable the code to test the emboss mask filter, updating it to use the new emboss mask filter factory. Add a test to ensure that embossed text is drawn correctly, as before glyphs did not allocate the proper amount of memory for the k3D_Format which the emboss mask filter produces. Fixes SkEmbossMask::Emboss to write the whole of the mul and add planes to avoid pixel differences and MemorySanitizer errors. Update the GPU to understand the k3D_Format and use just the alpha plane, ignoring the mul and add plane which it currently cannot support. Change-Id: I90edf34a918c06b0c6b24bfc43ce7031419eca41 Reviewed-on: https://skia-review.googlesource.com/70260 Reviewed-on: https://skia-review.googlesource.com/70962 Reviewed-on: https://skia-review.googlesource.com/71282 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Revert "Alloc glyph image correctly for SkMask::k3D_Format."Gravatar Brian Osman2017-11-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 1662257bdaaaf26b016bf2a3e329c34f7f5ed581. Reason for revert: Android still using this API Original change's description: > Alloc glyph image correctly for SkMask::k3D_Format. > > Remove the no longer used outside Skia SK_SUPPORT_LEGACY_EMBOSSMASKFILTER > define, and either delete the code it guards or update it to use the new > emboss mask filter factory. > > Re-enable the code to test the emboss mask filter. > > Add a test to ensure that embossed text is drawn correctly, as before > glyphs did not allocate the proper amount of memory for the k3D_Format > which the emboss mask filter produces. > > Fixes SkEmbossMask::Emboss to write the whole of the mul and add planes > to avoid pixel differences and MemorySanitizer errors. > > Update the GPU to understand the k3D_Format and use just the alpha > plane, ignoring the mul and add plane which it currently cannot support. > > Change-Id: Icac1a3f37d6e8c6be3151df570f5e14111e18585 > Reviewed-on: https://skia-review.googlesource.com/70260 > Reviewed-by: Herb Derby <herb@google.com> > Reviewed-on: https://skia-review.googlesource.com/70962 > Commit-Queue: Ben Wagner <bungeman@google.com> TBR=djsollen@google.com,bungeman@google.com,herb@google.com Change-Id: Id6625bae8d3bd70ce7aa3045348c04fdd146c637 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/71183 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Alloc glyph image correctly for SkMask::k3D_Format.Gravatar Ben Wagner2017-11-14
| | | | | | | | | | | | | | | | | | | | | | | | Remove the no longer used outside Skia SK_SUPPORT_LEGACY_EMBOSSMASKFILTER define, and either delete the code it guards or update it to use the new emboss mask filter factory. Re-enable the code to test the emboss mask filter. Add a test to ensure that embossed text is drawn correctly, as before glyphs did not allocate the proper amount of memory for the k3D_Format which the emboss mask filter produces. Fixes SkEmbossMask::Emboss to write the whole of the mul and add planes to avoid pixel differences and MemorySanitizer errors. Update the GPU to understand the k3D_Format and use just the alpha plane, ignoring the mul and add plane which it currently cannot support. Change-Id: Icac1a3f37d6e8c6be3151df570f5e14111e18585 Reviewed-on: https://skia-review.googlesource.com/70260 Reviewed-by: Herb Derby <herb@google.com> Reviewed-on: https://skia-review.googlesource.com/70962 Commit-Queue: Ben Wagner <bungeman@google.com>
* Revert "Alloc glyph image correctly for SkMask::k3D_Format."Gravatar Ben Wagner2017-11-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 6b26deb8d6067589ce9b7853ab8e8d39de1a45de. Reason for revert: GPU bots failing Original change's description: > Alloc glyph image correctly for SkMask::k3D_Format. > > This removes the no longer used outside Skia > SK_SUPPORT_LEGACY_EMBOSSMASKFILTER define, and either deletes the code > it guards or updates it to use the new emboss mask filter factory. This > re-enables the code to test the emboss mask filter. Also added is a test > to ensure that embossed text is drawn correctly, as before this glyphs > did not allocate the proper amount of memory for the k3D_Format which > this mask filter produces. This also fixes SkEmbossMask::Emboss to write > the whole of the mul and add planes to avoid pixel differences and > MemorySanitizer errors. > > Change-Id: Ib492c72a19d6a27d140e3cd48179a3ca9ce313f5 > Reviewed-on: https://skia-review.googlesource.com/70260 > Commit-Queue: Ben Wagner <bungeman@google.com> > Reviewed-by: Herb Derby <herb@google.com> TBR=djsollen@google.com,bungeman@google.com,herb@google.com,reed@google.com Change-Id: I8a9db6c00e0cb84bdd4833474a9ffffa6ecc606c No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/70920 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Alloc glyph image correctly for SkMask::k3D_Format.Gravatar Ben Wagner2017-11-13
| | | | | | | | | | | | | | | | | This removes the no longer used outside Skia SK_SUPPORT_LEGACY_EMBOSSMASKFILTER define, and either deletes the code it guards or updates it to use the new emboss mask filter factory. This re-enables the code to test the emboss mask filter. Also added is a test to ensure that embossed text is drawn correctly, as before this glyphs did not allocate the proper amount of memory for the k3D_Format which this mask filter produces. This also fixes SkEmbossMask::Emboss to write the whole of the mul and add planes to avoid pixel differences and MemorySanitizer errors. Change-Id: Ib492c72a19d6a27d140e3cd48179a3ca9ce313f5 Reviewed-on: https://skia-review.googlesource.com/70260 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Herb Derby <herb@google.com>
* move parts of SkPoint to SkPointPrivGravatar Cary Clark2017-11-08
| | | | | | | | | | | | Move specialized SkPoint methods to SkPointPriv. Use constexpr and inline initialization where possible. R=reed@google.com,bsalomon@google.com Bug: skia: 6898 Change-Id: I01ec5186f010f2dc80c068c70d9cc352f3221338 Reviewed-on: https://skia-review.googlesource.com/68700 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Ravi Mistry <rmistry@google.com>
* Add clipping options to path text bench and samplesGravatar Chris Dalton2017-11-07
| | | | | | | | Bug: skia: Change-Id: I632a2fa5627ef1438d9ab451318a42d12c61b802 Reviewed-on: https://skia-review.googlesource.com/67683 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* clean up cruft about --portableFonts and --resourceFontsGravatar Mike Klein2017-11-06
| | | | | | | | | | --portableFonts exists but does nothing. --resourceFonts doesn't even exist. Change-Id: I7880208de4aaa9674ba720b9e70c34c145561ac0 Reviewed-on: https://skia-review.googlesource.com/67800 Commit-Queue: Ben Wagner <bungeman@google.com> Reviewed-by: Ben Wagner <bungeman@google.com>
* -= to control width of fatbits line widthGravatar Mike Reed2017-11-02
| | | | | | | | Bug: skia: Change-Id: Id100ac5c22f5cc878d782d53557c6b37370a2989 Reviewed-on: https://skia-review.googlesource.com/66621 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Convert geometry shaders to operate in Skia device spaceGravatar Chris Dalton2017-10-25
| | | | | | | | | | | | | Defers the transformation to normalized window coordinates until after the geometry shader. Merges vertex and a geometry shader builders into a single compilation unit with a common base class. Updates CCPR geometry shaders accordingly. Bug: skia: Change-Id: If93c90e978b1fdc7120febd05cfb05810fd496b5 Reviewed-on: https://skia-review.googlesource.com/62980 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Print measure info before closeWindowGravatar Yuqian Li2017-10-23
| | | | | | | | | | | The closeWindow function does not guarantee the calling of ~SampleWindow (in Windows and Mac). So we print the info earlier. Bug: skia: Change-Id: Ib8b11cac4fb2fc7b62a02c7fb7f3aaaa48df2da6 Reviewed-on: https://skia-review.googlesource.com/63140 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Yuqian Li <liyuqian@google.com>
* SampleAAGeometry tweaksGravatar Chris Dalton2017-10-20
| | | | | | | | | | | | - Use capital letters avoid conflict with built-in commands, particularly zoom-window ('z') and toggle-backend ('d'). - Increase kHitToleranace for touch screens. Bug: skia: Change-Id: I6feaabd8aa06600bdeb4623ab081d973369c4841 Reviewed-on: https://skia-review.googlesource.com/52528 Commit-Queue: Chris Dalton <csmartdalton@google.com> Reviewed-by: Cary Clark <caryclark@google.com>
* Add a SampleApp flag to automate keystrokes on startupGravatar Chris Dalton2017-10-18
| | | | | | | | | | | | | This is a quick-and-dirty solution to select color mode, backend, etc. from the command line. e.g. 'out/Debug/SampleApp --keys CCd' for opengl and srgb Bug: skia: Change-Id: I61f9e0fd4209a5fadb585c02c71984398f2f0860 Reviewed-on: https://skia-review.googlesource.com/61482 Reviewed-by: Yuqian Li <liyuqian@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Remove redundant parentheses.Gravatar Ben Wagner2017-10-17
| | | | | | | | | | | | | | | | Recent clang versions produce output like ../../samplecode/SampleAll.cpp:306:27: error: redundant parentheses surrounding declarator [-Werror,-Wredundant-parens] Remove these to clean up the code a bit. Change-Id: Ib099201f23f83cd712487c238b6a508290e667a7 Reviewed-on: https://skia-review.googlesource.com/60822 Commit-Queue: Ben Wagner <bungeman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Refactor CCPR coverage shaders for a vertex implGravatar Chris Dalton2017-10-16
| | | | | | | | | | | | | Decouples geometry generation and analytic coverage. This paves the way for a vertex shader implementation. TBR=egdaniel@google.com Bug: skia: Change-Id: I2a183401bfe70b9f14b9b1cf035de6020a2135fa Reviewed-on: https://skia-review.googlesource.com/60103 Reviewed-by: Chris Dalton <csmartdalton@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Revert "Refactor CCPR coverage shaders for a vertex impl"Gravatar Eric Boren2017-10-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit e501033bbdc9143848edde3c3e3b7282169bc11e. Reason for revert: Broke several bots Original change's description: > Refactor CCPR coverage shaders for a vertex impl > > Decouples geometry generation and analytic coverage. This paves the > way for a vertex shader implementation. > > Bug: skia: > Change-Id: I23b79d4397db22bd8fc063b8dfca58ab00037292 > Reviewed-on: https://skia-review.googlesource.com/59200 > Commit-Queue: Chris Dalton <csmartdalton@google.com> > Reviewed-by: Greg Daniel <egdaniel@google.com> TBR=egdaniel@google.com,csmartdalton@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: skia: Change-Id: I314bf03fa6cbeceb1c527d4d9464147b2e8464c6 Reviewed-on: https://skia-review.googlesource.com/59821 Reviewed-by: Eric Boren <borenet@google.com> Commit-Queue: Eric Boren <borenet@google.com>
* Refactor CCPR coverage shaders for a vertex implGravatar Chris Dalton2017-10-15
| | | | | | | | | | | Decouples geometry generation and analytic coverage. This paves the way for a vertex shader implementation. Bug: skia: Change-Id: I23b79d4397db22bd8fc063b8dfca58ab00037292 Reviewed-on: https://skia-review.googlesource.com/59200 Commit-Queue: Chris Dalton <csmartdalton@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Add a tooling flag for path mask cachingGravatar Chris Dalton2017-10-13
| | | | | | | | | | | Adds the flag and a disables caching on the CCPR bots. Bug: skia: Change-Id: Icb85e77f89634dda1d419dacac5b8a93340723f0 Reviewed-on: https://skia-review.googlesource.com/59740 Reviewed-by: Eric Boren <borenet@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
* Remove trailing whitespace.Gravatar Ben Wagner2017-10-09
| | | | | | | | | | | Also adds a presubmit to prevent adding trailing whitespace to source code in the future. Change-Id: I41a4df81487f6f00aa19b188f0cac6a3377efde6 Reviewed-on: https://skia-review.googlesource.com/57380 Reviewed-by: Ravi Mistry <rmistry@google.com> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Mark ~LuaView as override.Gravatar Ben Wagner2017-10-09
| | | | | | | | | | | | | Newer clang versions report ../../samplecode/SampleLua.cpp:44:13: error: '~LuaView' overrides a destructor but is not marked 'override' [-Werror,-Winconsistent-missing-destructor-override] Change-Id: I6f3e69482a79e9580e51b957fff06e6d4d270735 Reviewed-on: https://skia-review.googlesource.com/57164 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Revert[4] "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap"Gravatar Mike Reed2017-10-03
| | | | | | | | | | This reverts commit 5a2e50edc51006ce91366e177a9d21a16775d7fd. Bug: skia: Change-Id: I8d28b5c07d90130e5a1653923740eaf189ecb954 Reviewed-on: https://skia-review.googlesource.com/53900 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Revert "Revert "Revert "guard old apis for querying byte-size of a ↵Gravatar Mike Reed2017-10-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bitmap/imageinfo/pixmap""" This reverts commit cd284c532376d16fcc4ed75baf3da65c3e4a2e95. Reason for revert: assert fired in SkMallocPixelRef.cpp:61: fatal error: "assert(info.computeByteSize(rowBytes) == info.getSafeSize(rowBytes))" google3 thinks it was from surface_rowbytes Original change's description: > Revert "Revert "guard old apis for querying byte-size of a bitmap/imageinfo/pixmap"" > > This reverts commit 809cbedd4b252be221b2ac3b4269d312fd8f53a0. > > Bug: skia: > Change-Id: I680d8daeeeeb15526b44c1305d8fb0c6bfa38e1d > Reviewed-on: https://skia-review.googlesource.com/52665 > Commit-Queue: Mike Reed <reed@google.com> > Reviewed-by: Florin Malita <fmalita@chromium.org> TBR=fmalita@chromium.org,reed@google.com Change-Id: I41e3f7a3f791cc8183291847e783ed8a53bc91d2 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/53802 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Revert "Revert "guard old apis for querying byte-size of a ↵Gravatar Mike Reed2017-10-02
| | | | | | | | | | | | bitmap/imageinfo/pixmap"" This reverts commit 809cbedd4b252be221b2ac3b4269d312fd8f53a0. Bug: skia: Change-Id: I680d8daeeeeb15526b44c1305d8fb0c6bfa38e1d Reviewed-on: https://skia-review.googlesource.com/52665 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Add width and height option to SampleAppGravatar Yuqian Li2017-09-29
| | | | | | | | | | | So we can benchmark with given width/height dimensions. Bug: skia: Change-Id: I881c9f054cdcecc3e0b2bfb600afd778e1c57d95 Reviewed-on: https://skia-review.googlesource.com/51246 Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Miscellaneous dynamic atlas fixes.Gravatar Jim Van Verth2017-09-28
| | | | | | | | | | | | | Make Chinese fling sample closer to Android test. Fix a bug in GrDrawOpAtlas::compact(), where the atlas generation wasn't incremented so the client didn't know it changed. Add some debug info for GrDrawOpAtlas. Add a comment in GrDrawOpAtlas::setLastUseTokenBulk. Change-Id: I79192a017870541a79731b1a22f665ec5deeff09 Reviewed-on: https://skia-review.googlesource.com/52761 Commit-Queue: Jim Van Verth <jvanverth@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Add svg support to pathfinder toolGravatar Chris Dalton2017-09-28
| | | | | | | | Bug: skia: Change-Id: I9302491c983fae5e2e84edc4ee135a917b099a42 Reviewed-on: https://skia-review.googlesource.com/52360 Commit-Queue: Chris Dalton <csmartdalton@google.com> Reviewed-by: Jim Van Verth <jvanverth@google.com>