aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/shaders
Commit message (Collapse)AuthorAge
* Stop using SkTSwap.Gravatar Ben Wagner2018-06-19
| | | | | | | | | | | | | Use std::swap instead. It does not appear that any external user specializes SkTSwap, but some may still use it. This removes all use in Skia so that SkTSwap can later be removed in a smaller CL. After that the <utility> include can be removed from SkTypes.h. Change-Id: If03d4ee07dbecda961aa9f0dc34d171ef5168753 Reviewed-on: https://skia-review.googlesource.com/135578 Reviewed-by: Hal Canary <halcanary@google.com> Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Implement nonlinear (as-encoded) blending in GrColorSpaceXformGravatar Brian Osman2018-06-18
| | | | | | | | | | | | | | | | | | Make GrColorSpaceXform a wrapper over SkColorSpaceXformSteps, and removed the xform cache. The shader code does up to five steps to correctly transform (unpremul, linearize, gamut, encode, premul). Remove all clamping, so we can support sRGB encoded F16. Most of https://skia-review.googlesource.com/c/skia/+/132090, except that GrNonlinearColorSpaceXformEffect is still used for SkColorSpaceXformCanvas and a few other places. As a result, this doesn't trigger any layout test failures. Change-Id: I789a5e327a419b5f7634c00d1b355912046c07b7 Reviewed-on: https://skia-review.googlesource.com/135326 Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Remove GrPixelConfig argument to GrColorSpaceXform[Effect]::MakeGravatar Brian Osman2018-06-14
| | | | | | | | | | | This was for sRGB configs, which are no longer treated special. Pulling this out of https://skia-review.googlesource.com/c/skia/+/132090 to land separately. Change-Id: Id04c4e82ad4ffe375cfd384490839b0488e54d44 Reviewed-on: https://skia-review.googlesource.com/134843 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Pull non-substantive changes out of omnibus CLGravatar Robert Phillips2018-06-13
| | | | | | | | | | | https://skia-review.googlesource.com/c/skia/+/131500 (Move op memory storage to GrContext) is still a bit of a monster. Offload the trivial stuff. Change-Id: I27eb0c441d08111491b3cfee3b93d260c26c2790 Reviewed-on: https://skia-review.googlesource.com/134501 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* clean up SkPicture includeGravatar Cary Clark2018-06-12
| | | | | | | | | | | | | | | | | Get SkPicture.h ready for documenting. - remove private methods - move private forward declarations - name parameters R=reed@google.com, bsalomon@google.com Bug: skia:6898 Change-Id: I28829111203d8ae2a4661cf02c99023403aa0df0 Reviewed-on: https://skia-review.googlesource.com/134120 Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Cary Clark <caryclark@skia.org> Commit-Queue: Cary Clark <caryclark@google.com>
* rebaseGravatar Cary Clark2018-06-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 32a4910e57b1fdd3c8671de1ee85e05ca21d079f. Reason for revert: SkMatrix::toString use has been removed from flutter and has been picked up in fuchsia Additionally some bookmaker changes take into account recent additions of typedef comments and the generated header comment. Original change's description: > Revert "remove toString" > > This reverts commit 5191880cbf3ee4d122b0d11b4945fbab0784fda7. > > Reason for revert: broke flutter > > Original change's description: > > remove toString > > > > toString may have been used by obsolete debugger only > > find out if that is so > > > > R=​brianosman@google.com,bsalomon@google.com > > > > Docs-Preview: https://skia.org/?cl=119894 > > Bug:830651 > > Change-Id: I737f19b7d3fbc869bea2f443fa3b5ed7c1393ffd > > Reviewed-on: https://skia-review.googlesource.com/119894 > > Commit-Queue: Cary Clark <caryclark@google.com> > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org > > Change-Id: I9f81de6c3615ee0608bcea9081b77239b4b8816c TBR=bsalomon@google.com,brianosman@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Reviewed-on: https://skia-review.googlesource.com/129623 Reviewed-by: Cary Clark <caryclark@skia.org> Commit-Queue: Cary Clark <caryclark@google.com> Docs-Preview: https://skia.org/?cl=133583 Bug: 830651 Change-Id: If8499e796be63580ad419e150e94d43e8b89de1b Reviewed-on: https://skia-review.googlesource.com/133583 Commit-Queue: Cary Clark <caryclark@skia.org> Auto-Submit: Cary Clark <caryclark@skia.org>
* Harden SkPerlinNoiseShader StitchData initializationGravatar Florin Malita2018-06-06
| | | | | | | | | | ... to ensure fWrap{X,Y} don't overflow int. Bug: chromium:846010, oss-fuzz:8377 Change-Id: I7cf082e388002ad5f8a6c62bad92f998fe831385 Reviewed-on: https://skia-review.googlesource.com/132222 Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Dest color space no longer impacts mipmaps or texture samplingGravatar Brian Osman2018-06-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PS5: Removes SkDestinationSurfaceColorMode, tracking of mipmap mode on GrTexture, sRGB decode state per-texture. Because we were often choosing sRGB configs for RGB color types, legacy rendering would then be incorrect (too dark). So... PS7: Stops ever using sRGB pixel configs when translating image info or color type. Also removes a bunch of GrCaps bits and a GrContextOption that are no longer relevant. PS9: Adjusts surface creation unit test expectations, and changes the raster rules accordingly. At this point, sRGB configs are (obviously) going to be broken. Locally, I ran 8888, gl, and the gbr- versions of both. Across all GMs x configs, there are 13 diffs. 12 are GMs that create surfaces with a color-space attached (and thus, the offscreen is no longer getting sRGB pixel config). The only remainder constructs an SkPictureImageGenerator, (with an attached color space) and renders it to the gbr-gl canvas, which triggers a a tagged surface inside the generator. Bug: skia: Change-Id: Ie5edfa157dd799f3121e8173fc4f97f6c8ed6789 Reviewed-on: https://skia-review.googlesource.com/131282 Commit-Queue: Brian Osman <brianosman@google.com> Reviewed-by: Mike Klein <mtklein@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Revert "Reland "remove toString""Gravatar Cary Clark2018-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 92e37b6d79f12ccfaaf7671413316952d182267d. Reason for revert: toString still used by flutter Original change's description: > Reland "remove toString" > > This reverts commit 32a4910e57b1fdd3c8671de1ee85e05ca21d079f. > > Reason for revert: SkMatrix::toString use has been removed from flutter and has been picked up in fuchsia > > Original change's description: > > Revert "remove toString" > > > > This reverts commit 5191880cbf3ee4d122b0d11b4945fbab0784fda7. > > > > Reason for revert: broke flutter > > > > Original change's description: > > > remove toString > > > > > > toString may have been used by obsolete debugger only > > > find out if that is so > > > > > > R=​brianosman@google.com,bsalomon@google.com > > > > > > Docs-Preview: https://skia.org/?cl=119894 > > > Bug:830651 > > > Change-Id: I737f19b7d3fbc869bea2f443fa3b5ed7c1393ffd > > > Reviewed-on: https://skia-review.googlesource.com/119894 > > > Commit-Queue: Cary Clark <caryclark@google.com> > > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > > > TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org > > > > Change-Id: I9f81de6c3615ee0608bcea9081b77239b4b8816c > > No-Presubmit: true > > No-Tree-Checks: true > > No-Try: true > > Bug: 830651 > > Reviewed-on: https://skia-review.googlesource.com/129340 > > Reviewed-by: Cary Clark <caryclark@google.com> > > Commit-Queue: Cary Clark <caryclark@google.com> > > TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org > > # Not skipping CQ checks because original CL landed > 1 day ago. > > Bug: 830651 > Change-Id: Ida8725b6051132d8c46faf99358a8fcc1bcabf34 > Reviewed-on: https://skia-review.googlesource.com/129623 > Reviewed-by: Cary Clark <caryclark@skia.org> > Reviewed-by: Cary Clark <caryclark@google.com> > Commit-Queue: Cary Clark <caryclark@google.com> TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org Change-Id: Iafc59ffc1b3db67c520ba31bf12d68e1b46c0ea2 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 830651 Reviewed-on: https://skia-review.googlesource.com/131082 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* Reland "remove toString"Gravatar Cary Clark2018-05-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 32a4910e57b1fdd3c8671de1ee85e05ca21d079f. Reason for revert: SkMatrix::toString use has been removed from flutter and has been picked up in fuchsia Original change's description: > Revert "remove toString" > > This reverts commit 5191880cbf3ee4d122b0d11b4945fbab0784fda7. > > Reason for revert: broke flutter > > Original change's description: > > remove toString > > > > toString may have been used by obsolete debugger only > > find out if that is so > > > > R=​brianosman@google.com,bsalomon@google.com > > > > Docs-Preview: https://skia.org/?cl=119894 > > Bug:830651 > > Change-Id: I737f19b7d3fbc869bea2f443fa3b5ed7c1393ffd > > Reviewed-on: https://skia-review.googlesource.com/119894 > > Commit-Queue: Cary Clark <caryclark@google.com> > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org > > Change-Id: I9f81de6c3615ee0608bcea9081b77239b4b8816c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: 830651 > Reviewed-on: https://skia-review.googlesource.com/129340 > Reviewed-by: Cary Clark <caryclark@google.com> > Commit-Queue: Cary Clark <caryclark@google.com> TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: 830651 Change-Id: Ida8725b6051132d8c46faf99358a8fcc1bcabf34 Reviewed-on: https://skia-review.googlesource.com/129623 Reviewed-by: Cary Clark <caryclark@skia.org> Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* warmup, remove clamping in append_gamut_transform()Gravatar Mike Klein2018-05-30
| | | | | | | | | | | | | | Clamping here seems inconsistent with our color pipeline model, and with the existing GPU impl. The SkRasterPipeline store stages already do clamp when storing unorms, and table-lookup stages clamp their inputs, so it should be safe. While refactoring, slim its interface down a bit. Change-Id: I4772457fdf90e483834d034f02974d7a859cbe24 Reviewed-on: https://skia-review.googlesource.com/130902 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* remove defines and add commasGravatar Cary Clark2018-05-21
| | | | | | | | | | | | | | | | | | | | | | | | Preparation for generating bookmaker files for all remaining interfaces Standardize enum and enum classes by including a comma after the last entry. Replace flatten-related #define in public interfaces with their equivalent. The motivation is to give documentation something to refer to. An alternative would be to move part or all of this out of the public interface; something I can work on in a follow-up CL. R=reed@google.com,bsalomon@google.com Bug: skia:6898 Change-Id: I4b865f6ec3d8f5d31e50448fef7d2714510302f0 Reviewed-on: https://skia-review.googlesource.com/129312 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Cary Clark <caryclark@skia.org>
* Revert "remove toString"Gravatar Cary Clark2018-05-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 5191880cbf3ee4d122b0d11b4945fbab0784fda7. Reason for revert: broke flutter Original change's description: > remove toString > > toString may have been used by obsolete debugger only > find out if that is so > > R=​brianosman@google.com,bsalomon@google.com > > Docs-Preview: https://skia.org/?cl=119894 > Bug:830651 > Change-Id: I737f19b7d3fbc869bea2f443fa3b5ed7c1393ffd > Reviewed-on: https://skia-review.googlesource.com/119894 > Commit-Queue: Cary Clark <caryclark@google.com> > Reviewed-by: Brian Salomon <bsalomon@google.com> TBR=bsalomon@google.com,brianosman@google.com,caryclark@google.com,caryclark@skia.org Change-Id: I9f81de6c3615ee0608bcea9081b77239b4b8816c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: 830651 Reviewed-on: https://skia-review.googlesource.com/129340 Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Cary Clark <caryclark@google.com>
* remove toStringGravatar Cary Clark2018-05-20
| | | | | | | | | | | | | | toString may have been used by obsolete debugger only find out if that is so R=brianosman@google.com,bsalomon@google.com Docs-Preview: https://skia.org/?cl=119894 Bug:830651 Change-Id: I737f19b7d3fbc869bea2f443fa3b5ed7c1393ffd Reviewed-on: https://skia-review.googlesource.com/119894 Commit-Queue: Cary Clark <caryclark@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* validate perlin inputsGravatar Mike Reed2018-05-18
| | | | | | | | Bug: oss-fuzz:8359 Change-Id: Ib539c8549f2e00d6b0da099f48c4084d2bfbefd8 Reviewed-on: https://skia-review.googlesource.com/129180 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Return nullptr when ReadBuffer becomes invalidGravatar Kevin Lubick2018-05-17
| | | | | | | | | | | | | | | | | This especially helps in SkDrawLooper because we can bail out early instead of looping for a potentially long time, e.g. when fuzzed input says count is a large number. This also cleans up validate in a few spots, and adds validateCanReadN as a helper function. Bug: skia:7937 Change-Id: Ic5eff357c8cadc91eeafc6e39c78c570ba74df2f Reviewed-on: https://skia-review.googlesource.com/128847 Commit-Queue: Kevin Lubick <kjlubick@google.com> Commit-Queue: Mike Klein <mtklein@google.com> Reviewed-by: Mike Klein <mtklein@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Fix UBSAN warnings in SkPerlinNoiseShaderImplGravatar Kevin Lubick2018-05-16
| | | | | | | | | | Also update the docs in places. Bug: oss-fuzz:6138, oss-fuzz:6275, oss-fuzz:6118 Change-Id: Idfef4118dd6e58f8aa528365895f7d7b8ebc50e5 Reviewed-on: https://skia-review.googlesource.com/128300 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
* Avoid dividing by zero in SkTwoPointConicalGradient::CreateGravatar Yuqian Li2018-05-14
| | | | | | | | | Bug: oss-fuzz:6146 oss-fuzz:7474 Change-Id: I5f0488f4572140ccb7b9374bc9a66b8ae81dd2d4 Reviewed-on: https://skia-review.googlesource.com/127990 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com> Auto-Submit: Yuqian Li <liyuqian@google.com>
* Make GrCaps and GrShaderCaps private.Gravatar Brian Salomon2018-05-11
| | | | | | | | | Moves getCaps() from GrContext to GrContextPriv and removes unused refCaps(). Change-Id: Ic6a8951b656c0d1b2773eae73bff8e88af819866 Reviewed-on: https://skia-review.googlesource.com/127389 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Validate readByteArrayAsData sizeGravatar Florin Malita2018-05-10
| | | | | | | | | | | | Check that the reader has enough data before attempting to allocate the buffer. Also update to return nullptr on read failures. Change-Id: Ia1ea8f611bad95cf3a4493b12582ac3fa7c2b00f Reviewed-on: https://skia-review.googlesource.com/127129 Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Validate gradient DescriptorScope size during deserializationGravatar Florin Malita2018-05-10
| | | | | | | | | | Check that the reader has sufficient data before allocating buffers. Bug: skia:7937 Change-Id: I2352d9a5cbace77b77c150a3a6439e8ac18b0dc5 Reviewed-on: https://skia-review.googlesource.com/127132 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Kevin Lubick <kjlubick@google.com>
* check for focaldata failureGravatar Mike Reed2018-05-09
| | | | | | | | Bug: oss-fuzz:8150 Change-Id: I061365aa5baa62405d732e92beb560a557671bf6 Reviewed-on: https://skia-review.googlesource.com/127046 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* allow div-by-zeroGravatar Mike Reed2018-05-03
| | | | | | | | Bug: oss-fuzz:6146 Change-Id: Ibac5e0730131be432330b8d07648c2ba64b1d6b5 Reviewed-on: https://skia-review.googlesource.com/125460 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* allow div by zeroGravatar Mike Reed2018-05-02
| | | | | | | | Bug: oss-fuzz:6144 Change-Id: I0f592b1611f06b64450dd642f898ebf6fb88a03d Reviewed-on: https://skia-review.googlesource.com/125444 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* Remove stale gradient color space assertGravatar Florin Malita2018-04-26
| | | | | | | | | | | | | SkGradientShaderBase asserts gammaIsLinear() -- but we don't enforce this in factories. Based on comments, this may be a stale restriction. Can we drop it? Bug: chromium:798208 Change-Id: Id9639cb2bb87f112b26c05372f2a3181c139e5ec Reviewed-on: https://skia-review.googlesource.com/123860 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Fix use-of-uninitialized-value in SkPictureShader::onMakeContextGravatar Florin Malita2018-04-20
| | | | | | | | | | | | | | | | | | SkPictureShader::refBitmapShader is expected to always initialize the scale adjust vector when returning a non-null shader. But the code path returning EmptyShader does not do that. Instead of hauling around a separate scale adjustment, we can refactor to avoid this problem by adjusting the local matrix directly, if needed, in refBitmapShader. The local matrix is conveniently already stored in a SkTCopyOnFirstWrite. Bug: chromium:835048, oss-fuzz:7738 Change-Id: I2df3bde7d6237f01bc71857c2fe254e86b186dc0 Reviewed-on: https://skia-review.googlesource.com/122544 Auto-Submit: Florin Malita <fmalita@chromium.org> Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Reland "low-hanging bilerp_clamp_8888 wins"Gravatar Mike Klein2018-04-17
| | | | | | | | | | | | | | | | | | | | | | | | | This is a reland of f946b41643e049f3b81f40316373ad22e1518818 Patches since the original make sure the sample area sums to 1. Original change's description: > low-hanging bilerp_clamp_8888 wins > > - support sampling bgra too > - lowp impl > > Bug: skia:7810 > > Change-Id: I21db805483f612024802f2b508c140c42a029c54 > Reviewed-on: https://skia-review.googlesource.com/121582 > Commit-Queue: Mike Klein <mtklein@google.com> > Reviewed-by: Florin Malita <fmalita@chromium.org> Bug: skia:7810 Change-Id: If20d31b4f8c4163bdb567b4f15a62035265b1b30 Reviewed-on: https://skia-review.googlesource.com/121464 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Revert "low-hanging bilerp_clamp_8888 wins"Gravatar Mike Klein2018-04-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit f946b41643e049f3b81f40316373ad22e1518818. Reason for revert: nervous diffs Original change's description: > low-hanging bilerp_clamp_8888 wins > > - support sampling bgra too > - lowp impl > > Bug: skia:7810 > > Change-Id: I21db805483f612024802f2b508c140c42a029c54 > Reviewed-on: https://skia-review.googlesource.com/121582 > Commit-Queue: Mike Klein <mtklein@google.com> > Reviewed-by: Florin Malita <fmalita@chromium.org> TBR=mtklein@chromium.org,mtklein@google.com,fmalita@chromium.org Change-Id: Id91d583151091a082a2d3f301d85f3acb12f4b19 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7810 Reviewed-on: https://skia-review.googlesource.com/121589 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
* low-hanging bilerp_clamp_8888 winsGravatar Mike Klein2018-04-16
| | | | | | | | | | | | - support sampling bgra too - lowp impl Bug: skia:7810 Change-Id: I21db805483f612024802f2b508c140c42a029c54 Reviewed-on: https://skia-review.googlesource.com/121582 Commit-Queue: Mike Klein <mtklein@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Reland "Fix handling of MaskFilter matrices"Gravatar Florin Malita2018-04-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit c64ee20e135a336ed775ccb6dec8a87efd19ec02. Reason for revert: initial failures should be fixed in https://skia.googlesource.com/skia.git/+/8eaf64ae12696d4189d3cea9f023658494cf82b8 Original change's description: > Revert "Fix handling of MaskFilter matrices" > > This reverts commit 2097fd03ffea48bd904c48c93348b2350600870e. > > Reason for revert: This is breaking a lot of Windows bots (esp. on the shadermaskfilter_localmatrix) > > Original change's description: > > Fix handling of MaskFilter matrices > > > > 1) extend GrFPArgs to track pre/post local matrices, add helpers for > > creating pre/post wrapper args > > > > 2) add a SkShaderBase helper (totalLocalMatrix) to centralize the LM > > sandwich logic. > > > > 3) update call sites to use the above > > > > 4) rename SkMatrixFilter::makeWithLocalMatrix -> makeWithMatrix, to > > disambiguate vs. SkShader::makeWithLocalMatrix. > > > > BUG=skia:7744 > > > > Change-Id: Ib2b7b007e6924979b00649dde7c94ef4b34771f1 > > Reviewed-on: https://skia-review.googlesource.com/119330 > > Commit-Queue: Florin Malita <fmalita@chromium.org> > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > TBR=bsalomon@google.com,robertphillips@google.com,fmalita@chromium.org,reed@google.com > > Change-Id: I918dbb95bf00b3122e6699b84566ec82dbb5fc5c > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia:7744 > Reviewed-on: https://skia-review.googlesource.com/120340 > Reviewed-by: Robert Phillips <robertphillips@google.com> > Commit-Queue: Robert Phillips <robertphillips@google.com> TBR=bsalomon@google.com,robertphillips@google.com,fmalita@chromium.org,reed@google.com Change-Id: If194862a928d1abe22ed8fa968436c725d19a8fc No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7744 Reviewed-on: https://skia-review.googlesource.com/120480 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Revert "Fix handling of MaskFilter matrices"Gravatar Robert Phillips2018-04-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 2097fd03ffea48bd904c48c93348b2350600870e. Reason for revert: This is breaking a lot of Windows bots (esp. on the shadermaskfilter_localmatrix) Original change's description: > Fix handling of MaskFilter matrices > > 1) extend GrFPArgs to track pre/post local matrices, add helpers for > creating pre/post wrapper args > > 2) add a SkShaderBase helper (totalLocalMatrix) to centralize the LM > sandwich logic. > > 3) update call sites to use the above > > 4) rename SkMatrixFilter::makeWithLocalMatrix -> makeWithMatrix, to > disambiguate vs. SkShader::makeWithLocalMatrix. > > BUG=skia:7744 > > Change-Id: Ib2b7b007e6924979b00649dde7c94ef4b34771f1 > Reviewed-on: https://skia-review.googlesource.com/119330 > Commit-Queue: Florin Malita <fmalita@chromium.org> > Reviewed-by: Brian Salomon <bsalomon@google.com> TBR=bsalomon@google.com,robertphillips@google.com,fmalita@chromium.org,reed@google.com Change-Id: I918dbb95bf00b3122e6699b84566ec82dbb5fc5c No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia:7744 Reviewed-on: https://skia-review.googlesource.com/120340 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Fix handling of MaskFilter matricesGravatar Florin Malita2018-04-11
| | | | | | | | | | | | | | | | | | | | 1) extend GrFPArgs to track pre/post local matrices, add helpers for creating pre/post wrapper args 2) add a SkShaderBase helper (totalLocalMatrix) to centralize the LM sandwich logic. 3) update call sites to use the above 4) rename SkMatrixFilter::makeWithLocalMatrix -> makeWithMatrix, to disambiguate vs. SkShader::makeWithLocalMatrix. BUG=skia:7744 Change-Id: Ib2b7b007e6924979b00649dde7c94ef4b34771f1 Reviewed-on: https://skia-review.googlesource.com/119330 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Remove unused field fBitmapBytesGravatar Yuqian Li2018-04-11
| | | | | | | | Bug: skia: Change-Id: I3544b8ed8a02447e765a5389a4c0ea9ca2f09944 Reviewed-on: https://skia-review.googlesource.com/120240 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* remove SK_IGNORE_TO_STRINGGravatar Cary Clark2018-04-05
| | | | | | | | | | | | | | | | | | | SK_IGNORE_TO_STRING is not defined anywhere. The same effect can be had by using a modern linker. Removing it simplifies bookmaker and makes our includes easier to understand. R=robertphillips@google.com TBR=reed@google.com Bug: skia:6898 Change-Id: Ib716f5ef1b42a7fbda0df43ece212d1b7c40289f Reviewed-on: https://skia-review.googlesource.com/118963 Reviewed-by: Robert Phillips <robertphillips@google.com> Reviewed-by: Cary Clark <caryclark@skia.org> Commit-Queue: Cary Clark <caryclark@skia.org>
* Fix SkLocalMatrixShader nesting semanticsGravatar Florin Malita2018-04-04
| | | | | | | | | | | | Inherited/outer local matrices are supposed to compose to the right of (preconcat) other/nested local matrices. BUG=skia:7781 Change-Id: Icd3c24f226845427be849a8be3d78293aef176b3 Reviewed-on: https://skia-review.googlesource.com/118344 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Reed <reed@google.com>
* Banish SkShaderBase::isRasterPipelineOnly()Gravatar Florin Malita2018-04-04
| | | | | | | | | | | | | | | | | Keeping related heuristics in sync with actual shader capabilities is somewhat tricky, and overall fragile. So how about this: instead of an explicit opt-in mechanism, try to instantiate a legacy shader context and fall back to raster pipeline on failure (null Context => implicit opt-in for raster pipeline). Shaders can still choose not to draw by returning both a null Context and failing appendStages(). BUG=skia:7772 Change-Id: I2e76f51af7064853a6cb851b4c30c82eba3ee828 Reviewed-on: https://skia-review.googlesource.com/118383 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Reed <reed@google.com>
* Fixing build with SK_IGNORE_TO_STRING defined.Gravatar Kaloyan Donev2018-03-29
| | | | | | | Change-Id: Id7238e427e490338d1f610255774c2069cfd4879 Reviewed-on: https://skia-review.googlesource.com/117060 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Klein <mtklein@google.com>
* Make consistent isRadiusIncreasing decisionGravatar Yuqian Li2018-03-19
| | | | | | | | | | | | This should not affect anything for now. But it may prevent some future problems where someone accidentally changed isRadiusIncreasing implementation, and getting confused by the unexpected shading behavior. Bug: skia: Change-Id: I45e83f4bc9eefbdc1ad1c196a43444e24c782711 Reviewed-on: https://skia-review.googlesource.com/115162 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Yuqian Li <liyuqian@google.com>
* Fix concentric 2pt conical gradient in GPU where r1 < r0Gravatar Yuqian Li2018-03-19
| | | | | | | | Bug: skia:7683 Change-Id: I6608e72fa695c855af6a6a447885c4889b09fc1d Reviewed-on: https://skia-review.googlesource.com/115042 Commit-Queue: Yuqian Li <liyuqian@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Fix GrTextureStripAtlasManager cleanup order bugGravatar Robert Phillips2018-03-19
| | | | | | | | Bug: 820703 Change-Id: I6f1a895ceb213d38361bc03a472cf2a48e4720a5 Reviewed-on: https://skia-review.googlesource.com/115001 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Harden initial LinearGradient4f tilingGravatar Florin Malita2018-03-13
| | | | | | | | | | | | | | | | | | Even with verified/finite inputs, fx can sometimes collapse to infinity. When that happens, attempting to apply repeat/mirror tiling produces NaN results and things go south. Catch these degenerate cases and tile to 0 (for lack of a better idea). Note: leaving fx == +/- inf in clamp mode should be safe. BUG=oss-fuzz:6622 Change-Id: I65711020057856b47045f67a52d906336ad1f173 Reviewed-on: https://skia-review.googlesource.com/114090 Reviewed-by: Kevin Lubick <kjlubick@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
* with no more offline codegen, seed_shader can be normalGravatar Mike Klein2018-03-11
| | | | | | | | | | | | | | We passed this iota array as an argument before because it was generating awkward code for our object file parser to handle (relocations, other weird things, can't quite remember). Now that we're compiling pipeline code normally, we can make seed_shader a normal stage again, with no special iota ctx pointer needed. Change-Id: I3929d61bfb6f914248f360c2c2326ce3d1f23163 Reviewed-on: https://skia-review.googlesource.com/113667 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Make GrTextureStripAtlas DDL friendlyGravatar Robert Phillips2018-03-09
| | | | | | | Change-Id: If8fdd7a1c027bc2b2791cfe1af13f99c2561d93d Reviewed-on: https://skia-review.googlesource.com/113268 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* tighten check when we might overflow legacy shader mathGravatar Mike Reed2018-03-08
| | | | | | | | Bug: skia:7700 Change-Id: I2ca06b7ba36f2e17d6addd31b1f67a07d478e207 Reviewed-on: https://skia-review.googlesource.com/113264 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Simplify decal for gradientsGravatar Mike Reed2018-02-19
| | | | | | | | | | | | Previous change extended the stored array of colors/positions, and lost the information that the intent was decal. This variant just uses custom stages already developed for imageshader, keeping the intent of decal. Bug: skia:7638 Change-Id: Ie3f30b42f4c1793487f08039cd3cea8e31aafc40 Reviewed-on: https://skia-review.googlesource.com/108280 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* add decal tilemode to shadersGravatar Mike Reed2018-02-16
| | | | | | | | | | | | | Plenty more to follow-up: - gradients - gpu impl Bug: skia:7638 Change-Id: I8e54fd0e24921f040f178c793b36c7fb855b136e Reviewed-on: https://skia-review.googlesource.com/107420 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>
* Avoid creating MIPs until necessary when MIP bias is activeGravatar Brian Osman2018-02-16
| | | | | | | | | | | | With sharpened mips, the scale at which we begin to sample level 1 is (obviously) less than 1. This change avoids creation of mips for images that are only slightly downscaled (and for which we wouldn't have sampled those MIPs anyway). Change-Id: If8ffc79c2ce2ff1f3aae7f5732d8a50aca0e26be Reviewed-on: https://skia-review.googlesource.com/107801 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Respect FPArgs local matrix when picking a filtering mode in image shaderGravatar Brian Osman2018-02-14
| | | | | | | | | Includes a GM that previously drew bilerp, now draws bicubic. Change-Id: I5e39e8adb49057b57729d9eb9748911ee8584401 Reviewed-on: https://skia-review.googlesource.com/107280 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* clean up SK_LEGACY_HIGH_QUALITY_SCALING_CLAMPGravatar Mike Klein2018-02-12
| | | | | | | | | | | After this rolls out, we can remove -DSK_LEGACY_HIGH_QUALITY_SCALING_CLAMP from Google and Chromium, finally. Change-Id: Ie277843d5ab6e6e762b1b2eea1c23a40cca55a38 Reviewed-on: https://skia-review.googlesource.com/106622 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* yet another approach to unpremul scale pixelsGravatar Mike Klein2018-02-09
| | | | | | | | | | | This keeps punning things to premul (in anticipation of pulling back on any unpremul support outside read/write/scalePixels), and yet still clamps correctly for scalePixels() + unpremul + HQ and/or gamut transform. Change-Id: I75977cfdb94ffbe62c538ddee39f1abd2cc01935 Reviewed-on: https://skia-review.googlesource.com/106265 Reviewed-by: Brian Osman <brianosman@google.com>