History log of /external/skia/src/effects/SkOffsetImageFilter.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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/src/effects/SkOffsetImageFilter.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/src/effects/SkOffsetImageFilter.cpp
29089179a66c06ef70da387111af75970f04ed53 14-Mar-2014 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert "Implement support for expanding crop rects in image filters"

Breaking ImageFilterTests unit test.

TBR=bsalomon@google.com
BUG=skia:

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13806 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkOffsetImageFilter.cpp
0ef0501baf615149d6d84398d7594cd89f6e928d 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

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13805 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkOffsetImageFilter.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/src/effects/SkOffsetImageFilter.cpp
06342a2666012f5d27faa7c2e230ae54f2dff311 11-Mar-2014 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix SkOffsetImageFilter to use a temporary for bounds computations.

SkOffsetImageFilter::onFilterBounds() was writing to *dst, and later
referring to src. These may be the same memory location, so the results
were incorrect.

Covered by the 5th test case in offsetimagefilter.

BUG=skia:

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13744 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkOffsetImageFilter.cpp
e09244d463695cd9d2b089794ca18f59f1e4a621 04-Mar-2014 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Apply the CTM to the offset in the slow SkOffsetImageFilter path.

This was being done in the fast path, but not the slow path.

Since I had to rebaseline the offsetimagefilter GM anyway (to accomodate
the new test case), I added a red border around the intersection
of the (transformed) crop rect and clip rect in each sample, beyond
which no pixels should be drawn.

Chrome bug: https://code.google.com/p/chromium/issues/detail?id=346362

BUG=skia:
R=sugoi@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13656 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkOffsetImageFilter.cpp
ae761f7545d8ebf181d220169afac2056b057b8c 05-Feb-2014 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Make SkImageFilter methods const.

SkImageFilter had some non-const methods that could all be made const.
This is a first step towards making SkImageFilter immutable.

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

Author: dominikg@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13330 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkOffsetImageFilter.cpp
c4b12f19a46946e1c02f3525e0ea4902b09feac5 05-Feb-2014 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Implement correct clipping for image filters.

Image filters in Skia currently clip the size of the the offscreen
bitmap used for filtering to the device clip bounds. This means that
any pixel-moving filter (e.g., blur) has edge artifacts at the clip
boundaries. This is problematic for tiling, where a single SkPicture
is played back with a clip set to the tile boundaries.

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

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

BUG=337831
R=reed@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13323 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkOffsetImageFilter.cpp
8b0e8ac5f582de80356019406e2975079bf0829d 30-Jan-2014 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Refactor read and write buffers.

Eliminates SkFlattenable{Read,Write}Buffer, promoting SkOrdered{Read,Write}Buffer
a step each in the hierarchy.

What used to be this:

SkFlattenableWriteBuffer -> SkOrderedWriteBuffer
SkFlattenableReadBuffer -> SkOrderedReadBuffer
SkFlattenableReadBuffer -> SkValidatingReadBuffer

is now

SkWriteBuffer
SkReadBuffer -> SkValidatingReadBuffer

Benefits:
- code is simpler, names are less wordy
- the generic SkFlattenableFooBuffer code in SkPaint was incorrect; removed
- write buffers are completely devirtualized, important for record speed

This refactoring was mostly mechanical. You aren't going to find anything
interesting in files with less than 10 lines changed.

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

Author: mtklein@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13245 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkOffsetImageFilter.cpp
336d1d759590d9bedcbc5a96d0fff79861cf8f7a 27-Jan-2014 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Implement a computeFastBounds() traversal for SkImageFilter.

This allows for correct culling of primitives which have image filters applied.

R=reed@google.com
BUG=skia:

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13207 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkOffsetImageFilter.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/src/effects/SkOffsetImageFilter.cpp
cd3b15ca6364a04b0eeeb4f89c7daa8aefe854c8 04-Dec-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Fixed bad bitmap size crashes

There were 2 issues :
1 ) If the size of an SkBitmap's underlying SkPixelRef's alocated memory is too small to fit the bitmap, then the deserialization will now check this and set an error appropriately.
2 ) If a device fails to allocate its pixels, the device will be deleted and NULL will be returned to avoid attempting to draw on a bad device.

BUG=
R=senorblanco@chromium.org, reed@google.com, sugoi@google.com, halcanary@google.com, mtklein@google.com

Author: sugoi@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@12484 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkOffsetImageFilter.cpp
ce33d60187718e7bb01944ee130c9f5d9fb335ec 25-Nov-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Adding more validation

- Added a way to check that the number of inputs of a filter is not more than a filter expects
- Added validation of reftype in SkBitmap::unflatten()
- Added validation on fKD (diffuse lighting constant) and fKS (specular lighting constant) to make sure that they are always non-negative numbers
- Added validation of SkPerlinNoiseShader::fType and SkPerlinNoiseShader::fNumOctaves

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

Author: sugoi@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@12388 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkOffsetImageFilter.cpp
f2f8f3a43c5d7c7bd66afc6d9097ad5968df1596 01-Nov-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Adding a way to disable SkOffsetImageFilter's optimized path in blink/chrome

BUG=
R=senorblanco@chromium.org, reed@google.com, sugoi@google.com

Author: sugoi@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@12075 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkOffsetImageFilter.cpp
c0b7e10c6a68f59e1653e6c18e6bc954b3c3f0cf 23-Oct-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Initial error handling code

I made it as simple as possible. The impact seems minimal and it should do what's necessary to make this code secure.

BUG=

Committed: http://code.google.com/p/skia/source/detail?r=11247

R=reed@google.com, scroggo@google.com, djsollen@google.com, sugoi@google.com, bsalomon@google.com, mtklein@google.com, senorblanco@google.com, senorblanco@chromium.org

Author: sugoi@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@11922 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkOffsetImageFilter.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/src/effects/SkOffsetImageFilter.cpp
1a4fb70c8a04db2d92ec821555f91218a989031d 26-Sep-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Moving 4 SkImageFilter derived classes from blink to skia

There were 4 classes in blink that derived from SkImageFilter :
- TileImageFilter -> SkTileImageFilter
- OffsetImageFilter -> SkOffsetImageFilter (already existed)
- FloodImageFilter -> SkFloodImageFilter
- CompositeImageFilter -> SkCompositeImageFilter

All functions were copied as is, without modification (except for warnings fixes), except for the offset filter, which was merged into the existing SkOffsetImageFilter class, as a special case when a crop rect is provided. Since the names won't clash with the names in blink, it should be easy to integrate them in blink later and fix issues, if needed.

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

Author: sugoi@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@11475 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkOffsetImageFilter.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/src/effects/SkOffsetImageFilter.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/src/effects/SkOffsetImageFilter.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/src/effects/SkOffsetImageFilter.cpp
5792cded61a7302f32bd0f4aeda51a9b2f1d00f6 13-Sep-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Initial error handling code

I made it as simple as possible. The impact seems minimal and it should do what's necessary to make this code secure.

BUG=
R=reed@google.com, scroggo@google.com, djsollen@google.com, sugoi@google.com, bsalomon@google.com, mtklein@google.com, senorblanco@google.com, senorblanco@chromium.org

Author: sugoi@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@11247 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkOffsetImageFilter.cpp
68400767be5f72e4b9750ccc8bcf0078d42869a7 24-May-2013 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Remove SkImageFilter::getInputResult(), since its return value is not
style-compliant, and doesn't allow us to abort on failure.

R=reed@google.com

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

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

git-svn-id: http://skia.googlecode.com/svn/trunk@9274 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkOffsetImageFilter.cpp
f0656c140aa3dcbfb250433045e803b2b99f4cab 23-May-2013 robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Reverting r9245 due to Chrome breakage



git-svn-id: http://skia.googlecode.com/svn/trunk@9250 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkOffsetImageFilter.cpp
be1d02e52862f8afa5a4056f66d0eacb4f16e6fd 22-May-2013 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Remove SkImageFilter::getInputResult(), since its return value is not
style-compliant, and doesn't allow us to abort on failure.

R=reed@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@9245 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkOffsetImageFilter.cpp
377c14a1e648f4427bd11474fad8ac264d98aff2 04-Feb-2013 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Nuke SkSingleInputImageFilter. 99% of its functionality was refactored into SkImageFilterUtils in https://code.google.com/p/skia/source/detail?r=7467, so it has outlived its usefulness.

Review URL: https://codereview.appspot.com/7277055

git-svn-id: http://skia.googlecode.com/svn/trunk@7563 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkOffsetImageFilter.cpp
9daf96afb34313842d8d2c4abca73d954d2e9005 06-Nov-2012 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Break out SkOffsetImageFilter into its own file, and derive it from
SkSingleInputImageFilter, to make it DAG-friendly.

Review URL: https://codereview.appspot.com/6822086

git-svn-id: http://skia.googlecode.com/svn/trunk@6315 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkOffsetImageFilter.cpp