aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkColorFilter.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>
* 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>
* 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>
* null checkGravatar Mike Reed2018-02-20
| | | | | | | | Bug: oss-fuzz: 6478 Change-Id: I8730ce6444cdcaac5a610f864d902a16942635a6 Reviewed-on: https://skia-review.googlesource.com/108400 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* hide virtual and rename to onMakeComposedGravatar Mike Reed2018-02-19
| | | | | | | | Bug: skia: Change-Id: Ic18ee2af3273f81ebec9c9031162e808186c0acd Reviewed-on: https://skia-review.googlesource.com/108300 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* remove append_from_srgb()Gravatar Mike Klein2017-12-18
| | | | | | | | | | | It's now no different than append(from_srgb). Bug: skia:7419 Change-Id: I97c59b6987f033ec2f1859db40ca3056b87b370a Reviewed-on: https://skia-review.googlesource.com/86741 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* 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>
* 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>
* Rename append_uniform_color() to append_constant_color().Gravatar Mike Klein2017-08-03
| | | | | | | | | | | | | | | | | The color appended here is both uniform and constant, and it's the constantness that makes this custom append method useful over just append(SkRasterPipeline::uniform_color, ...). Uniform colors that are not constant have to be loaded from the pointer each time (the caller might have changed the color out-of-band), but constant uniform colors can be analyzed once and implemented with specalizations like black_color and white_color. Change-Id: I3cfc00ccc578dd915367bca7113010557181224c Reviewed-on: https://skia-review.googlesource.com/30560 Commit-Queue: Mike Klein <mtklein@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org> Reviewed-by: Florin Malita <fmalita@chromium.org>
* convert over to 2d-modeGravatar Mike Klein2017-07-20
| | | | | | | | | | | | [√] convert all stages to use SkJumper_MemoryCtx / be 2d-compatible [√] convert compile to 2d also, remove 1d run/compile [√] convert all call sites [√] no diffs Change-Id: I3b806eb8fe0c3ec043359616409f7cd1211a1e43 Reviewed-on: https://skia-review.googlesource.com/24263 Commit-Queue: Mike Klein <mtklein@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Singleton SRGB color filtersGravatar Florin Malita2017-07-19
| | | | | | | | Change-Id: I67e976e63bbb9ebb47616613e02adb97e6e2345c Reviewed-on: https://skia-review.googlesource.com/24303 Reviewed-by: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Plumb through need for unpremul/premulGravatar Mike Reed2017-07-07
| | | | | | | | | | Update unittest to build test image with legal premul pixels. Bug: skia: Change-Id: Iebd1d2f81cac77f8913bd79f6ac25983ed710641 Reviewed-on: https://skia-review.googlesource.com/21735 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Mike Reed <reed@google.com>
* add stages for black and white colorsGravatar Mike Reed2017-07-06
| | | | | | | | | | | | | | histogram of test skps: black: 1/7 white: 2/7 other: 4/7 Bug: skia: Change-Id: I3a092899d31ce87837e66e5c8ea9ec5e0f239361 Reviewed-on: https://skia-review.googlesource.com/21408 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Mike Reed <reed@google.com>
* only create new instance if needed for colorspacexformerGravatar Mike Reed2017-07-06
| | | | | | | | | | just an experiment to address performance when imagefilters are cached. Bug: skia: Change-Id: Ic1033c897d0a569b46a339fb3ae7f8f961882953 Reviewed-on: https://skia-review.googlesource.com/21395 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* srgb conversion needs to be in unpremulGravatar Mike Reed2017-07-06
| | | | | | | | Bug: skia: Change-Id: Ic7dffb2cb30aae33a6c127ab10ea4282e1360114 Reviewed-on: https://skia-review.googlesource.com/21536 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* add srgb gamma colorfiltersGravatar Mike Reed2017-07-05
| | | | | | | | | | | | | ... faster and more accurate than using SkTableColorFilter todo: update blink after this lands Bug:737981 Change-Id: I55b5c60dd23b9d2cbe9d60f83c74be1a8f3dcfcf Reviewed-on: https://skia-review.googlesource.com/21368 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Brian Osman <brianosman@google.com> Reviewed-by: Mike Klein <mtklein@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>
* remove unused colorfilter virtual asAComposeGravatar Mike Reed2017-06-09
| | | | | | | | Bug: skia: Change-Id: I1e23dbd18f7145dcaaa864f3fd7b34aea2c342a6 Reviewed-on: https://skia-review.googlesource.com/19269 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* update SkRasterPipeline::run() to also take yGravatar Mike Klein2017-06-01
| | | | | | | | | y isn't used yet. This is just a warmup that updates the callers. Change-Id: I78f4f44e2b82f72b3a39fa8a8bdadef1d1b8a99e Reviewed-on: https://skia-review.googlesource.com/18381 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* make SkColorFilter::onAppendStages() pureGravatar Mike Klein2017-06-01
| | | | | | | Change-Id: I2851e19648fb0478db9b940e86c6ddb2020000b3 Reviewed-on: https://skia-review.googlesource.com/18264 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Reed <reed@google.com>
* 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>
* fix 565Gravatar Mike Klein2017-05-09
| | | | | | | | | Change-Id: Ibde5242dc4f66b720cb8be1e2d771ba88b12b496 Reviewed-on: https://skia-review.googlesource.com/16241 Commit-Queue: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@google.com> Commit-Queue: Matt Sarett <msarett@google.com> Reviewed-by: Matt Sarett <msarett@google.com>
* Make SkColorFilter::appendStages() not fail.Gravatar Mike Klein2017-05-09
| | | | | | | | | | | | | | | | | | This makes SkColorFilter::appendStages() first try onAppendStages(), and if it's unimplemented or fails, fall back to filterSpan4f(). This also makes onAppendStages() private to try to ensure that appendStages() is now its only caller, ensuring everyone goes through this fallback path. The fallback uses the color filter transformed into the dst colorspace using our new SkColorSpaceXformer... that seem ok Matt? Change-Id: I4751a6859596fa4f7e844e69ef0d986f005b52c7 Reviewed-on: https://skia-review.googlesource.com/16031 Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* composecolorfilter can now append stagesGravatar Mike Reed2017-05-05
| | | | | | | | Bug: skia: Change-Id: I46b54e5fd09de16b467142a5501b226273182d52 Reviewed-on: https://skia-review.googlesource.com/15615 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* 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>
* SkColorFilter::makeColorSpace()Gravatar Mike Klein2017-04-26
| | | | | | | Change-Id: Idea4afac67ef348c2f4e64f4fe6a03704a86652f Reviewed-on: https://skia-review.googlesource.com/14375 Reviewed-by: Matt Sarett <msarett@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
* SkColorSpaceXformer: Handle compose color filtersGravatar Matt Sarett2017-04-17
| | | | | | | | | | | | | | | We could alternatively use the makeColorSpace() approach that we adoped for loopers and imagefilters, but this seems fine. This should finish xform canvas work on color filters. We have plenty of color filters that do math on colors, but only two that might actually hold colors. Bug: skia:6516 Change-Id: I1aee8c35d6886fdc149d4659d1bac2edc0d32b67 Reviewed-on: https://skia-review.googlesource.com/13649 Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Klein <mtklein@chromium.org>
* FuzzCanvas: SkColorFilterGravatar Hal Canary2017-03-07
| | | | | | | | | | | * Also fix SkRRect generation to only make valid RRs.a * drawDRRect only draws if outer contains inner. * Also fix SkComposeColorFilter::toString Change-Id: Ia75da2813555b7714663929d0ec288ae2a86d9f1 Reviewed-on: https://skia-review.googlesource.com/9399 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Kevin Lubick <kjlubick@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>
* 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>
* remove unused code around SK_SUPPORT_LEGACY_XFERMODE_PARAMGravatar Mike Reed2016-11-03
| | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4384 Change-Id: I5121acd027d935ade169ff65941f29f654a47bd0 Reviewed-on: https://skia-review.googlesource.com/4384 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* 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>
* remove xfermode from public apiGravatar Mike Reed2016-10-28
| | | | | | | | | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4020 CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Change-Id: I19cd056f2af778f10e8c6c2b7b2735593b43dbac Reviewed-on: https://skia-review.googlesource.com/4020 Reviewed-by: Florin Malita <fmalita@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org> Commit-Queue: Mike Reed <reed@google.com>
* 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>
* Add SkRasterPipeline blitter.Gravatar mtklein2016-07-22
| | | | | | | | | | | This is now pixel-exact with the existing sRGB SW impl as far as I've tested. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2146413002 CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot,Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN-Trybot Committed: https://skia.googlesource.com/skia/+/3011e337693a9786f62d8de9ac4b239ad6dbdaca Review-Url: https://codereview.chromium.org/2146413002
* Revert of Add SkRasterPipeline blitter. (patchset #18 id:340001 of ↵Gravatar mtklein2016-07-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/2146413002/ ) Reason for revert: Leaking the blitter https://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN/builds/7908/steps/test_skia%20on%20Ubuntu/logs/stdio Original issue's description: > Add SkRasterPipeline blitter. > > This is now pixel-exact with the existing sRGB SW impl as far as I've tested. > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2146413002 > CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot > > Committed: https://skia.googlesource.com/skia/+/3011e337693a9786f62d8de9ac4b239ad6dbdaca TBR=reed@google.com,mtklein@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/2178523002
* Add SkRasterPipeline blitter.Gravatar mtklein2016-07-22
| | | | | | | | | | This is now pixel-exact with the existing sRGB SW impl as far as I've tested. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2146413002 CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot Review-Url: https://codereview.chromium.org/2146413002
* Fix incorrect swizzle on BGRA platforms in filterColor4f pathGravatar brianosman2016-06-24
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2091923003 Review-Url: https://codereview.chromium.org/2091923003
* Fix bug in filterSpan4f - read the source, rather than the destGravatar brianosman2016-06-23
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2091793003 Review-Url: https://codereview.chromium.org/2091793003
* 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
* Style bikeshed - remove extraneous whitespaceGravatar halcanary2016-03-29
| | | | | | GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1842753002 Review URL: https://codereview.chromium.org/1842753002
* 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