History log of /external/skia/tests/ImageFilterTest.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
c8e934007a48465e584cdeed9ef02077d3cd5451 21-Apr-2015 senorblanco <senorblanco@chromium.org> Yet more ASAN fixes.

More nullptr checks for factories I have added.
Other checks more Yoda-like I have made. (Skia style this is.)

BUG=skia:

Review URL: https://codereview.chromium.org/1086393004
/external/skia/tests/ImageFilterTest.cpp
36352bf5e38f45a70ee4f4fc132a38048d38206d 26-Mar-2015 mtklein <mtklein@chromium.org> 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
/external/skia/tests/ImageFilterTest.cpp
8c874eee943bdea0fab5b4d2707083c863e37c55 20-Mar-2015 senorblanco <senorblanco@chromium.org> Move SkMatrixImageFilter into core, and add a factory fn for it.

BUG=skia:

Review URL: https://codereview.chromium.org/1011273003
/external/skia/tests/ImageFilterTest.cpp
24e06d5244ae96e440410e1d76e039983b2efac9 18-Mar-2015 senorblanco <senorblanco@chromium.org> Remove uniqueID from all filter serialization.

(This is essentially a revert of https://codereview.chromium.org/503833002/.)

This was necessary back when SkPaint was flattened even for in-process use. Now that we only flatten SkPaint for cross-process use, there's no need to serialize UniqueIDs.

Note: SkDropShadowImageFilter is being constructed with a croprect and UniqueID (of 0) in Blink. I've made the uniqueID param default to 0 temporarily, until this rolls in and Blink can be changed. (Blink can't be changed first, since unlike the other filters, there's no constructor that takes a cropRect but not a uniqueID.)

BUG=skia:

Review URL: https://codereview.chromium.org/1019493002
/external/skia/tests/ImageFilterTest.cpp
93a1215fe0ab007ce941c721f1fd3e9dcb5d4754 16-Mar-2015 reed <reed@google.com> SkPaint::FilterLevel -> SkFilterQuality

clone (+rebase) of https://codereview.chromium.org/1009183002/

BUG=skia:
TBR=scroggo@google.com

Review URL: https://codereview.chromium.org/1014533004
/external/skia/tests/ImageFilterTest.cpp
cedc36f18b2254c5ee21f6348124886b6db4f4c2 08-Mar-2015 reed <reed@google.com> Use ComposColorFilter to collaps hierarchy (when possible).

Clarify asColorFilter ...
1. Rename to isColorFilterNode for DAG reduction
2. Add asAColorFilter for removing the imagefilter entirely (future use-case)

Need layouttest rebaseline suppression before this can land in chrome...
https://codereview.chromium.org/984023004/

BUG=skia:

Review URL: https://codereview.chromium.org/982933002
/external/skia/tests/ImageFilterTest.cpp
a9d9a392380952006303d83c35a63a32dffd0b36 06-Mar-2015 kkinnunen <kkinnunen@nvidia.com> Read pixels in BGRA non-premul mode in few tests

The tests assert on Sk_ColorGREEN, which is in BRGA non-premul. Read the
pixels in same color format.

Currently the tests pass on all platforms because GREEN is fully opaque
and the component stays in the same place both on BGRA and
RGBA. However, hypothetically somebody could copy-paste the assertion
for further tests but use, say, RED. This creates latent error that is
only visible on some platforms like mac.

Review URL: https://codereview.chromium.org/989463002
/external/skia/tests/ImageFilterTest.cpp
5c518a862264225f0a378e4728e037966ddf4cc2 05-Mar-2015 reed <reed@google.com> Revert of check for inputs before reporting asColorFilter (patchset #7 id:110001 of https://codereview.chromium.org/967833003/)

Reason for revert:
Need to suppress these for rebaselining, so reverting for now.

Regressions: Unexpected image-only failures (5)
css3/filters/effect-brightness-clamping-hw.html [ ImageOnlyFailure ]
css3/filters/effect-combined-hw.html [ ImageOnlyFailure ]
virtual/slimmingpaint/css3/filters/effect-brightness-clamping-hw.html [ ImageOnlyFailure ]
virtual/slimmingpaint/css3/filters/effect-combined-hw.html [ ImageOnlyFailure ]

Original issue's description:
> Use ComposeColorFilter in factory to collapse consecutive filters (when possible).
> Change asColorFilter to reflect its reliance on the new factory behavior.
>
> patch from issue 967143002 at patchset 80001 (http://crrev.com/967143002#ps80001)
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/dac843bf046c2cd79fd955cb177aee241d7a4b0c

TBR=senorblanco@chromium.org,robertphillips@google.com,bsalomon@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/978923005
/external/skia/tests/ImageFilterTest.cpp
dac843bf046c2cd79fd955cb177aee241d7a4b0c 05-Mar-2015 reed <reed@google.com> Use ComposeColorFilter in factory to collapse consecutive filters (when possible).
Change asColorFilter to reflect its reliance on the new factory behavior.

patch from issue 967143002 at patchset 80001 (http://crrev.com/967143002#ps80001)

BUG=skia:

Review URL: https://codereview.chromium.org/967833003
/external/skia/tests/ImageFilterTest.cpp
8e8c940ee377d001653c5f659043186ccfc70ff0 13-Feb-2015 ajuma <ajuma@chromium.org> Fix leak in ComposedImageFilterOffset test

This fixes a leak in the ComposedImageFilterOffset test that was
introduced in https://codereview.chromium.org/908273002/.

BUG=chromium:453924

Review URL: https://codereview.chromium.org/922063005
/external/skia/tests/ImageFilterTest.cpp
5788faaa2ac4203827c68006b669e277d441e2e4 13-Feb-2015 ajuma <ajuma@chromium.org> Fix SkComposeImageFilter's bounds computation and offset handling

This makes SkComposeImageFilter::computeFastBounds compose its
filters' bounds (rather than falling back to
SkImageFilter::computeFastBounds, which takes the union of the bounds).

This also makes SkComposeImageFilter::onFilterImage correctly handle
an offset produced when applying the inner filter; such offsets were
previously ignored.

BUG=chromium:453924

Review URL: https://codereview.chromium.org/908273002
/external/skia/tests/ImageFilterTest.cpp
afe3005be3392e43bc51eb7eb2017eefaed85ad1 16-Jan-2015 bsalomon <bsalomon@google.com> Require budget decision when creating a RenderTarget SkSurface.

Restructure SkGpuDevice creation:
*SkSurfaceProps are optional.
*Use SkSurfaceProps to communicate DF text rather than a flag.
*Tell SkGpuDevice::Create whether RT comes from cache or not.

Review URL: https://codereview.chromium.org/848903004
/external/skia/tests/ImageFilterTest.cpp
72c9faab45124e08c85f70ca38536914862d947c 09-Jan-2015 mtklein <mtklein@chromium.org> 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
/external/skia/tests/ImageFilterTest.cpp
c4bd39c903cc5da16f50d711063b01723b59281c 06-Jan-2015 robertphillips <robertphillips@google.com> Require explicit disabling of cross process pictureimagefilters

This is to allow capturing .skp files with their pictureimagefilters intact.

This is a companion to https://codereview.chromium.org/810933004/ (Provide a way of allowing cross process pictureimagefilters).

Review URL: https://codereview.chromium.org/834673006
/external/skia/tests/ImageFilterTest.cpp
f3f5bad7ded35265c0b5d042cc4174386b197a33 19-Dec-2014 robertphillips <robertphillips@google.com> Add toString methods to SkImageFilter-derived classes

This isn't definitive but at least makes something show up in the debugger.

Review URL: https://codereview.chromium.org/789163006
/external/skia/tests/ImageFilterTest.cpp
3f3b3d003527861dc0bd89733857576408906431 01-Dec-2014 mtklein <mtklein@chromium.org> Remove SK_SUPPORT_LEGACY_DEEPFLATTENING.

This was needed for pictures before v33, and we're now requiring v35+.

Will follow up with the same for skia/ext/pixel_ref_utils_unittest.cc

BUG=skia:

Committed: https://skia.googlesource.com/skia/+/52c293547b973f7fb5de3c83f5062b07d759ab88

Review URL: https://codereview.chromium.org/769953002
/external/skia/tests/ImageFilterTest.cpp
6e78293ee896020104ffc4c23b565073e9a49893 01-Dec-2014 mtklein <mtklein@google.com> Revert of Remove SK_SUPPORT_LEGACY_DEEPFLATTENING. (patchset #1 id:1 of https://codereview.chromium.org/769953002/)

Reason for revert:
Breaks canary builds. Will reland after the Chromium change lands.

Original issue's description:
> Remove SK_SUPPORT_LEGACY_DEEPFLATTENING.
>
> This was needed for pictures before v33, and we're now requiring v35+.
>
> Will follow up with the same for skia/ext/pixel_ref_utils_unittest.cc
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/52c293547b973f7fb5de3c83f5062b07d759ab88

TBR=reed@google.com,mtklein@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/768183002
/external/skia/tests/ImageFilterTest.cpp
52c293547b973f7fb5de3c83f5062b07d759ab88 01-Dec-2014 mtklein <mtklein@chromium.org> Remove SK_SUPPORT_LEGACY_DEEPFLATTENING.

This was needed for pictures before v33, and we're now requiring v35+.

Will follow up with the same for skia/ext/pixel_ref_utils_unittest.cc

BUG=skia:

Review URL: https://codereview.chromium.org/769953002
/external/skia/tests/ImageFilterTest.cpp
2d97bc139a7de5813468bd3dbfd0037351ae5606 20-Nov-2014 fmalita <fmalita@chromium.org> Disable LCD text explicitly in SkPictureImageFilter::onFilterImage()

As an intermediate fix for
https://code.google.com/p/skia/issues/detail?id=3142, we can use a
non-public SkCanvas constructor and force-disable LCD text.

BUG=skia:3142
R=reed@google.com,senorblanco@google.com

Review URL: https://codereview.chromium.org/725243004
/external/skia/tests/ImageFilterTest.cpp
8f3937d9fcb28018ec14db6697d41b645716d589 29-Oct-2014 senorblanco <senorblanco@chromium.org> Fix bounds computation of all 0-input filters.

The SkRectShaderImageFilter had the same bug as previously fixed for
SkBitmapSource and SkPictureImageFilter. Rather than copy-and-paste
the implementation, this change makes all filters with 0 inputs return
their source bounds, instead of returning false.

BUG=427251

Review URL: https://codereview.chromium.org/681643003
/external/skia/tests/ImageFilterTest.cpp
d0f1969100a0c00f41166f2fe616de56d44f4a59 28-Oct-2014 hcm <hcm@google.com> Revert of Fix bounds computation of all 0-input filters. (patchset #2 id:20001 of https://codereview.chromium.org/681643003/)

Reason for revert:
try again

Original issue's description:
> Fix bounds computation of all 0-input filters.
>
> The SkRectShaderImageFilter had the same bug as previously fixed for
> SkBitmapSource and SkPictureImageFilter. Rather than copy-and-paste
> the implementation, this change makes all filters with 0 inputs return
> their source bounds, instead of returning false.
>
> BUG=427251
>
> Committed: https://skia.googlesource.com/skia/+/ba036cc82b5a543a13cafd11a19ba0e3087fca38

TBR=bsalomon@google.com,senorblanco@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=427251

Review URL: https://codereview.chromium.org/678273002
/external/skia/tests/ImageFilterTest.cpp
ba036cc82b5a543a13cafd11a19ba0e3087fca38 27-Oct-2014 senorblanco <senorblanco@chromium.org> Fix bounds computation of all 0-input filters.

The SkRectShaderImageFilter had the same bug as previously fixed for
SkBitmapSource and SkPictureImageFilter. Rather than copy-and-paste
the implementation, this change makes all filters with 0 inputs return
their source bounds, instead of returning false.

BUG=427251

Review URL: https://codereview.chromium.org/681643003
/external/skia/tests/ImageFilterTest.cpp
234f036b3e731e06e616c5291157d3bb4fbfdee2 23-Oct-2014 sugoi <sugoi@chromium.org> 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
/external/skia/tests/ImageFilterTest.cpp
3a49520696b2eca69e57884657d23fd2402ccfd1 29-Sep-2014 senorblanco <senorblanco@chromium.org> Sanitize SkMatrixConvolutionImageFilter creation params.

Apply the same memory limit in the Create() function that we do when
deserializing.

R=reed@google.com

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/610723002
/external/skia/tests/ImageFilterTest.cpp
4a8126e7f81384526629b1e21bf89b632ea13cd9 22-Sep-2014 reed <reed@google.com> Introduce Props to surface (patchset #27 id:520001 of https://codereview.chromium.org/551463004/)"

This reverts commit 29c857d0f3a1cb837f73406eeb6ba9771879b5e7.

TBR=

Author: reed@google.com

Review URL: https://codereview.chromium.org/588143004
/external/skia/tests/ImageFilterTest.cpp
29c857d0f3a1cb837f73406eeb6ba9771879b5e7 21-Sep-2014 reed <reed@chromium.org> Revert of introduce Props to surface (patchset #27 id:520001 of https://codereview.chromium.org/551463004/)

Reason for revert:
Broke call site in WebKit

Original issue's description:
> introduce Props to surface (work in progress)
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/3716fd067a5621bb94a6cb08d72afec8bf3aceda

R=robertphillips@google.com, bsalomon@google.com, jvanverth@google.com, bungeman@google.com, fmalita@google.com, vangelis@chromium.org, reed@google.com
TBR=bsalomon@google.com, bungeman@google.com, fmalita@google.com, jvanverth@google.com, reed@google.com, robertphillips@google.com, vangelis@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/583773004
/external/skia/tests/ImageFilterTest.cpp
3716fd067a5621bb94a6cb08d72afec8bf3aceda 21-Sep-2014 reed <reed@google.com> introduce Props to surface (work in progress)

BUG=skia:
R=robertphillips@google.com, bsalomon@google.com, jvanverth@google.com, bungeman@google.com, fmalita@google.com, vangelis@chromium.org, reed@chromium.org

Author: reed@google.com

Review URL: https://codereview.chromium.org/551463004
/external/skia/tests/ImageFilterTest.cpp
32673b99a4fb5d798206eb7665b730ed0b4597a0 09-Sep-2014 senorblanco <senorblanco@chromium.org> Allow negative values in SkBlurImageFilter sigma.

There are two ways negative sigma values may occur: in
the original filter parameters, or after multiplication
by a negative scaling CTM. The former case is
invalid according to the spec, so we continue to check
for it at validation time. In the latter case, we should
interpret it as a horizontal flip in the kernel pixel
access, and simply take the absolute value (since the
filter kernel is symmetric).

Also refactor all this logic into a single place for the
CPU, GPU and onFilterBounds() paths.

BUG=https://code.google.com/p/chromium/issues/detail?id=409602
R=sugoi@google.com, reed@google.com, sugoi@chromium.org

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/555603002
/external/skia/tests/ImageFilterTest.cpp
49f085dddff10473b6ebf832a974288300224e60 05-Sep-2014 bsalomon <bsalomon@google.com> "NULL !=" = NULL

R=reed@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/544233002
/external/skia/tests/ImageFilterTest.cpp
a8d7f0b13cd4c6d773fcf055fe17db75d260fa05 29-Aug-2014 robertphillips <robertphillips@google.com> Try out scalar picture sizes

This paves the way for removing the 'fTile' parameter from SkPictureShader (although that should be a different CL). If we like this we could also move to providing an entire cull SkRect.

R=reed@google.com, mtklein@google.com, fmalita@google.com, fmalita@chromium.org

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/513983002
/external/skia/tests/ImageFilterTest.cpp
1150a6d151571fb6ee816dadec844ae7ab53948a 25-Aug-2014 senorblanco <senorblanco@chromium.org> Fix recursive computation of filter bounds for drop shadow,
morphology, blur.

[Reland with fixed tests.]

Because we're computing "backwards" from a clip rect of destination
pixels to be filled to the required source pixels, we should use tail
recursion rather than head recursion in onFilterBounds().

This actually only makes a difference for drop-shadow, where
the computation is non-commutative. Blur and morphology commute, but I
moved them to tail recursion anyway for clarity (so all onFilterBounds
use tail recursion).

BUG=skia:
R=bsalomon@google.com

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/481273005
/external/skia/tests/ImageFilterTest.cpp
38cb688bd0e17021bb140bbc15ac1a7b8f182939 25-Aug-2014 djsollen <djsollen@google.com> Revert of Fix recursive computation of filter bounds for drop shadow, (patchset #1 of https://codereview.chromium.org/481273005/)

Reason for revert:
This CL is currently breaking the Win7 and Win8 bots on some of the new tests (in DM).

Original issue's description:
> Fix recursive computation of filter bounds for drop shadow,
> morphology, blur.
>
> Because we're computing "backwards" from a clip rect of destination
> pixels to be filled to the required source pixels, we should use tail
> recursion rather than head recursion in onFilterBounds().
>
> This actually only makes a difference for drop-shadow, where
> the computation is non-commutative. Blur and morphology commute, but I
> moved them to tail recursion anyway for clarity (so all onFilterBounds
> use tail recursion).
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/28648fe4a69b0cee8df42b5966e4e645c3aabefb

R=bsalomon@google.com, senorblanco@chromium.org
TBR=bsalomon@google.com, senorblanco@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Author: djsollen@google.com

Review URL: https://codereview.chromium.org/504773003
/external/skia/tests/ImageFilterTest.cpp
28648fe4a69b0cee8df42b5966e4e645c3aabefb 25-Aug-2014 senorblanco <senorblanco@chromium.org> Fix recursive computation of filter bounds for drop shadow,
morphology, blur.

Because we're computing "backwards" from a clip rect of destination
pixels to be filled to the required source pixels, we should use tail
recursion rather than head recursion in onFilterBounds().

This actually only makes a difference for drop-shadow, where
the computation is non-commutative. Blur and morphology commute, but I
moved them to tail recursion anyway for clarity (so all onFilterBounds
use tail recursion).

BUG=skia:
R=bsalomon@google.com

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/481273005
/external/skia/tests/ImageFilterTest.cpp
d910f544439fffa6c2bcc5181b79b2811a4c130a 22-Aug-2014 mtklein <mtklein@chromium.org> Fix saveLayer() with a pixel-moving filter vs SkBBoxHierarchyRecord / SkRecordDraw

In SkBBoxHierarchyRecord:
Since the bounds we pass to saveLayer are in the pre-filtering
coordinate space, they aren't correct for determining the actual
device pixels touched by the saveLayer in this case.

The easiest fix for now is to pass the clip bounds, since the final
draw done in restore() will never draw outside the clip.

In SkRecordDraw:
We do adjust the bounds passed to saveLayer, so we just need to make
sure that when we're using a paint that may affect transparent black,
we ignore the calculated bounds of draw ops and use the clip intersected
with those adjusted bounds.

See originally crrev.com/497773002

BUG=skia:
R=reed@google.com, senorblanco@chromium.org, junov@chromium.org, mtklein@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/496963003
/external/skia/tests/ImageFilterTest.cpp
9fa60daad4d5f54c0dbe3dbcc7608a8f6d721187 21-Aug-2014 reed <reed@google.com> Simplify flattening to just write enough to call the factory/public-constructor for the class. We want to *not* rely on private constructors, and not rely on calling through the inheritance hierarchy for either flattening or unflattening(CreateProc).

Refactoring pattern:

1. guard the existing constructor(readbuffer) with the legacy build-flag
2. If you are a instancable subclass, implement CreateProc(readbuffer) to create a new instances from the buffer params (or return NULL).

If you're a shader subclass
1. You must read/write the local matrix if your class accepts that in its factory/constructor, else ignore it.

R=robertphillips@google.com, mtklein@google.com, senorblanco@google.com, senorblanco@chromium.org, sugoi@chromium.org

Author: reed@google.com

Review URL: https://codereview.chromium.org/395603002
/external/skia/tests/ImageFilterTest.cpp
97d2c0a216e8feae251a6af1e50579df3e026434 19-Aug-2014 halcanary <halcanary@google.com> Move SkReadBuffer.h and SkReader32.h out of include.

Committed: https://skia.googlesource.com/skia/+/2a51d7c74cec217195f861677de8998b382b39e4

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

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/481053002
/external/skia/tests/ImageFilterTest.cpp
f128f53a5bc36e2a991302cb40848df580ad515f 18-Aug-2014 halcanary <halcanary@google.com> Revert "Move SkReadBuffer.h and SkReader32.h out of include."

This reverts commit 2a51d7c74cec217195f861677de8998b382b39e4.

Breaking Blink

NOTRY=true
R=bungeman@google.com
TBR=bungeman@google.com

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/472303006
/external/skia/tests/ImageFilterTest.cpp
2a51d7c74cec217195f861677de8998b382b39e4 18-Aug-2014 halcanary <halcanary@google.com> Move SkReadBuffer.h and SkReader32.h out of include.

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

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/481053002
/external/skia/tests/ImageFilterTest.cpp
3d822c29d4272a6749e59801b202b1ed6d611be8 30-Jul-2014 senorblanco <senorblanco@chromium.org> Intersect SkPictureImageFilter bounds against clip bounds.

Intersect SkPictureImageFilter bounds against clip bounds
to avoid unnecessary processing. This is how the other
filters work (via applyCropRect()), but SkPictureImageFilter
maintains its own crop.

BUG=skia:
R=bsalomon@google.com

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/428263003
/external/skia/tests/ImageFilterTest.cpp
55b6d8be997a447ef9ce0f029697677a940bfc24 30-Jul-2014 senorblanco <senorblanco@chromium.org> Implement a persistent uniqueID-based cache for SkImageFilter.

Add a unique ID to SkImageFilter, and use it as part
of a persistent cache of image-filtered results. This is used for
caching frame-to-frame coherent filters.

We also keep track of which filter subtrees do not reference the
src input, and use a GenID of zero for the src input in that case.
That way, subtrees which are not dependent on the filter input can be
cached independently of it.

This gives approximately a 4X speedup on
letmespellitoutforyou.com/samples/svg/filter_terrain.svg on Z620
and Nexus10. The cache key consists of the uniqueID of the filter, the
clip bounds, the CTM and the genID of the input bitmap.

Since this does not yet handle the case where the input primitives
(and part of the resulting filter tree) are unchanged, we have
to keep around the external cache for that painting case.
When the work to cache unchanging input primitives is done, the
old cache can be removed, and the new UniqueIDCache will be renamed
to Cache.

R=bsalomon@google.com, mtklein@google.com

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/414483003
/external/skia/tests/ImageFilterTest.cpp
837f5321a409228a27fc710eb71c87866b820cfb 14-Jul-2014 senorblanco <senorblanco@chromium.org> Fix for saveLayer() with filters vs. the BBox Hierarchy.

When building acceleration structures for SkPicture, we must transform
the primitive's bounds not only by its own SkPaint, but by the paints of
any saveLayer()s currently active above it.

We do this by pushing the SkPaint onto a stack on
saveLayer(), and popping them on restore(). We also push
a NULL paint in save(), so that the pushes and pops are
balanced.

BUG=skia:2734
R=mtklein@google.com, reed@google.com, robertphillips@google.com

Committed: https://skia.googlesource.com/skia/+/6ca0b6a46cbe9bef3e2b9b9db813ec864efd62de

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/380373003
/external/skia/tests/ImageFilterTest.cpp
c07e2811dd8f15722ebdd1ff0a7f5449258569f1 14-Jul-2014 senorblanco <senorblanco@chromium.org> Revert "Fix for saveLayer() with filters vs. the BBox Hierarchy." and
"resizeimagefiler is ok with a BBH now".

This reverts commits 6ca0b6a46cbe9bef3e2b9b9db813ec864efd62de and 8fa73202eaffbd7591ee218ad452b9afde81f505.

Apparently causing problems in SKP playback.

R=mtklein@google.com, robertphillips@google.com
TBR=mtklein, robertphillips
BUG=skia:

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/381353005
/external/skia/tests/ImageFilterTest.cpp
6ca0b6a46cbe9bef3e2b9b9db813ec864efd62de 11-Jul-2014 senorblanco <senorblanco@chromium.org> Fix for saveLayer() with filters vs. the BBox Hierarchy.

When building acceleration structures for SkPicture, we must transform
the primitive's bounds not only by its own SkPaint, but by the paints of
any saveLayer()s currently active above it.

We do this by pushing the SkPaint onto a stack on
saveLayer(), and popping them on restore(). We also push
a NULL paint in save(), so that the pushes and pops are
balanced.

BUG=skia:2734
R=mtklein@google.com, reed@google.com

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/380373003
/external/skia/tests/ImageFilterTest.cpp
874a62acef5ec2ecccdbb99ec4d86402a3341e6a 09-Jul-2014 Mike Klein <mtklein@google.com> Revert "Remove ability for Release code to call getRefCnt() or getWeakRefCnt()."

This reverts commit 4ae94ffce5ecf1b71cb5e295b68bf4ec9e697443.

BUG=skia:

Review URL: https://codereview.chromium.org/382523002
/external/skia/tests/ImageFilterTest.cpp
9ea3d57fde28a5fe4487a111dc3dd49418235e5e 08-Jul-2014 senorblanco <senorblanco@chromium.org> Clean up SkImageFilter constructors.

Now that all creation of SkImageFilters goes through
factory Create() methods, there's no real reason for the
convenience constructors. Some SkImageFilter subclasses
which actually have zero DAG-able inputs were passing NULL
to the superclass constructor. This actually means 1 input,
with a NULL value, not zero inputs. This becomes more
relevant for the upcoming cache infrastructure, where this
indicates that the filter will use its src input, where in
fact some of these filters do not (they are image generators
only).

Limiting SkImageFilter to a single constructor resolves this
ambiguity.

Along the way, I removed all of the default parameters to
the constructors, since the Create methods always call them
with the full argument list.

BUG=skia:
R=reed@google.com

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/376953003
/external/skia/tests/ImageFilterTest.cpp
4ae94ffce5ecf1b71cb5e295b68bf4ec9e697443 08-Jul-2014 mtklein <mtklein@chromium.org> Remove ability for Release code to call getRefCnt() or getWeakRefCnt().

These getRefCnt() methods are not thread safe, so Skia code should not
be calling them. unique() is fine.

SkDEBUG code (SkASSERTs) can still call getRefCnt() / getWeakRefCnt().

This adds tools/RefCntIs.{h,cpp}, which lets tests make their assertions in
both debug and release modes.

BUG=skia:2726
R=senorblanco@chromium.org, mtklein@google.com, reed@google.com

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/378643003
/external/skia/tests/ImageFilterTest.cpp
3df05015efce95c306fb79c21efc77c79f1ac1ba 03-Jul-2014 senorblanco <senorblanco@chromium.org> Fix SkColorFilterImageFilter matrix optimization.

The order of matrices passed to multiplication was wrong (apparently,
this optimization was only being tested with matrices which commute).

See Chrome bug http://crbug.com/378362

R=sugoi@chromium.org

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/371523002
/external/skia/tests/ImageFilterTest.cpp
7bf106847304840526a3e722b5ff5ce7322a2826 25-Jun-2014 senorblanco <senorblanco@chromium.org> Remove SkBicubicImageFilter, and all related tests.

Now that we have SkResizeImageFilter, and the bicubic
resizing is part of skia proper, there's no need for a
specialized image filter.

BUG=skia:
R=bsalomon@google.com

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/357793002
/external/skia/tests/ImageFilterTest.cpp
9ea53f93e79ba312c4b3943923450a8b4aa57c82 24-Jun-2014 tfarina <tfarina@chromium.org> Preprend Test to test function name generated by DEF_TEST() macro.

That way when declaring a test with DEF_TEST() macro, you don't have to
uniquify the test name because it might colide with the class it is
being testing.

For example, if you are testing SkBase64 and do:

DEF_TEST(SkBase64, reporter) {
}

That will generate an error because the macro will declare a function
named SkBase64 which colides with the type SkBase64.

By adding Test to the function name we avoid this problem.

Fixed the entries found with the following command line:

$ git grep "Test, r" | grep DEF

BUG=None
TEST=make tests && out/Debug/tests
R=mtklein@google.com

Author: tfarina@chromium.org

Review URL: https://codereview.chromium.org/345753007
/external/skia/tests/ImageFilterTest.cpp
9b14f26d0f3a974f3dd626c8354e1db1cfcd322f 04-Jun-2014 robertphillips <robertphillips@google.com> Alter SkCanvas::drawPicture (devirtualize, take const SkPicture, take pointer)

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

Author: robertphillips@google.com

Review URL: https://codereview.chromium.org/313613004
/external/skia/tests/ImageFilterTest.cpp
97f5fc651956287e78e35934cf62b9e1b45b4f6c 30-May-2014 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Allow SkPictureImageFilter to be serialized when not run cross-process.

Picture serialization is not yet hardened, but it turns out we do need
serialization of SkPictureImageFilter for deferred SVG-on-SVG filters,
since the SkPaints (and thus the SkImageFilters) are serialized by
SkPictureRecord. However, deferred filters are always drawn in the
same process, so we can safely serialize them in this case. We do this
by turning the compile-time check for
SK_ALLOW_PICTUREIMAGEFILTER_SERIALIZATION to a runtime check for
isCrossProcess().

The image filter fuzzer sample was also modified to enable fuzzing
of basic picture image filters (the code had rotted a bit, being behind
an #ifdef that no one sets).

BUG=375162
R=sugoi@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@15008 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
910702b564048d77e36a68b0f8dda7cc48a8fcff 30-May-2014 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Implement SkPictureImageFilter bounds computation.

SkPictureImageFilter::onFilterBounds() was unimplemented, causing
incorrect results for SVG filters and impl-side painting (see Chrome
bug https://code.google.com/p/chromium/issues/detail?id=375162).

BUG=skia:
R=reed@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@15003 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
29ac34ee526578fb0a01cd2d0c23c23e6a823d82 28-May-2014 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix filter bounds computation for SkOffsetImageFilter.

SkOffsetImageFilter::onFilterBounds() was not recursing into its input
filter when computing bounds.

BUG=374556
R=junov@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@14928 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
ba31f1d341bac57ca76a75d67f64434b4b371dc6 07-May-2014 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Some small cleanups for image filter code.

Use the 2-param flavour of mapVector instead of the 3-param, where possible.
Add an SkMatrixImageFilter test case to the tiling unit test.

R=junov@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@14630 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
d4db657bf54ae5346cb142fed2f83ea88544a733 07-May-2014 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix for SkDisplacementMap::onFilterBounds().

Two problems: we were not applying the CTM to the scale parameter when
modifying clip bounds, and the recursion for onFilterBounds() must be done
in the reverse order.

BUG=370914
R=junov@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@14627 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
68250c8e7c2bf5d669397c849259c3bcad40237e 07-May-2014 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix for empty saveLayer() with a filter which affects transparent black.

If an saveLayer()/restore() is recorded, tilegrid/rtree will cull them
out and not draw anything. This is correct for most cases, but if the
paint in the saveLayer() is one that affects transparent black (e.g.,
it contains a color filter or image filter which affects transparent
black), this is incorrect: the filter should be applied.

Fixed by adding a no-op between the saveLayer() and restore(), and
adding a bbox node pointing at that node with the saveLayer()'s bounds.

This exposed a bug in SkPictureRecord.cpp's match(), where it would
assert if the NOOP was the last op seen. Fixed with an early-out before
calling peek_op_and_size().

BUG=skia:2254

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

git-svn-id: http://skia.googlecode.com/svn/trunk@14604 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
8c7372bbe8949f2864bd3d9df00d85c5669a74b1 02-May-2014 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix for SkMatrixConvolutionImageFilter with large borders.

Intersect the requested processing rect with the destination
bounds.

R=junov@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@14543 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
9195743aac79a4fa82059ab614b9795f215475f7 01-May-2014 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Add a fix for a spurious assert in SkMatrixConvolutionImageFilter.

When matrix convolution processes border pixels with zero width, it
asserts in getAddr32() with an invalid x coordinate. The assert is
harmless, since the returned pointer is never accessed (the next line
is a loop from left to right, which does nothing, since left == right).
However, the fix is simple: early out on an empty rect before entering
the outer loop.

R=sugoi@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@14497 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
0a5c233e3b911232c0d6f9a88ded99ecf88b8a97 29-Apr-2014 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Implement bounds traversals for tile and matrix convolution filters.

Add a new GM that exercises tiled drawing all pixel-moving filters
(and some non-pixel-moving ones) and compares it against non-tiled
drawing of the same filters. Fixing this test revealed that tile and
matrix convolution filters had no onFilterBounds() traversals
(test-driven development FTW). Tile requires (conservatively) the
bounds to include the whole source rect, since it may end up in the
result. Matrix convolution requires the bounds to be offset by the
kernel size and target.

R=reed@google.com
BUG=skia:

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

git-svn-id: http://skia.googlecode.com/svn/trunk@14432 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
770963f23f4fc313db0fa3bac18b1b8aafb55f17 18-Apr-2014 robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Staging for cleanup of SkPicture-related headers

https://codereview.chromium.org/243173002



git-svn-id: http://skia.googlecode.com/svn/trunk@14258 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
091a594dbc4116ec2e54724432472bf37dae794a 18-Apr-2014 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Reduce internal explicit SaveFlags usage.

Most of these are either redundant/defaults or (hopefully)
unnecessarily specific.

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

Author: fmalita@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@14253 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
5fb2ce38b3dcb8e60e9e112df23c9d42456d7069 18-Apr-2014 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Staged removal of SkPicture-derived classes

This CL removes the SkPicture-derived classes (with a flag to keeps clients working). In the process it also lightens the recording factory function so it is no longer ref counted).

The only interesting bits are in SkPicture* and Sk*Picture.*

R=reed@google.com

Author: robertphillips@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@14251 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
d393b17cf3427bd6f6255f8670067d9aa529e409 16-Apr-2014 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Retract SkPicture::kOptimizeForClippedPlayback_RecordingFlag from public API


This CL sets the stage for retracting the SkPicture::kOptimizeForClippedPlayback_RecordingFlag flag
from the public API (more work needs to be done in Blink & Chrome). In the new world the only way
to set this flag (and thus instantiate an SkPicture-derived
class) is by passing a factory to the SkPictureRecorder class. This is to get all clients always using
factories so that we can then change the factory call used (i.e., so the factory just creates a BBH) and
do away with the SkPicture-derived classes.

BUG=skia:2315
R=reed@google.com

Author: robertphillips@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@14221 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
84b18c7e3e042bf206e1ace3d1b6ea5bb929fe51 13-Apr-2014 robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> split SkPictureRecorder out of SkPicture

https://codereview.chromium.org/214953003/



git-svn-id: http://skia.googlecode.com/svn/trunk@14171 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
f7efa502d62af80bd15b03e1131603fb6577c3df 11-Apr-2014 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Implement intra-frame cacheing in image filters.

When image filters are processed within Skia, they simply do
a blind recursion. This has the side-effect of turning the
DAG into a tree. I.e., nodes visited more than once during
the traversal will be processed more than once.

This change implements a very simple cacheing scheme: a
cache is created before traversing the DAG, and handed
into the processing traversal. Before recursing into a child
in SkImageFilter::filterImage(), the cache is checked for a
hit, and early-out is performed. Otherwise, the node is
processed, and its result bitmap and location (offset) are
cached, but only if it contains two or more children and
thus will be visited again during the traversal.

Currently, the child count is approximated with the
refcount. This is good enough in most cases (and exactly
correct for the Chrome use case). We could add an exact
child count to the image filter, but this will require
violating the immutability of image filters slightly in
order to bump the child count as nodes are connected. I
leave it up to the reviewer to decide which is better.

R=reed@google.com

Author: senorblanco@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@14160 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
d5424a425bc21280afe2161f6ac1e5d9eb97e6b2 02-Apr-2014 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix matrix adjustment passed to filter processing.

When adjusting the CTM for filter use, we were subtracting off the
destination coordinates of the drawDevice() or drawSprite(). This is
not quite correct: we should subtract off the coordinates relative to
the device origin instead. This occurs when one filtered saveLayer() is
drawn inside another saveLayer(), both with non-zero origin.

This fixes layout test svg/batik/text/smallFonts.svg in Blink, and is
exercised by the provided unit test.

BUG=skia:
R=bsalomon@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@14029 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
ee845ae4940779280a853269d7d797dc9eb89201 01-Apr-2014 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix SkXfermodeImageFilter when an input is cropped out.

If one of inputs to SkXfermodeImageFilter draws nothing, either due to
it being cropped out upstream, or within the filter itself, the filter
should still draw the other input, since otherwise the result will be incorrect.

For the GPU path, since we can't detect this case in
canFilterImageGPU() without recursing, we'll just drop to
the generic path if either input is empty, since we can't use the effect in that case anyway.

While we're at it, let's drop to the generic path if the
xfermode can't be expressed as an effect, since the code
here was doing a 2-pass render in that case anyway, which
is equivalent to what the (xfermode == NULL) case was doing
anyway.

R=bsalomon@google.com, sugoi@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@14016 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
28ae55de3c4ec93516901100df1170048f949dfb 24-Mar-2014 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix Mac Debug clang build.

TBR=bsalomon@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13925 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
09843fd5c15e84e9b14ab511a04d9d639149fa75 24-Mar-2014 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix for crash on large image blur sigma values.

This was crashing on the GPU path, due to a failed texture allocation.
The belt-and-suspenders fix is to:

1) Limit the GPU path to only allocate up to maxTextureSize.
2) Limit both the raster and GPU paths to reasonable blur sizes (box blur
kernel size of 1000, resulting in a sigma limit of 532).

R=bsalomon@google.com
BUG=skia:

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13923 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
118252962f89a80db661a0544f1bd61cbaab6321 14-Mar-2014 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Implement support for expanding crop rects in image filters

NOTE: this patch set is based on https://codereview.chromium.org/189913021/,
and needs that patch to land first.

Until now, crop rects in Skia have only been able to reduce
the size of the destination bounds, but not expand them.
SVG semantics require the latter as well. The heart of
the change is in applyCropRect(), which now assigns each
edge, instead of doing an intersection with the crop rect.

In order to support this (and still work well with tiled
drawing) we need to clip the resulting crop rect to the
clipping region of the filters. This uses the Context struct
previously landed from https://codereview.chromium.org/189913021/.

Many of the pixel loops are not yet ready to handle a
destination rect larger than the source rect. So we provide
a convenience version of applyCropRect() which creates an
offscreen and pads it out with transparent black. Once the
pixel loops and shaders have been fixed to support larger
destination bounds, they should be switched back to the
non-drawing version of applyCropRect().

BUG=skia:
R=bsalomon@google.com, reed@google.com

Committed: https://code.google.com/p/skia/source/detail?r=13805

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13809 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
4cb543d6057b692e1099e9f115155f0bf323a0c8 14-Mar-2014 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Implement support for a Context parameter in image filters

Some upcoming work (support for expanding crop rects) requires
the clip bounds to be available during filter traversal. This change
replaces the SkMatrix parameter in the onFilterImage() traversals
with a Context parameter. It contains the CTM, as well as the clip
bounds.

BUG=skia:
R=reed@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13803 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
cac5fd597f6e2495f50aaa6bcbe3dadc56f0b977 10-Mar-2014 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> 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
/external/skia/tests/ImageFilterTest.cpp
727a352f7412753d2a3e4d30eab6500a1a4de135 21-Feb-2014 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Factory methods for heap-allocated SkColorFilter 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 SkColorFilter 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@google.com, reed@google.com

Author: dominikg@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13539 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
15a140599942f70e47380e3f700a825c7cece3b4 16-Feb-2014 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Change device factories to take SkImageInfo instead of SkBitmap::Config

patch from issue 167033002

BUG=skia:
R=reed@google.com

Author: reed@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13463 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
deee496cd30070e52556dcb538c2e5eb39b66b81 13-Feb-2014 mike@reedtribe.org <mike@reedtribe.org@2bbb7eff-a529-9590-31e7-b0007b416f81> replace setConfig+allocPixels with single call

BUG=skia:

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13426 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
0937335e6b051150e9a42fc685659bac570b0c51 06-Feb-2014 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Mid-air collision: fix constness for onFilterImage in new test.

TBR=fmalita
BUG=skia:

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13332 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
5251e2b91ac976f61e6252d931c1a0e746d2290a 05-Feb-2014 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix a problem with scaled filters in tiled SkPicture playback.

The matrix used during filter application should be up-to-date, so that
the filter parameters can be scaled by the CTM (e.g., for hiDPI).
However, tiled playback defers setting of the matrix until after the
restore() call which draws the filter, which is too late. Moving the
setMatrix() ahead of the restore() sequence fixes the problem.

TEST=ImageFilterMatrixTest
R=junov@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13331 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
f4e1a7614da0cc3738077a1df5d8895a4df6d2f6 04-Feb-2014 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> More bot whack-a-mole: fix Win build.

BUG=skia:
TBR=fmalita@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13295 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
ec7c35d01501484fed63a9d50832e4fbcfac108d 04-Feb-2014 fmalita@google.com <fmalita@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Speculative build fix after r13292.

TBR=senorblanco@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13294 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
58d1466c7773984b7ce4bd75ebf7c97cd42f7d12 03-Feb-2014 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix skia_gpu=0 build.

BUG=skia:
TBR=bsalomon@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13293 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
aba651c3f1a1657bbe5367c873500e7c60539a3e 03-Feb-2014 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix image filter crop offsets for GPU path.

This is the GPU-side version of
https://codereview.chromium.org/112803004/.
Also factored the crop offset unit test into a function, so we can
call it with both CPU & GPU devices.

R=bsalomon@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13292 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
8f6884aab8aecd7657cf3f9cdbc682f0deca29c5 24-Jan-2014 tfarina@chromium.org <tfarina@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Cleanup: Sanitize the order of includes under tests/

Initially this was to make sure Test.h appeared after the Sk*.h includes.

Patch generated by the following command line:

$ ~/chromium/src/tools/sort-headers.py tests/*.cpp

BUG=None
TEST=tests
R=robertphillips@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13177 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
e2eac8b2fd8966cc9af51f8d40151dad6c591d2e 14-Jan-2014 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Move macros from TestClassDef.h to Test.h

Motivation: those macros don't make any sense without the definitions
in Test.h.

BUG=
R=mtklein@google.com

Author: halcanary@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13074 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
6776b82d466fa93ccffd251fdf556fe058395444 03-Jan-2014 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Make SkImageFilter crop rects relative to the primitive origin, instead of relative to their parent's crop rect. This is required by SVG semantics, and is more sane anyway.

To do this, this patch changes the "offset/loc" parameter in filterImage() / onFilterImage() from an inout-param to an out-param only, so that the calling filter can know how much the input filter wants its result offset (and doesn't include the original primitive position). This offset can then be applied to the current filter's crop rect. (I've renamed the parameter "offset" in all cases to make this clear.) This makes the call sites in SkCanvas/SkGpuDevice responsible for applying the resulting offset to the primitive's position, which is actually a fairly small change.

This change also fixes SkTileImageFilter and SkOffsetImageFilter to correctly handle an input offset, which they weren't before. This required modifying the GM's, since they assumed the broken behaviour.

NOTE: this will require rebaselining the imagefiltersgraph test, since it has a new test case.

NOTE: this will "break" the Blink layout tests css3/filters/effect-reference-subregion-chained-hw.html and css3/filters/effect-reference-subregion-hw.html, but it actually makes them give correct results. It should be suppressed on the skia roll, and I'll rebaseline it.

R=reed@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@12895 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
9f9d5829c29d8934fa0d4d348173d5ae39bed4e9 18-Dec-2013 tfarina@chromium.org <tfarina@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Get rid of DEFINE_TESTCLASS() macro.

Remaining tests were rewrite to use DEF_TEST() macro instead. This fixes
the FIXME in TestClassDef.h

BUG=None
TEST=tests
R=mtklein@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@12760 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
4b413c8bb123e42ca4b9c7bfa6bc2167283cb84c 25-Nov-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> remove SkFloatToScalar macro

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
/external/skia/tests/ImageFilterTest.cpp
cb3b615af712fc71b19b86211c1d083430114d7e 14-Nov-2013 robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Address some more valgrind issues

R=borenet@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@12286 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
8b66abb9bc78fd031334f565c9394f4fdc99811b 16-Oct-2013 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Remove support for SK_CROP_RECT_IS_INT, now that it is no longer used in Blink or Chrome.

BUG=
R=reed@google.com, reed

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

git-svn-id: http://skia.googlecode.com/svn/trunk@11812 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
b295fb6ff3222453912dfcb7a1ea5184d40014b5 10-Oct-2013 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Change SkImageFilter's cropRect from SkIRect to a CropRect struct, containing an SkRect and flags indicating which parameters are set.

NOTE: this will require SK_CROP_RECT_IS_INT=1 to be set in Chrome until Blink has been updated to use SkImageFilter::CropRect. Include https://codereview.chromium.org/26528002/ with the Skia roll.

Note also that SK_CROP_RECT_IS_INT is a temporary measure until all call sites in Blink have been updated to use SkRect.

R=reed@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@11692 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
a604c4f971adf84dcf8235994b1441f6f4fe8ab1 17-Sep-2013 skia.committer@gmail.com <skia.committer@gmail.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Sanitizing source files in Housekeeper-Nightly

git-svn-id: http://skia.googlecode.com/svn/trunk@11309 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
1588354a8702ef993e1a6cce0e7782db4c5f1514 16-Sep-2013 robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Compiler fix for r11288



git-svn-id: http://skia.googlecode.com/svn/trunk@11289 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
24ddde97581624777feebc9e95ae558282f95d4c 16-Sep-2013 robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert 11247, 11250, 11251, 11257, and 11279 to unblock DEPS roll (https://codereview.chromium.org/24159002/)

11279 Sanitizing source files in Housekeeper-Nightly - https://code.google.com/p/skia/source/detail?r=11279
11257 Canary build fix - https://codereview.chromium.org/23532068
11251 More warnings as errors fixes - https://code.google.com/p/skia/source/detail?r=11251
11250 Warnings as errors fix - https://code.google.com/p/skia/source/detail?r=11250
11247 Initial error handling code - https://chromiumcodereview.appspot.com/23021015



git-svn-id: http://skia.googlecode.com/svn/trunk@11288 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
ba6e954140e45e251d67934ed6ad752149fcf72f 16-Sep-2013 robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert the revert of 11247, 11250, 11251 and 11279 (Chrome already relies on changes in r11247)



git-svn-id: http://skia.googlecode.com/svn/trunk@11287 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
478884f7d3b8c7be8b62f3fa2b79192f411c3fec 16-Sep-2013 robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert 11247, 11250, 11251 and 11279 to unblock DEPS roll (https://codereview.chromium.org/24159002/)

11279 Sanitizing source files in Housekeeper-Nightly - https://code.google.com/p/skia/source/detail?r=11279
11251 More warnings as errors fixes - https://code.google.com/p/skia/source/detail?r=11251
11250 Warnings as errors fix - https://code.google.com/p/skia/source/detail?r=11250
11247 Initial error handling code - https://chromiumcodereview.appspot.com/23021015



git-svn-id: http://skia.googlecode.com/svn/trunk@11285 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
dc9888c409e4903a687ea05b9846987b829bf9ac 14-Sep-2013 skia.committer@gmail.com <skia.committer@gmail.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Sanitizing source files in Housekeeper-Nightly

git-svn-id: http://skia.googlecode.com/svn/trunk@11279 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
40fcb598944abdd6578dfd280c1470240b7c7f09 13-Sep-2013 robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> More warnings as errors fixes



git-svn-id: http://skia.googlecode.com/svn/trunk@11251 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
4b681bc95b14e081f1cc5b68cb755d57fc8eb977 13-Sep-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Fixed issues found by fuzzer

Last week, the fuzzer found a few numerical issue with filters and I had written some fixes for them. Here are the fixes with some unit tests.

For senorblanco : So I figured out what was asserting when we'd get a 0 width "result" in SkBicubicImageFilter::onFilterImage(). Basically, if the "result" SkBitmap object calls SkBitmap::setConfig() with "width" and/or "height" set to 0, then the SkBitmap object will call SkBitmap::reset(), making the SkBitmap object's config invalid. At this point, calling SkBitmap::getAddr32() will assert, even without attempting to dereference the data pointer, because the SkBitmap's config is invalid. If height is valid, but width is 0, then this call to SkBitmap::getAddr32() happens directly in SkBicubicImageFilter::onFilterImage() a few lines lower and asserts right away.

BUG=
R=senorblanco@google.com, senorblanco@chromium.org, bsalomon@google.com

Author: sugoi@chromium.org

Review URL: https://chromiumcodereview.appspot.com/23533042

git-svn-id: http://skia.googlecode.com/svn/trunk@11249 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
5c561cb8d8151d38c69128345106cbf225033a1a 25-Jul-2013 skia.committer@gmail.com <skia.committer@gmail.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Sanitizing source files in Housekeeper-Nightly

git-svn-id: http://skia.googlecode.com/svn/trunk@10340 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp
194d775edcf5fa6e82098a97ad53018d70db1155 25-Jul-2013 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> This patch implements a crop rect for SkImageFilter. It has been implemented for SkColorFilterImageFilter and SkBlurImageFilter as examples.

In order to preserve the immutability of SkImageFilters, the crop rect is passed as a constructor parameter. If NULL (the default), the bounds of the input image are used, as before.

This also tightens up the boundary handling for SkImageBlurFilter on the GPU backend. Where we were previously using clamping semantics, we now respect decal semantics (so we don't oversaturate the edges). This brings the GPU and raster backends into closer alignment, but will require some new baselines for the GPU tests.

At a minimum, the following tests will need new baselines: imageblur, imagefiltersbase, imagefilterscropped, spritebitmap.

R=reed@google.com

Committed: https://code.google.com/p/skia/source/detail?r=10251

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

git-svn-id: http://skia.googlecode.com/svn/trunk@10338 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/tests/ImageFilterTest.cpp