Commit Graph

31 Commits

Author SHA1 Message Date
ajuma
77b6ba3b6e Implement an SkPaint-based image filter
This implements SkPaintImageFilter, and is intended to replace
SkRectShaderImageFilter. By allowing a paint and not just a
shader as input, this allows consumers to control dithering.

BUG=skia:4780
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1556553002

Review URL: https://codereview.chromium.org/1556553002
2016-01-08 14:58:35 -08:00
fmalita
5598b63cd2 Convert unit tests, GMs from SkBitmapSource to SkImagesource
This removes SkBitmapSource clients within Skia.

http://crrev.com/1334173004 does the same for Blink, so we should be
able to remove SkBitmapSource in a follow-up.

R=reed@google.com,robertphillips@google.com,mtklein@google.com

Review URL: https://codereview.chromium.org/1343123002
2015-09-15 11:26:14 -07:00
robertphillips
943a462fef Minor code cleanup (left over from prior CL)
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
2015-09-03 13:32:33 -07:00
halcanary
96fcdcc219 Style Change: NULL->nullptr
DOCS_PREVIEW= https://skia.org/?cl=1316233002

Review URL: https://codereview.chromium.org/1316233002
2015-08-27 07:41:16 -07:00
senorblanco
7b7ecfc046 Fix clipped lighting image filters.
The CPU path for lighting image filters was not adjusting the filter
matrix to accommodate srcOffset, resulting in incorrectly-positioned
lights.  (The GPU path was doing this correctly.)

This change adds a new test case to the imagefiltersclipped GM,
so it will need new baselines.

BUG=skia:

Review URL: https://codereview.chromium.org/1310053004
2015-08-26 14:26:40 -07:00
jvanverth
02781977e0 Run noise shader separately in imagefiltersclipped
BUG=skia:4079

Review URL: https://codereview.chromium.org/1245983002
2015-07-21 08:38:06 -07:00
reed
80ea19ca4b Revert of Revert of stop calling SkScalarDiv (patchset #1 id:1 of https://codereview.chromium.org/1138263002/)
Reason for revert:
android patched, blink has rolled

Original issue's description:
> Revert of stop calling SkScalarDiv (patchset #4 id:60001 of https://codereview.chromium.org/1135053002/)
>
> Reason for revert:
> need to wait for Blink roll (and patch android)
>
> Original issue's description:
> > stop calling SkScalarDiv
> >
> > BUG=skia:
> > TBR=
> >
> > Committed: https://skia.googlesource.com/skia/+/67d71c898249a7af3523b16c6a69895a63bfae0a
>
> TBR=
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/2629697933b5cc975e45d2a45c48f803fc6cbcec

TBR=
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1135693003
2015-05-12 10:37:34 -07:00
reed
2629697933 Revert of stop calling SkScalarDiv (patchset #4 id:60001 of https://codereview.chromium.org/1135053002/)
Reason for revert:
need to wait for Blink roll (and patch android)

Original issue's description:
> stop calling SkScalarDiv
>
> BUG=skia:
> TBR=
>
> Committed: https://skia.googlesource.com/skia/+/67d71c898249a7af3523b16c6a69895a63bfae0a

TBR=
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1138263002
2015-05-12 10:28:06 -07:00
reed
67d71c8982 stop calling SkScalarDiv
BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1135053002
2015-05-12 09:47:22 -07:00
senorblanco
16b254a200 Change some more GMs to clear to opaque black, not transparent black.
N.B.: this will change results on the bots for all the tests modified.

BUG=skia:3319

Review URL: https://codereview.chromium.org/1077763002
2015-04-09 11:13:24 -07:00
mtklein
36352bf5e3 C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla}
NOPRESUBMIT=true

BUG=skia:
DOCS_PREVIEW= https://skia.org/?cl=1037793002

Review URL: https://codereview.chromium.org/1037793002
2015-03-25 18:17:32 -07:00
senorblanco
8c874eee94 Move SkMatrixImageFilter into core, and add a factory fn for it.
BUG=skia:

Review URL: https://codereview.chromium.org/1011273003
2015-03-20 06:38:17 -07:00
reed
93a1215fe0 SkPaint::FilterLevel -> SkFilterQuality
clone (+rebase) of https://codereview.chromium.org/1009183002/

BUG=skia:
TBR=scroggo@google.com

Review URL: https://codereview.chromium.org/1014533004
2015-03-16 10:08:34 -07:00
halcanary
b0cce2c1d3 s/sk_tools::DrawCheckerboard/sk_tool_utils::draw_checkerboard/
BUG=skia:

Review URL: https://codereview.chromium.org/873333004
2015-01-26 12:49:00 -08:00
halcanary
878fa0204b Factor out checkerboard function in gm and sampleapp into tools.
Review URL: https://codereview.chromium.org/834303005
2015-01-26 11:24:32 -08:00
mtklein
1c4029296f remove unused GM flags
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
2015-01-23 11:07:08 -08:00
mtklein
72c9faab45 Fix up all the easy virtual ... SK_OVERRIDE cases.
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
2015-01-09 10:06:40 -08:00
tfarina
aa458fb20a Cleanup: More override fixes - another round.
BUG=skia:3075
TEST=ninja -C out/Debug
TBR=reed@google.com

Review URL: https://codereview.chromium.org/831113002
2015-01-05 17:18:51 -08:00
sugoi
234f036b3e Adding an option to render only the shadow in SkDropShadowImageFilter
This is basically how blink uses the filter. Currently, I can't use it for "ShadowOnly" mode with the filter at all, but instead of copying the code and risking to have the codepaths diverge, I'm simply going to add the option here.

BUG=skia:

Review URL: https://codereview.chromium.org/646213004
2014-10-23 13:59:52 -07:00
senorblanco
bc9845bb60 Remove the single-sigma version of SkDropShadowImageFilter::Create().
It's no longer used in Chrome.

BUG=skia:
R=bsalomon@google.com

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/407203002
2014-07-22 12:49:25 -07:00
tfarina
f539318f0d Cleanup: Get rid of make_isize() function from gm.h.
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
2014-06-09 23:59:03 -07:00
commit-bot@chromium.org
a90c680386 Turn on quilt mode in DM.
- 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
2014-04-30 13:20:45 +00:00
senorblanco@chromium.org
fd0ec2c76a Implement a generic matrix transform image filter.
This will be used in Blink to accommodate matrices that contain
rotation or shearing. This is a generalization of SkResizeImageFilter,
so I've replaced all uses of SkResizeImageFilter in Skia. (It might be
easier to review by diffing it with SkResizeImageFilter, too.)

R=reed@google.com

Review URL: https://codereview.chromium.org/211103006

git-svn-id: http://skia.googlecode.com/svn/trunk@13941 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-25 17:35:10 +00:00
commit-bot@chromium.org
cac5fd597f Factory methods for heap-allocated SkImageFilter objects.
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
2014-03-10 10:51:58 +00:00
senorblanco@chromium.org
47d98c8e85 Fix CTM scaling and clipping of SkRectShaderImageFilter.
Pass the CTM as part of the local matrix passed by
SkRectShaderImageFilter. Teach SkPerlinNoiseShader to respect the local
matrix. Embiggen imagefiltersscaled GM size to accommodate the new test
cases.

Note: will require rebaselines of imagefiltersscaled and imagefiltersclipped

R=sugoi@chromium.org
BUG=skia:

Review URL: https://codereview.chromium.org/184973007

git-svn-id: http://skia.googlecode.com/svn/trunk@13637 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-03-03 14:58:09 +00:00
senorblanco@chromium.org
897b73f62c Fix CTM application in SkResizeImagefilter; implement bounds traversals.
SkResizeImageFilter resizes all the pixels from its input (subject to
the input's crop rect), but the offset to be applied was incorrect.
It should take the CTM into account, so that the origin of the resize is
the world space origin, unaffected by whatever clipping is applied.

New GM imageresizetiled exercises the behaviour under
impl-side-painting-like conditions, and existing GMs now have resize
cases added.

R=reed@google.com, robertphillips@google.com

Review URL: https://codereview.chromium.org/168283006

git-svn-id: http://skia.googlecode.com/svn/trunk@13506 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-02-19 22:10:12 +00:00
commit-bot@chromium.org
c3bd8af6d5 add peekPixels to SkCanvas and SkSurface
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
2014-02-13 17:14:46 +00:00
commit-bot@chromium.org
bda591c739 Revert of add peekPixels to SkCanvas and SkSurface (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
2014-02-13 15:29:03 +00:00
mike@reedtribe.org
b2d93a9122 add peekPixels to SkCanvas and SkSurface
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
2014-02-13 15:11:11 +00:00
senorblanco@chromium.org
67117808ee Fix memory leak in imagefiltersclipped GM (found by valgrind).
TBR=robertphillips

Review URL: https://codereview.chromium.org/146193004

git-svn-id: http://skia.googlecode.com/svn/trunk@13334 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-02-06 00:36:01 +00:00
senorblanco@chromium.org
c4b12f19a4 Implement correct clipping for image filters.
Image filters in Skia currently clip the size of the the offscreen
bitmap used for filtering to the device clip bounds. This means that
any pixel-moving filter (e.g., blur) has edge artifacts at the clip
boundaries. This is problematic for tiling, where a single SkPicture
is played back with a clip set to the tile boundaries.

By implementing the onFilterBounds() traversal, and using it in
saveLayer() when a filter is present, we can clip the layer to the
expanded clip rect. Note that this requires that the traversal be
performed in reverse as compared to computeFastBounds().  (It's also
done in device space, unlike computeFastBounds()).

New test imagefiltersclipped tests pixel-moving filters when clipped
by various clip rects.
New test imageblurtiled tests tiled (compositor-style) rendering of
blurred text. There should be no artifacts at the tile boundaries.

BUG=337831
R=reed@google.com

Review URL: https://codereview.chromium.org/23011012

git-svn-id: http://skia.googlecode.com/svn/trunk@13323 2bbb7eff-a529-9590-31e7-b0007b416f81
2014-02-05 17:51:22 +00:00