aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects/SkLumaColorFilter.cpp
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>
* converted LumaColorFilterEffect to skslGravatar Ethan Nicholas2017-11-07
| | | | | | | | Bug: skia: Change-Id: I208984ec9ad357249ee1b2fe28477f1450b4b69d Reviewed-on: https://skia-review.googlesource.com/67848 Commit-Queue: Ethan Nicholas <ethannicholas@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Pass GrRenderTargetContext's GrColorSpaceInfo to SkShader and SkColorFilter.Gravatar Brian Salomon2017-10-25
| | | | | | | | | | | | | | Also to SkColorTo(Premul|Unpremul)GrColor4f. This can avoid cache lookups to find GrColorSpaceXforms as the xform pointer is stored in GrColorSpaceInfo after the first lookup. Also uses GrColorSpaceInfo to construct GrTextUtils::Paint. Bug: skia: Change-Id: Idf19d512a60d2269e6921c7fb54d93aee499a70d Reviewed-on: https://skia-review.googlesource.com/63660 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
* initClassID no longer auto-allocates idsGravatar Ethan Nicholas2017-10-09
| | | | | | | | | | | | | Auto-allocated IDs mean that the IDs depend upon the order in which classes happen to get initialized and are therefore not consistent from run to run. This change paves the way for a persistent shader cache by fixing the IDs in an enum. Bug: skia: Change-Id: I3e923c6c54f41b3b3eb616458abee83e0909c09f Reviewed-on: https://skia-review.googlesource.com/56401 Commit-Queue: Ethan Nicholas <ethannicholas@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* re-land of new SkSL precisionsGravatar Ethan Nicholas2017-09-18
| | | | | | | | Bug: skia: Change-Id: Ic1deb3db2cbda6ca45f93dee99832971a36a2119 Reviewed-on: https://skia-review.googlesource.com/47841 Commit-Queue: Ethan Nicholas <ethannicholas@google.com> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
* Revert "Revert "Revert "Switched highp float to highfloat and mediump float ↵Gravatar Ethan Nicholas2017-09-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | to half.""" This reverts commit 05d5a13fea6246648de7e41358ed338d53c85ea2. Reason for revert: looks like it broke filterfastbounds Original change's description: > Revert "Revert "Switched highp float to highfloat and mediump float to half."" > > This reverts commit 1d816b92bb7cf2258007f3f74ffd143b89f25d01. > > Bug: skia: > Change-Id: I388b5e5e9bf619db48297a80c9a80c039f26c9f1 > Reviewed-on: https://skia-review.googlesource.com/46464 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Ethan Nicholas <ethannicholas@google.com> TBR=bsalomon@google.com,ethannicholas@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: skia: Change-Id: Iddf6aef2ab084aa73da7ceebdfc303a1d2b80cde Reviewed-on: https://skia-review.googlesource.com/47441 Reviewed-by: Ethan Nicholas <ethannicholas@google.com> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
* Revert "Revert "Switched highp float to highfloat and mediump float to half.""Gravatar Ethan Nicholas2017-09-15
| | | | | | | | | | This reverts commit 1d816b92bb7cf2258007f3f74ffd143b89f25d01. Bug: skia: Change-Id: I388b5e5e9bf619db48297a80c9a80c039f26c9f1 Reviewed-on: https://skia-review.googlesource.com/46464 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Ethan Nicholas <ethannicholas@google.com>
* make most of SkColorPriv.h privateGravatar Cary Clark2017-09-15
| | | | | | | | | | | | | created new file src/core/SkColorData.h for internal consumption. Note that many of the functions there are unused as well. Bug: skia: 6898 R: reed@google.com Change-Id: I25bfd5a9c21f53558c4ca65a77eb5d322d897c6d Reviewed-on: https://skia-review.googlesource.com/46848 Commit-Queue: Cary Clark <caryclark@google.com> Reviewed-by: Mike Reed <reed@google.com>
* Revert "Switched highp float to highfloat and mediump float to half."Gravatar Brian Salomon2017-08-17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 88d99c63878c2d3d340120f0321676f72afcb4f0. Reason for revert: Believed to be causing unit test failures in Chrome roll: https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/364433 https://luci-logdog.appspot.com/v/?s=chromium%2Fbb%2Ftryserver.chromium.android%2Flinux_android_rel_ng%2F364433%2F%2B%2Frecipes%2Fsteps%2Fcontent_browsertests__with_patch__on_Android%2F0%2Flogs%2FWebRtcCaptureFromElementBrowserTest.VerifyCanvasWebGLCaptureColor%2F0 Original change's description: > Switched highp float to highfloat and mediump float to half. > > The ultimate goal is to end up with "float" and "half", but this > intermediate step uses "highfloat" so that it is clear if I missed a > "float" somewhere. Once this lands, a subsequent CL will switch all > "highfloats" back to "floats". > > Bug: skia: > Change-Id: Ia13225c7a0a0a2901e07665891c473d2500ddcca > Reviewed-on: https://skia-review.googlesource.com/31000 > Commit-Queue: Ethan Nicholas <ethannicholas@google.com> > Reviewed-by: Brian Salomon <bsalomon@google.com> TBR=bsalomon@google.com,csmartdalton@google.com,ethannicholas@google.com Change-Id: I8bfa97547ac3920d433665f161d27df3f15c83aa No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/35705 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Switched highp float to highfloat and mediump float to half.Gravatar Ethan Nicholas2017-08-16
| | | | | | | | | | | | | The ultimate goal is to end up with "float" and "half", but this intermediate step uses "highfloat" so that it is clear if I missed a "float" somewhere. Once this lands, a subsequent CL will switch all "highfloats" back to "floats". Bug: skia: Change-Id: Ia13225c7a0a0a2901e07665891c473d2500ddcca Reviewed-on: https://skia-review.googlesource.com/31000 Commit-Queue: Ethan Nicholas <ethannicholas@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* 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>
* renamed SkSL types in preparation for killing precision modifiersGravatar Ethan Nicholas2017-07-28
| | | | | | | | Bug: skia: Change-Id: Iff0289e25355a89cdc289a0892ed755dd1b1c900 Reviewed-on: https://skia-review.googlesource.com/27703 Commit-Queue: Ethan Nicholas <ethannicholas@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* Implement clone() for 4 additional GrFragmentProcessor subclassesGravatar Brian Salomon2017-07-27
| | | | | | | | | | | | HighContrastFilterEffect LumaColorFilterEffect OverdrawFragmentProcessor RRectsGaussianEdgeFP Change-Id: Ie843e025e49dd46e3f75a5f79d399ddd3ceba5cd Reviewed-on: https://skia-review.googlesource.com/26660 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* remove filterSpan from SkColorFilterGravatar Mike Reed2017-06-29
| | | | | | | | | | Bug: skia: Change-Id: Ie8a31ea8131c08d251a825622484342e3e174474 Reviewed-on: https://skia-review.googlesource.com/21207 Commit-Queue: Mike Reed <reed@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org>
* slant colorfilter away from filterSpan4fGravatar Mike Reed2017-05-31
| | | | | | | | | | | rename to make it easy to delete any impl that also had onAppendStages... i.e. rename to make it clear that it is just an impl trick for rasterpipeline. Bug: skia: Change-Id: If3c3b2811eff12d399cdf7a77552c01e72c06996 Reviewed-on: https://skia-review.googlesource.com/18234 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* void SkColorFilter::onAppendStages(...)Gravatar Mike Klein2017-05-09
| | | | | | | | | | | SkColorFilter::onAppendStages() can't actually fail today. Let's enforce that. This means the fallback is now used only for color filters that have not implemented onAppendStages(). Change-Id: Ica3939685694f6186727766b54914b9ba05ca68c Reviewed-on: https://skia-review.googlesource.com/16231 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* force all colorfilters to implement 4fGravatar Mike Reed2017-05-04
| | | | | | | | | | | high-contrast gms differ at most by 1 bit Bug: skia: Change-Id: I1308bd105020ea3cd5a30fd3dd322ed134fb5ed5 Reviewed-on: https://skia-review.googlesource.com/15249 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Remove GrFragmentProcessor::computeInvariantOutputGravatar Brian Salomon2017-02-13
| | | | | | | Change-Id: If475730103052c6097eb91be06808fb723b70bf8 Reviewed-on: https://skia-review.googlesource.com/8330 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Revert "Revert "Start of rewrite of GrFragmentProcessor optimizations.""Gravatar Brian Salomon2017-01-27
| | | | | | | | | | | This reverts commit 052fd5158f7f85e478a9f87c45fecaacf7d0f5f3. Disables the test (of unused code) until platform-specific issues are addressed. Change-Id: I7aa23a07954fccf382aa07d28afcbffb0bebcd6d Reviewed-on: https://skia-review.googlesource.com/7656 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Revert "Start of rewrite of GrFragmentProcessor optimizations."Gravatar Ethan Nicholas2017-01-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 85eb4226a4cd8c10a0e3f3ba2f3a60efbb2dd61b. Reason for revert: test failures on Windows, e.g. https://chromium-swarm.appspot.com/task?id=33f9527484414110&refresh=10 Original change's description: > Start of rewrite of GrFragmentProcessor optimizations. > > This adds a replacement for computeInvariantOutput buts does not use it yet. The replacement allows for three types of optimizations: > > * known input color -> known output color for GrFP elimination > * tracking of whether all color processors modulate their input for the "tweak alpha" optimziation > * opaqueness tracking > > This loses some of the generality of computInvariantOutput. It does not track the known output status of individual color components (other than opaque alpha). It does not track whether GrFragmentProcessors read their input color. It doesn't allow a processor that will receive non-constant output to advertise that it produces a constant output. These could probably be added back in the unlikely case that they prove valuable. > > Unlike computeInvariantOutput the optimizations are decided at instantiation time and constant colors are expressed as GrColor4f rather than GrColor. > > Change-Id: I684d3f9050693dde2d28154fa695e049ed8cf61a > Reviewed-on: https://skia-review.googlesource.com/7481 > Reviewed-by: Greg Daniel <egdaniel@google.com> > Commit-Queue: Brian Salomon <bsalomon@google.com> > TBR=egdaniel@google.com,bsalomon@google.com,brianosman@google.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: I2390df257456013fa74137cb5d7b5a93820c291e Reviewed-on: https://skia-review.googlesource.com/7652 Commit-Queue: Ethan Nicholas <ethannicholas@google.com> Reviewed-by: Ethan Nicholas <ethannicholas@google.com>
* Start of rewrite of GrFragmentProcessor optimizations.Gravatar Brian Salomon2017-01-27
| | | | | | | | | | | | | | | | | This adds a replacement for computeInvariantOutput buts does not use it yet. The replacement allows for three types of optimizations: * known input color -> known output color for GrFP elimination * tracking of whether all color processors modulate their input for the "tweak alpha" optimziation * opaqueness tracking This loses some of the generality of computInvariantOutput. It does not track the known output status of individual color components (other than opaque alpha). It does not track whether GrFragmentProcessors read their input color. It doesn't allow a processor that will receive non-constant output to advertise that it produces a constant output. These could probably be added back in the unlikely case that they prove valuable. Unlike computeInvariantOutput the optimizations are decided at instantiation time and constant colors are expressed as GrColor4f rather than GrColor. Change-Id: I684d3f9050693dde2d28154fa695e049ed8cf61a Reviewed-on: https://skia-review.googlesource.com/7481 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Stop tracking whether GrFragmentProcessors read their inputGravatar Brian Salomon2017-01-23
| | | | | | | Change-Id: Id5338901978b97289798eaef873527597bd8dfd6 Reviewed-on: https://skia-review.googlesource.com/7414 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Remove SkFallbackAlloc and SkFixedAlloc.Gravatar Herb Derby2017-01-16
| | | | | | | | | | | CQ_INCLUDE_TRYBOTS=skia.primary:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-ASAN;skia.primary:Test-Ubuntu-Clang-GCE-CPU-AVX2-x86_64-Debug-MSAN TBR=reed@google.com Change-Id: I1000dc9ed8ad65b249798759d9af99f47fc237d2 Reviewed-on: https://skia-review.googlesource.com/6809 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Herb Derby <herb@google.com>
* Merge GrGLSLCaps into GrShaderCapsGravatar Brian Salomon2016-11-29
| | | | | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5121 Change-Id: If8d13638f80f42161cbc766a2666c5789e5772c8 Reviewed-on: https://skia-review.googlesource.com/5121 Reviewed-by: Ethan Nicholas <ethannicholas@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* Fix SkModeColorFilter in 565Gravatar Mike Klein2016-11-12
| | | | | | | | | | | | | | | | | It has been incorrectly interpreting its SkColor as sRGB all the time. Now, we plumb through the destintation color space and some scratch space, letting it decide how to interpret its SkColor later when it knows about the dst color space. The scratch space is blitter scoped, which lets this be thread safe (this is much like SkShader::Context). This only corrects the gamma transformation for now. I've kept my previous TODO about gamut transformation. Everything assumes sRGB gamut for now. Shaders will get the same treatement in this pipeline. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4725 Change-Id: I55b0c7d5db9ad8d7dcdd6295c9dac61d10aeaed4 Reviewed-on: https://skia-review.googlesource.com/4725 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* Add Matrix colorfilter pipeline stages.Gravatar Mike Klein2016-11-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This breaks the color filter down into a couple logical steps: - go to unpremul - apply the 4x5 matrix - clamp to [0,1] - go to premul Because we already have handy premul clamp stages, we swap the order of clamp and premul. This is lossless. While adding our stages to the pipeline, we analyze the matrix to see if we can skip any steps: - we can skip unpremul if the shader is opaque (alphas are all 1 ~~~> we're already unpremul); - we can skip the premul back if the color filter always produces opaque (here, are the inputs opaque and do we keep them that way, but we could also check for an explicit 0 0 0 0 1 alpha row); - we can skip the clamp_0 if the matrix can never produce a value less than 0; - we can skip the clamp_1 if the matrix can never produce a value greater than 1. The only thing that should seem missing is per-pixel alpha checks. We don't do those here, but instead make up for it by operating on 4-8 pixels at a time. We don't split the 4x5 matrix into a 4x4 and 1x4 translate. We could, but when we have FMA (new x86, all ARMv8) we might as well work the translate for free into the FMAs. This makes gm/fadefilter.cpp draw differently in sRGB and F16 modes, bringing them in line with the GPU sRGB and GPU f16 configs. It's unclear to me what was wrong with the old CPU implementation. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4346 CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Change-Id: I14082ded8fb8d63354167d9e6b3f8058f840253e Reviewed-on: https://skia-review.googlesource.com/4346 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* SkRasterPipeline: implement SkLumaColorFilterGravatar Mike Klein2016-11-01
| | | | | | | | | | | | | | | | | | After getting discouraged by the non-separable xfermodes, I decided to look at filling out the color filters instead. This one's nice and easy. There's only 1 GM that exercises this color filter, and it's drawing noticeably lighter now in f16 and sRGB configs. 565 is unchanged. This makes me think the diffs are due to lost precision in the previous method, which was going through the default fallback to 8888 filterSpan(). I double checked: the f16 config now draws nearly identically to the gpuf16 config. It used to be quite different. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4183 CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Change-Id: Ic6feaecae5cf18493b5df89733f6a5ca362e9a75 Reviewed-on: https://skia-review.googlesource.com/4183 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* GrConstColorProcessor uses 4f colors in the destination spaceGravatar Brian Osman2016-10-26
| | | | | | | | | | | | | | | | | | | | Many places that construct one are explicitly specifying opaque white or transparent black, which we can assume (based on the semantics of the operation) should remain (0,0,0,0) or (1,1,1,1), so that's simple. In other cases, we convert our source color to destination space. One wrinkle is tht SkColorFilter now needs to know the destination color space, due to SkModeColorFilter. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3903 Change-Id: I4969c0260588f4021300733f601b47dc606adf79 Reviewed-on: https://skia-review.googlesource.com/3903 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* sk_sp for Ganesh.Gravatar bungeman2016-06-09
| | | | | | | | | | Convert use of GrFragmentProcessor, GrGeometryProcessor, and GrXPFactory to sk_sp. This clarifies ownership and should reduce reference count churn by moving ownership. GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2041113004 Review-Url: https://codereview.chromium.org/2041113004
* change flattenable factory to return sk_spGravatar reed2016-04-03
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1855733002 Review URL: https://codereview.chromium.org/1855733002
* Reland of [2] of "switch colorfilters to sk_sp (patchset #11 id:200001 of ↵Gravatar reed2016-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.o… (patchset #1 id:1 of https://codereview.chromium.org/1821103004/ ) Reason for revert: guard has now landed in chrome Original issue's description: > Revert of Revert[2] of "switch colorfilters to sk_sp (patchset #11 id:200001 of https://codereview.chromium.o… (patchset #3 id:40001 of https://codereview.chromium.org/1825073002/ ) > > Reason for revert: > CreateModeFilter not compiling > > Original issue's description: > > Revert[2] of "switch colorfilters to sk_sp (patchset #11 id:200001 of https://codereview.chromium.org/1822623002/ )" > > > > Fixed legacy withColorFilter to call new(er) make method > > > > This reverts commit 1eb81db650d31f50be67b12d60c4f9e7dd08432f. > > > > BUG=skia: > > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1825073002 > > > > TBR= > > > > Committed: https://skia.googlesource.com/skia/+/4c9776b046dd5e9e46e2d1ce35154855c8fcb381 > > TBR= > # Skipping CQ checks because original CL landed less than 1 days ago. > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/d6889293dd0942f27f9593f679722c956831f2c4 TBR= # Not skipping CQ checks because original CL landed more than 1 days ago. BUG=skia: Review URL: https://codereview.chromium.org/1827433002
* Revert of Revert[2] of "switch colorfilters to sk_sp (patchset #11 id:200001 ↵Gravatar reed2016-03-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | of https://codereview.chromium.o… (patchset #3 id:40001 of https://codereview.chromium.org/1825073002/ ) Reason for revert: CreateModeFilter not compiling Original issue's description: > Revert[2] of "switch colorfilters to sk_sp (patchset #11 id:200001 of https://codereview.chromium.org/1822623002/ )" > > Fixed legacy withColorFilter to call new(er) make method > > This reverts commit 1eb81db650d31f50be67b12d60c4f9e7dd08432f. > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1825073002 > > TBR= > > Committed: https://skia.googlesource.com/skia/+/4c9776b046dd5e9e46e2d1ce35154855c8fcb381 TBR= # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1821103004
* Revert[2] of "switch colorfilters to sk_sp (patchset #11 id:200001 of ↵Gravatar reed2016-03-22
| | | | | | | | | | | | | | | https://codereview.chromium.org/1822623002/ )" Fixed legacy withColorFilter to call new(er) make method This reverts commit 1eb81db650d31f50be67b12d60c4f9e7dd08432f. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1825073002 TBR= Review URL: https://codereview.chromium.org/1825073002
* Revert of switch colorfilters to sk_sp (patchset #11 id:200001 of ↵Gravatar reed2016-03-22
| | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1822623002/ ) Reason for revert: need to fix unguarded makeWithFilter Original issue's description: > switch colorfilters to sk_sp > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1822623002 > > Committed: https://skia.googlesource.com/skia/+/f809d7687a4fb7b88b651b046da2bc0035d6aa09 TBR=fmalita@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1820303002
* switch colorfilters to sk_spGravatar reed2016-03-22
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1822623002 Review URL: https://codereview.chromium.org/1822623002
* Add more specialized fragment buildersGravatar cdalton2016-02-18
| | | | | | | | | | | Adds specialized fragment builders for primitive and fragment processors. Removes fragment-specific functionality from the Xfer fragment builder. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1709153002 Review URL: https://codereview.chromium.org/1709153002
* Next round of GrGLSLFragmentProcessor-derived class cleanupGravatar robertphillips2016-02-04
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1661143003 Review URL: https://codereview.chromium.org/1661143003
* Clean up GrGLSLFragmentProcessor-derived classesGravatar robertphillips2016-02-03
| | | | | | | | In some other patches it was observed that many of the GrGLSLFragmentProcessor-derived classes needlessly pass a parameter to their constructors. GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1666773002 Review URL: https://codereview.chromium.org/1666773002
* Create GLSLUniformHandler class for gpu backendGravatar egdaniel2015-12-03
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1490283004
* Add ShaderBuilders to EmitArgs and remove gettings from ProgBuilder.Gravatar egdaniel2015-11-18
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1457543003
* Rename some processor functions from GL to GLSLGravatar egdaniel2015-11-13
| | | | | | | | TBR=bsalomon@google.com BUG=skia: Review URL: https://codereview.chromium.org/1443743002
* Make all GrFragmentProcessors GL independent.Gravatar egdaniel2015-11-13
| | | | | | | | TBR=bsalomon@google.com BUG=skia: Review URL: https://codereview.chromium.org/1434313002
* Move all ShaderBuilder files to GLSLGravatar egdaniel2015-11-11
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1438003003
* Stop creating static GrProcessor instancesGravatar bsalomon2015-10-21
| | | | | | | | R=joshualitt@google.com BUG=skia:4483 Review URL: https://codereview.chromium.org/1414733007
* Bye bye processor data manager.Gravatar bsalomon2015-10-06
| | | | Review URL: https://codereview.chromium.org/1388113002