aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/matrixconvolution.cpp
Commit message (Collapse)AuthorAge
* Remove matrixconvolution GM hacks for linear blendingGravatar Brian Osman2018-07-10
| | | | | | | | | | | GMs now match betwen gl and glsrgb Change-Id: Ibc6acf29d93d8bfab81a14be5d794d6e24844324 Reviewed-on: https://skia-review.googlesource.com/140346 Commit-Queue: Brian Osman <brianosman@google.com> Commit-Queue: Mike Klein <mtklein@google.com> Auto-Submit: Brian Osman <brianosman@google.com> Reviewed-by: Mike Klein <mtklein@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>
* add drawString helper to canvasGravatar Cary Clark2017-04-28
| | | | | | | | | | | | | | | | | | Many tests and examples use drawText with a guess of how long the text is in bytes, or a call to strlen(). Add a helper to SkCanvas to simplify these examples. Add another helper for SkString. R=reed@google.com Change-Id: I0204a31e938f065606f08ee7cd9a6b36db791ee2 Reviewed-on: https://skia-review.googlesource.com/13642 Commit-Queue: Cary Clark <caryclark@google.com> Reviewed-by: Cary Clark <caryclark@google.com> Reviewed-by: Mike Reed <reed@google.com> Reviewed-by: Cary Clark <caryclark@skia.org>
* GM: some header cleanupGravatar Mike Klein2017-03-22
| | | | | | | | | | | | | | gm.h includes sk_tool_utils.h but does not use it. The bulk of this CL makes each gm that uses sk_tool_utils include it. sk_tool_utils.h also provided SkRandom and SkTDArray, so a couple GMs add those headers too. Change-Id: Ieb2a7c542f0ca89c3223f744fc11b0ff37af36c1 Reviewed-on: https://skia-review.googlesource.com/10014 Commit-Queue: Mike Klein <mtklein@chromium.org> Reviewed-by: Herb Derby <herb@google.com>
* Modify matrix convolution GM for sRGB testingGravatar Brian Osman2016-12-27
| | | | | | | | | | | | | | | Tag bitmap as sRGB, and adjust gain/bias in color-managed configs to produce results that are less blown out. Also added a colorized version of the GM, to validate that gamut conversion is working. BUG=skia: Change-Id: I333988dcdaa1272121e8aa731b4188c942fe19d8 Reviewed-on: https://skia-review.googlesource.com/6466 Reviewed-by: Brian Osman <brianosman@google.com> Commit-Queue: Brian Osman <brianosman@google.com>
* Update MatrixConvolutionImageFilter to sk_spGravatar robertphillips2016-04-08
| | | | | | | | TBR=reed@google.com GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1869833002 Review URL: https://codereview.chromium.org/1869833002
* Reland of "more shader-->sp conversions (patchset #5 id:80001 of ↵Gravatar reed2016-03-13
| | | | | | | | | | | https://codereview.chromium.org/1789633002/ )" This reverts commit 9283d20afc27571f7a871d1bd1100dd5df584941. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1793303002 Review URL: https://codereview.chromium.org/1793303002
* Revert of more shader-->sp conversions (patchset #5 id:80001 of ↵Gravatar reed2016-03-13
| | | | | | | | | | | | | | | | | | | | | | | | https://codereview.chromium.org/1789633002/ ) Reason for revert: seems to have changed pictureshadertile Original issue's description: > more shader-->sp conversions > > BUG=skia: > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1789633002 > > Committed: https://skia.googlesource.com/skia/+/ce563cdd48ec7ce4e0420dd88760df9be9dba50c 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/1790353002
* more shader-->sp conversionsGravatar reed2016-03-13
| | | | | | | BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1789633002 Review URL: https://codereview.chromium.org/1789633002
* Matrix convolution bounds fix; affectsTransparentBlack fixes.Gravatar senorblanco2015-12-07
| | | | | | | | | | | | | | | | | | | | | Because the convolution kernel is (currently) applied in device space, there's no way to know which object-space pixels will be touched. So return false from canComputeFastBounds(). The results from the matrixconvolution GM were actually wrong, since they were showing edge differences on the clip boundaries, where they should really only show on crop boundaries. I added a crop to the GM to keep the results the same (which are useful to test the different convolution tile modes). While I was at it, SkImageFilter::affectsTransparentBlack() was inapplicable on most things except color filters, and its use on leaf nodes was confusing. So I removed it, and made SkImageFilter::canComputeFastBounds() virtual instead. BUG=skia:4630 Review URL: https://codereview.chromium.org/1500923004
* Revert of Matrix convolution bounds fix; affectsTransparentBlack fixes. ↵Gravatar senorblanco2015-12-05
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (patchset #4 id:60001 of https://codereview.chromium.org/1500923004/ ) Reason for revert: Introduced memory leak; pixel changes in Chrome. Original issue's description: > Matrix convolution bounds fix; affectsTransparentBlack fixes. > > Because the convolution kernel is (currently) applied in device space, > there's no way to know which object-space pixels will be touched. So > return false from canComputeFastBounds(). > > The results from the matrixconvolution GM were actually wrong, since > they were showing edge differences on the clip boundaries, where they > should really only show on crop boundaries. I added a crop to the GM > to keep the results the same (which are useful to test the different > convolution tile modes). > > While I was at it, SkImageFilter::affectsTransparentBlack() was > inapplicable on most things except color filters, and its use on > leaf nodes was confusing. So I removed it, and made > SkImageFilter::canComputeFastBounds() virtual instead. > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/8705ec80518ef551994b82ca5ccaeb0241d6adec TBR=reed@google.com,reed@chromium.org NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1497083005
* Matrix convolution bounds fix; affectsTransparentBlack fixes.Gravatar senorblanco2015-12-04
| | | | | | | | | | | | | | | | | | | | | Because the convolution kernel is (currently) applied in device space, there's no way to know which object-space pixels will be touched. So return false from canComputeFastBounds(). The results from the matrixconvolution GM were actually wrong, since they were showing edge differences on the clip boundaries, where they should really only show on crop boundaries. I added a crop to the GM to keep the results the same (which are useful to test the different convolution tile modes). While I was at it, SkImageFilter::affectsTransparentBlack() was inapplicable on most things except color filters, and its use on leaf nodes was confusing. So I removed it, and made SkImageFilter::canComputeFastBounds() virtual instead. BUG=skia: Review URL: https://codereview.chromium.org/1500923004
* Minor code cleanup (left over from prior CL)Gravatar robertphillips2015-09-03
| | | | | | This was requested in https://codereview.chromium.org/1309543012/ (Add new GM to directly exercise perspective bitmap drawing) Review URL: https://codereview.chromium.org/1320673011
* Style Change: NULL->nullptrGravatar halcanary2015-08-27
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316233002 Review URL: https://codereview.chromium.org/1316233002
* rename portable_typeface_always to portable_typefaceGravatar caryclark2015-07-24
| | | | | | TBR=reed@google.com Review URL: https://codereview.chromium.org/1257773002
* make drawbitmaprect lighting lumafilter matrixconvolution srcmode gm portableGravatar caryclark2015-07-17
| | | | | | TBR=reed@google.com Review URL: https://codereview.chromium.org/1240843005
* Change some more GMs to clear to opaque black, not transparent black.Gravatar senorblanco2015-04-09
| | | | | | | | N.B.: this will change results on the bots for all the tests modified. BUG=skia:3319 Review URL: https://codereview.chromium.org/1077763002
* remove unused GM flagsGravatar mtklein2015-01-23
| | | | | | | | | | Depends on https://codereview.chromium.org/873753002/ Thumbs up to CLion for refactoring this for me. BUG=skia: Review URL: https://codereview.chromium.org/867963004
* Fix up all the easy virtual ... SK_OVERRIDE cases.Gravatar mtklein2015-01-09
| | | | | | | | | | | | This fixes every case where virtual and SK_OVERRIDE were on the same line, which should be the bulk of cases. We'll have to manually clean up the rest over time unless I level up in regexes. for f in (find . -type f); perl -p -i -e 's/virtual (.*)SK_OVERRIDE/\1SK_OVERRIDE/g' $f; end BUG=skia: Review URL: https://codereview.chromium.org/806653007
* Add standard fonts to all GMs.Gravatar Cary Clark2014-07-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow GM results to be compared across machines and platforms by standardizing the fonts used by all tests. This adds runtime flags to DM to use either the system font context (the default), the fonts in the resources directory ( --resourceFonts ) or a set of canonical paths generated from the fonts ( --portableFonts ). This CL should leave the current DM results unchanged by default. If the portable font data or resource font is missing when DM is run, it falls back to using the system font context. The create_test_font tool generates the paths and metrics read by DM with the --portableFonts flag set, and generates the font substitution tables read by DM with the --resourceFonts flag set. If DM is run in SkDebug mode with the --reportUsedChars flag set, it generates the corresponding data compiled into the create_test_font tool. All GM tests set their typeface information by calling either sk_tool_utils::set_portable_typeface or sk_tool_utils::portable_typeface . (The former takes the paint, the latter returns a SkTypeface.) These calls can be removed in the future when the Font Manager can be superceded. BUG=skia:2687 R=mtklein@google.com Review URL: https://codereview.chromium.org/407183003
* Cleanup: Get rid of make_isize() function from gm.h.Gravatar tfarina2014-06-09
| | | | | | | | | | | | | | | This helper function is not necessary. The same thing can be achieved by using SkISize::Make() provided by SkTSize API. BUG=skia:2645 TEST=make dm && out/Debug/dm R=robertphillips@google.com, reed@google.com Author: tfarina@chromium.org Review URL: https://codereview.chromium.org/326523002
* Turn on quilt mode in DM.Gravatar commit-bot@chromium.org2014-04-30
| | | | | | | | | | | | | | | | | | - Rename TileGrid -> Quilt to avoid the name overload. - Tag all failing GMs with kSkipTiled_Flag. You may be wondering, do any GMs pass? Yes, some do! And that trends towards all of them as we increase --quiltTile. Two GMs only fail in --quilt mode in 565. Otherwise all GMs which fail are skipped, and those which don't fail aren't. (The 8888 variants of those two GMs are skipped even though they pass.) BUG=skia:2477 R=reed@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/256373002 git-svn-id: http://skia.googlecode.com/svn/trunk@14457 2bbb7eff-a529-9590-31e7-b0007b416f81
* Clean up SkImageFilter.Gravatar commit-bot@chromium.org2014-03-12
| | | | | | | | | | | | | | | Rename more occurences of 'target' to 'kernelOffset'. This is a follow-up patch to https://codereview.chromium.org/182983003/ BUG=skia:2187 R=senorblanco@chromium.org Author: dominikg@chromium.org Review URL: https://codereview.chromium.org/197013003 git-svn-id: http://skia.googlecode.com/svn/trunk@13768 2bbb7eff-a529-9590-31e7-b0007b416f81
* Factory methods for heap-allocated SkImageFilter objects.Gravatar commit-bot@chromium.org2014-03-10
| | | | | | | | | | | | | | | | | | This is part of an effort to ensure that all SkPaint effects can only be allocated on the heap. This patch makes the constructors of SkImageFilter and its subclasses non-public and instead provides factory methods for creating these objects on the heap. We temporarily keep constructor of publicly visible classes public behind a flag. BUG=skia:2187 R=scroggo@google.com, mtklein@chromium.org, reed@google.com, senorblanco@google.com, senorblanco@chromium.org, bsalomon@google.com, sugoi@chromium.org, zork@chromium.org Author: dominikg@chromium.org Review URL: https://codereview.chromium.org/182983003 git-svn-id: http://skia.googlecode.com/svn/trunk@13718 2bbb7eff-a529-9590-31e7-b0007b416f81
* add peekPixels to SkCanvas and SkSurfaceGravatar commit-bot@chromium.org2014-02-13
| | | | | | | | | | | | | | fix reference to SkBaseDevice, which was only a problem in no-gpu build This reverts commit 4fa44a6bf73891b21917fb90d02beef9143bffa3. R=reed@google.com Author: reed@chromium.org Review URL: https://codereview.chromium.org/163603003 git-svn-id: http://skia.googlecode.com/svn/trunk@13432 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert of add peekPixels to SkCanvas and SkSurface ↵Gravatar commit-bot@chromium.org2014-02-13
| | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/161733002/) Reason for revert: compile issues with gm/xfermodes3 Original issue's description: > add peekPixels to SkCanvas and SkSurface > > clone of https://codereview.chromium.org/159723006/ > > Committed: https://code.google.com/p/skia/source/detail?r=13427 R=jvanverth@google.com NOTREECHECKS=true NOTRY=true Author: reed@chromium.org Review URL: https://codereview.chromium.org/163823002 git-svn-id: http://skia.googlecode.com/svn/trunk@13428 2bbb7eff-a529-9590-31e7-b0007b416f81
* add peekPixels to SkCanvas and SkSurfaceGravatar mike@reedtribe.org2014-02-13
| | | | | | | | clone of https://codereview.chromium.org/159723006/ Review URL: https://codereview.chromium.org/161733002 git-svn-id: http://skia.googlecode.com/svn/trunk@13427 2bbb7eff-a529-9590-31e7-b0007b416f81
* add legacy/helper allocN32Pixels, and convert gm to use itGravatar reed@google.com2014-01-25
| | | | | | | | | | | | This is an intermediate api, but might help us quickly get to a point where no one is creating bitmaps in a 2-step process (setConfig + alloc). BUG=skia: R=halcanary@google.com Review URL: https://codereview.chromium.org/140593005 git-svn-id: http://skia.googlecode.com/svn/trunk@13182 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove SkFloatToScalar macroGravatar commit-bot@chromium.org2013-11-25
| | | | | | | | | | | BUG= R=reed@google.com, djsollen@google.com Author: caryclark@google.com Review URL: https://codereview.chromium.org/85463005 git-svn-id: http://skia.googlecode.com/svn/trunk@12385 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix for cropped matrix convolution for BottomLeft render targets.Gravatar senorblanco@chromium.org2013-10-20
| | | | | | | | R=bsalomon@google.com Review URL: https://codereview.chromium.org/31083002 git-svn-id: http://skia.googlecode.com/svn/trunk@11872 2bbb7eff-a529-9590-31e7-b0007b416f81
* Implement crop rect support for SkMatrixConvolutionImageFilter.Gravatar senorblanco@chromium.org2013-10-18
| | | | | | | | R=bsalomon@google.com Review URL: https://codereview.chromium.org/27471002 git-svn-id: http://skia.googlecode.com/svn/trunk@11863 2bbb7eff-a529-9590-31e7-b0007b416f81
* Split SkDevice into SkBaseDevice and SkBitmapDeviceGravatar robertphillips@google.com2013-08-29
| | | | | | | | https://codereview.chromium.org/22978012/ git-svn-id: http://skia.googlecode.com/svn/trunk@10995 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert r10830 (Split SkDevice out of SkRasterDevice) until we can get ↵Gravatar robertphillips@google.com2013-08-20
| | | | | | Chromium ready. git-svn-id: http://skia.googlecode.com/svn/trunk@10835 2bbb7eff-a529-9590-31e7-b0007b416f81
* Split SkDevice out of SkBitmapDeviceGravatar robertphillips@google.com2013-08-20
| | | | | | | | https://codereview.chromium.org/22978012/ git-svn-id: http://skia.googlecode.com/svn/trunk@10830 2bbb7eff-a529-9590-31e7-b0007b416f81
* Changing imageFilter GM tests to use drawBitmap instead of drawSpriteGravatar junov@chromium.org2013-01-14
| | | | | | | The motivation is be able to test the filters with scaled SkPicture playback in isolation from the issues that surround usage of drawSprite Review URL: https://codereview.appspot.com/7060071 git-svn-id: http://skia.googlecode.com/svn/trunk@7152 2bbb7eff-a529-9590-31e7-b0007b416f81
* Implement GPU path for matrix convolution. Note that when not convolving alpha,Gravatar senorblanco@chromium.org2012-10-04
| | | | | | | | | | | | | | | | | | | | the premultiplying is done less efficiently than in the raster path: it's done on each texture access, rather than as a pre-processing pass. This was so I could do the filter as a single custom stage; will try the optimization separately. This implementation gives a ~30X speedup on the GPU results for the matrixconvolution bench (~10X due to the GPU, and ~3X due to texture uploads/readback removal). Note: this changes the matrixconvolution for the software path as well, so it will likely break the bots until that test is rebaselined. Review URL: https://codereview.appspot.com/6585069/ git-svn-id: http://skia.googlecode.com/svn/trunk@5809 2bbb7eff-a529-9590-31e7-b0007b416f81
* This patch adds support for optional processing of the alpha channel inGravatar senorblanco@chromium.org2012-09-25
| | | | | | | | | | | | | | the matrix convolution filter. Test cases are added to the GM and the bench. NOTE: This will require rebaselining the matrixconvolution GM, so it will likely turn the bots red until that is done. https://codereview.appspot.com/6547049/ git-svn-id: http://skia.googlecode.com/svn/trunk@5661 2bbb7eff-a529-9590-31e7-b0007b416f81
* Implements a matrix convolution filter (raster path only). The filtering loopGravatar senorblanco@chromium.org2012-09-18
is templated on the tiling mode for speed: interior pixels are unconditionally fetched; border pixels apply the appropriate tiling mode before fetching. It handles target, bias, divisor (as gain), and edge modes (named to be more skia-like). It does not handle the "preserveAlpha" semantics of feConvolveMatrix, nor "kernelUnitLength". git-svn-id: http://skia.googlecode.com/svn/trunk@5592 2bbb7eff-a529-9590-31e7-b0007b416f81