History log of /external/skia/tests/ImageFilterTest.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
9ed58377b45739aa8f9dc1b02049ab29c137a838 25-Jul-2014 Derek Sollenberger <djsollen@google.com> Merge changes from Skia's m37 branch into lmp-dev.

This merge includes the following CLs...
20ee1ba Change SkCanvasState to use inheritance.
b572f07 DirectWrite to detect GDI only fonts
282aa1e Fix SkColorFilterImageFilter matrix optimization
e849224 Re-land "Fix external SkImageFilter caching with clips."
9b1eeeb Better rendering detection with DirectWrite.
/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