aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects
Commit message (Collapse)AuthorAge
* 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>
* Fix fuzzer bug i.e., compute the correct repeated dst domainGravatar Robert Phillips2018-05-18
| | | | | | | | BUG: oss-fuzz:8367 Change-Id: Ib5a9bf6e8446459db88016176e4c22397a3f1965 Reviewed-on: https://skia-review.googlesource.com/129184 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Prevent SkMatrixConvolutionImageFilter from allocating large buffers it ↵Gravatar Kevin Lubick2018-05-18
| | | | | | | | | | can't fill Bug: skia:7937 Change-Id: I71a5673939b3d91864a4b788e1e3a520b0ee04dd Reviewed-on: https://skia-review.googlesource.com/129179 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Kevin Lubick <kjlubick@google.com>
* Add SkIRect::adjust methodGravatar Robert Phillips2018-05-18
| | | | | | | Change-Id: Ib18d1a82944524e20d5d72912d8db7a823c470de Reviewed-on: https://skia-review.googlesource.com/128884 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Cary Clark <caryclark@google.com>
* Fix bugs related to SkMatrixConvolutionImageFilter in repeat modeGravatar Robert Phillips2018-05-18
| | | | | | | | | This should fix most of the fuzzer complaints Change-Id: I47a616e78b47bd162cbef647b03f5c1f23017c6f Reviewed-on: https://skia-review.googlesource.com/129165 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Fix srcBounds computation in SkMatrixConvolutionImageFilterGravatar Robert Phillips2018-05-17
| | | | | | | | | | | Note that this does change the behavior of the cropRect for the repeated case. The cropRect now only acts as a hard clip on the output. BUG= skia:7766 Change-Id: I1d66678bc797cd4835701cd20c36e68b22ac880a Reviewed-on: https://skia-review.googlesource.com/127338 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Robert Phillips <robertphillips@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>
* Minor refactoring to image filtersGravatar Robert Phillips2018-05-14
| | | | | | | | | | This pulls the boring parts out of: https://skia-review.googlesource.com/c/skia/+/127338 (Fix srcBounds computation in SkMatrixConvolutionImageFilter) TBR=bsalomon@google.com Change-Id: Iade788fcc96c4c16989d13e7592030a6a1d3f170 Reviewed-on: https://skia-review.googlesource.com/127573 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* detect overflow for morphologyGravatar Mike Reed2018-05-13
| | | | | | | | Bug: oss-fuzz:8236 Change-Id: Iae911d995cbfed77c5d332f615da1a8d9b487c21 Reviewed-on: https://skia-review.googlesource.com/127703 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@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>
* Just pass color glyph masks to filters.Gravatar Ben Wagner2018-04-27
| | | | | | | | | | | | | | | Allow the filters to try to apply themselves to the color mask. Most mask filters will just return false, but allow them the opprotunity. This removes the behavior of trying to create a mask from the color mask. This updates the blur mask filter to handle kARGB32_Format directly by using just the alpha (which mirrors current behavior). Change-Id: I15eb736060ecf9b24aca874758c167b74d9ebc22 Reviewed-on: https://skia-review.googlesource.com/124185 Reviewed-by: Herb Derby <herb@google.com> Commit-Queue: Ben Wagner <bungeman@google.com>
* Fix SkDashImpl::CreateProc OOM on garbage inputGravatar Adrienne Walker2018-04-25
| | | | | | | | | | | | Verify that there's enough data to read from before allocating gigantic blocks of memory. This was caught by a fuzzer. Bug: chromium:835418 Change-Id: I43fb1d11ec13726aacb62fe6aeb9f137424fb783 Reviewed-on: https://skia-review.googlesource.com/123538 Commit-Queue: Mike Klein <mtklein@google.com> Auto-Submit: Adrienne Walker <enne@chromium.org> Reviewed-by: Mike Klein <mtklein@google.com>
* prepare to remove obsolete macrosGravatar Cary Clark2018-04-24
| | | | | | | | | | | | | | SkColorSetARGBMacro and SkColorSetARGBInline are macros which will be deleted. Replace them with a standard equivalent. R=scroggo@google.com Bug: skia:6898 Change-Id: I16e010776e991c19a375d0686ecd1b1cc4c59a9b Reviewed-on: https://skia-review.googlesource.com/123501 Auto-Submit: Cary Clark <caryclark@skia.org> Commit-Queue: Leon Scroggins <scroggo@google.com> Reviewed-by: Leon Scroggins <scroggo@google.com>
* rm SkRRectsGaussianEdgeMaskFilterGravatar Robert Phillips2018-04-19
| | | | | | | | | Neat but unused. Change-Id: I1b2d160df274b05cfb5582a5385085cc2db89f7d Reviewed-on: https://skia-review.googlesource.com/121960 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* Fix alpha threshold image filter GPU implementationGravatar Robert Phillips2018-04-11
| | | | | | | | BUG=skia:7760 Change-Id: I674d705ce637c405361ecf45ea8604d1606f7af7 Reviewed-on: https://skia-review.googlesource.com/120203 Reviewed-by: Greg Daniel <egdaniel@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* detect if makeOffset failedGravatar Mike Reed2018-04-06
| | | | | | | | | | | If we don't detect this, this imagefilter might not write to all of the pixels it claims it will, resulting in uninitialized memory. Bug: oss-fuzz:7209 Change-Id: I6c53757046b4d6051da1b317310c89b8ec4752ca Reviewed-on: https://skia-review.googlesource.com/119145 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Make generated effects from sksl fp files not need SK_SUPPORT_GPUGravatar Greg Daniel2018-04-06
| | | | | | | | Bug: skia: Change-Id: I42a5c7fe7dc35a23290c8daa754c9fcce07f76fb Reviewed-on: https://skia-review.googlesource.com/119010 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* Remove SK_SUPPORT_LEGACY_BLURMASKFILTERGravatar Brian Osman2018-04-06
| | | | | | | Change-Id: I1d99d9bb83d8a612d1c1fd298c1f7ed706a2277b Reviewed-on: https://skia-review.googlesource.com/118990 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Brian Osman <brianosman@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>
* 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>
* Remove copy of TableColorFilter data when GPU renderingGravatar Robert Phillips2018-03-26
| | | | | | | Change-Id: I8cb6059a175e0ef6bd766e3ad2254c893c11bed3 Reviewed-on: https://skia-review.googlesource.com/116522 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
* limit discrete path effect iterationsGravatar Cary Clark2018-03-21
| | | | | | | | | R=fmalita@google.com, reed@google.com Bug: skia:7737 Change-Id: I339548f7a39618d7559182487e8969d591953b89 Reviewed-on: https://skia-review.googlesource.com/115659 Reviewed-by: Florin Malita <fmalita@chromium.org> Commit-Queue: Cary Clark <caryclark@skia.org>
* 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>
* hide SkBlurMaskFilter and SkBlurQualityGravatar Mike Reed2018-03-14
| | | | | | | | | | SK_SUPPORT_LEGACY_BLURMASKFILTER Bug: skia: Change-Id: Ic3e27e08e6e3cd2ffc1cd13b044e197bebc96236 Reviewed-on: https://skia-review.googlesource.com/113940 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* move blur impl into coreGravatar Mike Reed2018-03-12
| | | | | | | | | | | | | | | | Ever since we added drawShadow to the public api, blurs have necessarily part of the core. This CL just formalizes that. This should also allow us to have builds that exclude all of /effects (for code size) and still be valid. Will follow-up with a change to deprecate SkBlurMaskFilter and SkBlurQuality (both no longer needed). Bug: skia: Change-Id: Ifbbd8b47a30a0386d215726b67bcf1e8b84fb8f5 Reviewed-on: https://skia-review.googlesource.com/113713 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Extend SkTrimPathEffect semanticsGravatar Florin Malita2018-03-12
| | | | | | | | | | Add support for multiple contours, and an explicit "inverted" mode. Bug: skia: Change-Id: Iafadbbe9d4692f2467a4ef8585f7fcd9cee9566a Reviewed-on: https://skia-review.googlesource.com/113270 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
* remove unused ConvertRadiusToSigma from SkBlurMaskFilterGravatar Mike Reed2018-03-12
| | | | | | | | Bug: skia: Change-Id: I1726f22fc40ad61b1b0485bcda6d383614da1fdb Reviewed-on: https://skia-review.googlesource.com/113463 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Mike Reed <reed@google.com>
* 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>
* Use kLow_SkFilterQuality when generating shader masksGravatar Florin Malita2018-03-08
| | | | | | | | | This prevents edge aliasing for kDecal tiling. Change-Id: I3a66e49ec1900bbe19c6700ec2f766122af4a3ce Reviewed-on: https://skia-review.googlesource.com/113124 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
* Additional DDL playback cleanupGravatar Robert Phillips2018-03-08
| | | | | | | | | | This operates in tandem with https://skia-review.googlesource.com/c/skia/+/112702 ( Remove GrRestrictedAtlasManager) to get DDL playback working. Change-Id: I6c2178fde760677bf79f2cf0a2dee8b5990aa5bc Reviewed-on: https://skia-review.googlesource.com/113121 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* add TrimPathEffectGravatar Mike Reed2018-03-07
| | | | | | | | Bug: skia: Change-Id: I453fb81ded4435b33567e9c8a6f3abe9535d687f Reviewed-on: https://skia-review.googlesource.com/112820 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Florin Malita <fmalita@chromium.org>
* Initial texture data is never flipped when uploaded.Gravatar Brian Salomon2018-03-07
| | | | | | | | | The first bytes of the data always refer to the pixel accessed by texture coord (0, 0). Change-Id: I708702d90f35b3bc896a48c3c3fd6a0be73f505a Reviewed-on: https://skia-review.googlesource.com/112261 Commit-Queue: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
* make compute helper for blurs privateGravatar Mike Reed2018-03-06
| | | | | | | | | | | Precursor for moving blurmaskfilter into core, since it is referenced by core code for drawShadow. Bug: skia: Change-Id: I900c6e10523115c75f45d2c410eb6a5ca56a6e4d Reviewed-on: https://skia-review.googlesource.com/112301 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Move internal calls from GrContext to GrContextPrivGravatar Robert Phillips2018-03-06
| | | | | | | | | | A mechanical bulk move just to get these out of the public API. TBR=bsalomon@google.com Change-Id: I813efbd54a09dd448275697c0e50947753a5cfd3 Reviewed-on: https://skia-review.googlesource.com/112262 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* Remove GrSurfaceOrigin from GrSurfaceDesc.Gravatar Brian Salomon2018-03-05
| | | | | | | | | | | | This field has no interpretation at the GrTexture/GrGpu as the orientation is handled at the GrSurfaceProxy level. This change requires GrGpu to accept a GrSurfaceOrigin when creating a texture with initial data. The origin refers to the texel data to be uploaded. Longer term the plan is to remove this and require the data to be kTopLeft. Additionally, kBottomLeft will only be allowed for wrapped texture/RTs as this evolves. Change-Id: I7d25b0199aafd9bf3b74c39b2cae451acadcd772 Reviewed-on: https://skia-review.googlesource.com/111806 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
* limit crash small steps in 1dpatheffectGravatar Mike Reed2018-02-27
| | | | | | | | Bug: oss-fuzz:6590 Change-Id: Ib7b6f4d25712e462ca45284cf6fc8fd73aa92880 Reviewed-on: https://skia-review.googlesource.com/110640 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* use SkIRect makeOffset to avoid overflowsGravatar Mike Reed2018-02-26
| | | | | | | | Bug: oss-fuzz:7657 Change-Id: I7917306cf0a158d2e1f36611e85ef26028da9954 Reviewed-on: https://skia-review.googlesource.com/110280 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* make 1dpatheffect more robust on deserialGravatar Mike Reed2018-02-24
| | | | | | | | Bug: skia: Change-Id: Ic7a38edaf1099a70b72fbea64c5e36f522bc363b Reviewed-on: https://skia-review.googlesource.com/110020 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* move some RRect methods into privGravatar Mike Reed2018-02-22
| | | | | | | | | | also, return radii by value instead of reference, in possible prep for changing underlying representation Bug: skia:7649 Change-Id: Iff42a49c53cc48171fc63462be366cc3500b2273 Reviewed-on: https://skia-review.googlesource.com/109385 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com>
* detect bad radius in cornerpatheffectGravatar Mike Reed2018-02-22
| | | | | | | | Bug: skia: Change-Id: I88b0be68e3099bcf6df608ded0e875c7a60bb5d6 Reviewed-on: https://skia-review.googlesource.com/109381 Reviewed-by: Mike Reed <reed@google.com> Commit-Queue: Mike Reed <reed@google.com>
* Add checks for failed SkImageInfo2GrPixelConfig callsGravatar Greg Daniel2018-02-21
| | | | | | | | Bug: skia:7645 Change-Id: I32b9326fb43490ef6a7a99527243b68d89184ae1 Reviewed-on: https://skia-review.googlesource.com/109083 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Salomon <bsalomon@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>
* abort blur if the sigma is too smallGravatar Mike Reed2018-02-15
| | | | | | | | Bug: oss-fuzz:6375 Change-Id: I8f21ea05b44f2ed6fdcdfe2573ac9415f238d833 Reviewed-on: https://skia-review.googlesource.com/107784 Commit-Queue: Mike Reed <reed@google.com> Reviewed-by: Herb Derby <herb@google.com>
* DDL-ify GrRectBlurEffectGravatar Robert Phillips2018-02-14
| | | | | | | | | This allows the upload of the blur profile to be delayed until the draw is actually executed. Change-Id: I10a7e8fb0edc90ef509c418552740a867f1f3df2 Reviewed-on: https://skia-review.googlesource.com/107354 Commit-Queue: Robert Phillips <robertphillips@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
* saturate IPoint math, handle NaN in isEmptyGravatar Mike Reed2018-02-13
| | | | | | | | | Bug: skia:7507 Change-Id: Ibdb40584effdea70e6499eab1bb64bb4b2260d06 Reviewed-on: https://skia-review.googlesource.com/106972 Commit-Queue: Mike Reed <reed@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Mike Klein <mtklein@chromium.org>
* doh -- reverse check for finiteGravatar Mike Reed2018-02-13
| | | | | | | | Bug: skia: Change-Id: I7ea6e9bdf5c979dbbc61587edad5f799e9626639 Reviewed-on: https://skia-review.googlesource.com/106967 Reviewed-by: Stan Iliev <stani@google.com> Commit-Queue: Mike Reed <reed@google.com>