aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/shaders/SkImageShader.h
Commit message (Collapse)AuthorAge
* 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>
* 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>
* 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>
* 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>
* 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>
* 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>
* Revert "alternate approach to unpremul scalePixels()"Gravatar Mike Klein2018-02-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit c4616804bb407506c6ac1046c7e25e2016911449. Reason for revert: screwed up the guard I think Original change's description: > alternate approach to unpremul scalePixels() > > We want to keep the clamps in SkImageShader, and keep unpremul > scalePixels() happy too. > > So we extend SkImageShader's internal API to allow specifying an output > alpha type, which controls whether we premul or unpremul and how we > clamp. scalePixels() uses this to draw instead of a drawBitmap() call. > > Sort of backwards of usual, we opt our local builds into > SK_LEGACY_HIGH_QUALITY_SCALING_CLAMP (and Google3 is already defining > this). Then to rebase Chromium we will _define_ this in Chromium's user > config, fold it through as if always defined in Skia, then finally > remove the definition from Chromium's user config. > > Change-Id: I38035f0886f79700e7301c3c6042ce362c771d96 > Reviewed-on: https://skia-review.googlesource.com/90480 > Reviewed-by: Brian Osman <brianosman@google.com> > Commit-Queue: Mike Klein <mtklein@chromium.org> TBR=mtklein@chromium.org,mtklein@google.com,brianosman@google.com,reed@google.com Change-Id: Ib53a7f29c25310b667f9a61f67f8638403ec9da3 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/106220 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* alternate approach to unpremul scalePixels()Gravatar Mike Klein2018-02-09
| | | | | | | | | | | | | | | | | | | | We want to keep the clamps in SkImageShader, and keep unpremul scalePixels() happy too. So we extend SkImageShader's internal API to allow specifying an output alpha type, which controls whether we premul or unpremul and how we clamp. scalePixels() uses this to draw instead of a drawBitmap() call. Sort of backwards of usual, we opt our local builds into SK_LEGACY_HIGH_QUALITY_SCALING_CLAMP (and Google3 is already defining this). Then to rebase Chromium we will _define_ this in Chromium's user config, fold it through as if always defined in Skia, then finally remove the definition from Chromium's user config. Change-Id: I38035f0886f79700e7301c3c6042ce362c771d96 Reviewed-on: https://skia-review.googlesource.com/90480 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* rename inner AsFPArgs to stand-alone GrFPArgsGravatar Mike Reed2018-01-19
| | | | | | | | | | This prepares us to share this with other effects (most notably maskfilters) Bug: skia: Change-Id: I12530fdf10c4e5f2a9ab6d394bf9e87c54ea60c4 Reviewed-on: https://skia-review.googlesource.com/97062 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* fold params into StageRecGravatar Mike Reed2017-08-29
| | | | | | | | | | | | | pre-CL before trying to add a hint-rect field to allow shaders to "optimize" their stages for a given restriction in device space - e.g. if the shader's intrinsic domain is contained, it won't need to tile/clamp Bug: skia: Change-Id: Ia2da557691da25f31e4b9e3f53c3bc6709b89083 Reviewed-on: https://skia-review.googlesource.com/40224 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Reed <reed@google.com>
* use rasterpipeline if localmatrix is rotated or skewed for imagesGravatar Mike Reed2017-08-21
| | | | | | | | | Bug: skia: Change-Id: Ib269b5b9d79b055fe614aaacfd7e0d05d48f6085 Reviewed-on: https://skia-review.googlesource.com/33180 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Yuqian Li <liyuqian@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Make GrFragmentProcessor be non-refcounted and use std::unique_ptr.Gravatar Brian Salomon2017-08-11
| | | | | | | Change-Id: I985e54a071338e99292a5aa2f42c92bc115b4008 Reviewed-on: https://skia-review.googlesource.com/32760 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* use rasterpipeline for images if matrix is >= scale+translateGravatar Mike Reed2017-08-08
| | | | | | | | | Bug: skia: Change-Id: I36112fe54c6f2d0965d0b88f0291d7ffe0902715 Reviewed-on: https://skia-review.googlesource.com/30480 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Retry cleaning up SkLinearBitmapPipeline.Gravatar Mike Klein2017-07-20
| | | | | | | | | | | | | | | | | | This is mostly dead code. In order to make it truly dead, we need to opt drawing unpremul images into SkRasterPipelineBlitter. They had been handled by SkLinearBitmapPipeline, but can't be draw by SkBitmapProcLegacyShader. Drawing unpremul images is tested by the GM all_variants_8888, which gave us trouble last time around (serialize-8888 drew right, 8888 wrong) but now draws fine. I think this was probably also the root of the revert, drawing some unpremul image in Chrome's tests somewhere. Change-Id: I453f9df44ade807316935921cbae82961e2f08aa Reviewed-on: https://skia-review.googlesource.com/24862 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Add some raster pipeline perspective assertsGravatar Florin Malita2017-07-12
| | | | | | | | | | | | | | | | | | | | | I meant to add these when removing the guard, but since we landed without a guard, might as well do it now. A couple of things exposed by these asserts: 1) we need to also catch perspective in local matrices 2) we need to disallow burst mode with perspective Also tweak the predicate to hasPerspective() instead of explicit mask check. Change-Id: I099e5125fca52dccffca77c60fc800bbdf539b53 Reviewed-on: https://skia-review.googlesource.com/22483 Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Mike Klein <mtklein@google.com> Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Revert[2] "use rasterpipeline for non-8888-clamp shaders (so we can delete ↵Gravatar Mike Reed2017-06-22
| | | | | | | | | | | | | | | more legacy code)"" Now with guard for Chrome and fix for bench https://codereview.chromium.org/2947233002/ This reverts commit 19d0b99922712df3f07ba4622f1e5ccddc3b7168. Bug: skia: Change-Id: I5991955d0d927d34a184cf4d9844b0d565e03b88 Reviewed-on: https://skia-review.googlesource.com/20461 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Revert "use rasterpipeline for non-8888-clamp shaders (so we can delete more ↵Gravatar Mike Reed2017-06-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | legacy code)" This reverts commit 00b8ab61ddf6723a593bfcc931bbabb957aa7b19. Reason for revert: breaks nanobench Original change's description: > use rasterpipeline for non-8888-clamp shaders (so we can delete more legacy code) > > Definitely changes some GMs, but I think they're all more correct. > > Bug: skia: > Change-Id: Ic30622f2c17325bce4c82b4d7997036d3cc026c2 > Reviewed-on: https://skia-review.googlesource.com/20363 > Reviewed-by: Florin Malita <fmalita@chromium.org> > Reviewed-by: Mike Klein <mtklein@google.com> > Commit-Queue: Mike Reed <reed@google.com> TBR=mtklein@google.com,herb@google.com,fmalita@chromium.org,reed@google.com Change-Id: I6b7e8d68deb8b62bd9688c95a5937a0bba8b4cf5 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/20431 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* use rasterpipeline for non-8888-clamp shaders (so we can delete more legacy ↵Gravatar Mike Reed2017-06-21
| | | | | | | | | | | | | code) Definitely changes some GMs, but I think they're all more correct. Bug: skia: Change-Id: Ic30622f2c17325bce4c82b4d7997036d3cc026c2 Reviewed-on: https://skia-review.googlesource.com/20363 Reviewed-by: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Mike Reed <reed@google.com>
* [Reland] Relocate shaders to own dirGravatar Florin Malita2017-05-30
| | | | | | | | | | | Consolidate all shader impls under src/shaders/. (reland of https://skia-review.googlesource.com/c/17927/) Change-Id: I7918bdc1aafe842ed194412ba95b9ae53a2ec1d7 Reviewed-on: https://skia-review.googlesource.com/18146 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Revert "Relocate shaders to own dir"Gravatar Stan Iliev2017-05-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit fabe0b26d05624ce7374f6ca89bd66df6142534e. Reason for revert: Last android roll failed with "external/skia/src/effects/SkGaussianEdgeShader.h:11:10: fatal error: 'SkShaderBase.h' file not found" Original change's description: > Relocate shaders to own dir > > Consolidate all shader impls under src/shaders/. > > Change-Id: I450e37541214704c1ad9e379d9d753b7cc62fac3 > Reviewed-on: https://skia-review.googlesource.com/17927 > Commit-Queue: Florin Malita <fmalita@chromium.org> > Reviewed-by: Herb Derby <herb@google.com> > TBR=mtklein@google.com,herb@google.com,fmalita@chromium.org,reed@google.com No-Presubmit: true No-Tree-Checks: true No-Try: true Change-Id: Idbb2b75053969df1dad9d8ce0217cd39189b9ddb Reviewed-on: https://skia-review.googlesource.com/18020 Reviewed-by: Stan Iliev <stani@google.com> Commit-Queue: Stan Iliev <stani@google.com>
* Relocate shaders to own dirGravatar Florin Malita2017-05-25
Consolidate all shader impls under src/shaders/. Change-Id: I450e37541214704c1ad9e379d9d753b7cc62fac3 Reviewed-on: https://skia-review.googlesource.com/17927 Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Herb Derby <herb@google.com>