History log of /external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
48e78468f5f6b900d476e616bdb1ba457c8f0b2a 17-Feb-2016 robertphillips <robertphillips@google.com> Mark existing image filter entry points that will be going away with Deprecated
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1709753002

Review URL: https://codereview.chromium.org/1709753002
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
5e1ddb108638d1d51a3940fcae1dd23adc5ac53b 21-Dec-2015 reed <reed@chromium.org> Reland of change all factories to return their base-class (patchset #1 id:1 of https://codereview.chromium.org/1540203002/ )

Reason for revert:
chrome changes have landed

Original issue's description:
> Revert of change all factories to return their base-class (patchset #1 id:1 of https://codereview.chromium.org/1535353002/ )
>
> Reason for revert:
> need to update some chrome/blink call-sites
>
> Original issue's description:
> > change all factories to return their base-class
> >
> > will watch DEPS roll to see if there are chrome sites needing updates
> >
> > BUG=skia:
> > GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1535353002
> >
> > TBR=
> >
> > Committed: https://skia.googlesource.com/skia/+/d63f60a36327e9580861205ebb35cade8c49bd34
>
> TBR=
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/2d6ba6690f8951e152d8e793191b14afd52f5506

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

Review URL: https://codereview.chromium.org/1533373002
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
2d6ba6690f8951e152d8e793191b14afd52f5506 21-Dec-2015 reed <reed@chromium.org> Revert of change all factories to return their base-class (patchset #1 id:1 of https://codereview.chromium.org/1535353002/ )

Reason for revert:
need to update some chrome/blink call-sites

Original issue's description:
> change all factories to return their base-class
>
> will watch DEPS roll to see if there are chrome sites needing updates
>
> BUG=skia:
> GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1535353002
>
> TBR=
>
> Committed: https://skia.googlesource.com/skia/+/d63f60a36327e9580861205ebb35cade8c49bd34

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

Review URL: https://codereview.chromium.org/1540203002
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
d63f60a36327e9580861205ebb35cade8c49bd34 21-Dec-2015 reed <reed@chromium.org> change all factories to return their base-class

will watch DEPS roll to see if there are chrome sites needing updates

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

TBR=

Review URL: https://codereview.chromium.org/1535353002
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
db64af3b178a19ecb47d2b9a373113687d8921fd 09-Dec-2015 senorblanco <senorblanco@chromium.org> Fix filter primitive bounds computations.

Make each filter responsible for expanding its destination
bounds. Previously, we were using a union of all
intermediate bounds sizes via join() calls in many image
filters' computeFastBounds(), due to the fact that those
filters could only produce bitmaps the same size as their
inputs. Now, we compute optimal bounds for each filter as
follows:

1) Pass the (unmodified) clip bounds to the root node
of the DAG in the first recursive call to onFilterImage()
as the Context's fClipBounds.

2) Reverse-map the clip: when recursing up the DAG in
filterInput[GPU](), apply filter-specific expansion to the
clip by calling calling onFilterNodeBounds(... kReverse).
This allows upstream nodes to have a clip that respects the
current node's requirements. This is done via helper
function mapContext().

3) Forward-map the source bitmap: just prior to applying
the crop rect in applyCropRect(), we determine the filter's
preferred bounds by mapping the source bitmap bounds
forwards via onFilterNodeBounds(..., kForward).

NOTE: GMs affected by this change:
fast_slow_blurimagefilter: fast and slow paths now produce the same result
spritebitmap: drawSprite() and drawBitmap() paths now produce the same result
filterfastbounds: fast bounds are optimized; all drop-shadow results now appear
apply-filter: snug and not-snug cases give same results
dropshadowimagefilter: drawSprite() results now show shadows
draw-with-filter: no artifacts on erode edges; blur edges no longer clipped
displacement, imagefiltersbase, imagefiltersclipped, imagefilterscropexpand, imagefiltersscaled, matriximagefilter,
resizeimagefilter, localmatriximagefilter, testimagefilters: fixed incorrect clipping
imagefilterstransformed, morphology: no artifacts on erode edges

BUG=skia:1062,skia:3194,skia:3939,skia:4337,skia:4526

Review URL: https://codereview.chromium.org/1308703007
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
a544eda5ddea215037b1ada6ba5cfc98f6c8ee15 07-Dec-2015 senorblanco <senorblanco@chromium.org> Matrix convolution bounds fix; affectsTransparentBlack fixes.

Because the convolution kernel is (currently) applied in device space,
there's no way to know which object-space pixels will be touched. So
return false from canComputeFastBounds().

The results from the matrixconvolution GM were actually wrong, since
they were showing edge differences on the clip boundaries, where they
should really only show on crop boundaries. I added a crop to the GM
to keep the results the same (which are useful to test the different
convolution tile modes).

While I was at it, SkImageFilter::affectsTransparentBlack() was
inapplicable on most things except color filters, and its use on
leaf nodes was confusing. So I removed it, and made
SkImageFilter::canComputeFastBounds() virtual instead.

BUG=skia:4630

Review URL: https://codereview.chromium.org/1500923004
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
50c044b9addac613189d6378641c65721e16b2ed 05-Dec-2015 senorblanco <senorblanco@chromium.org> Revert of Matrix convolution bounds fix; affectsTransparentBlack fixes. (patchset #4 id:60001 of https://codereview.chromium.org/1500923004/ )

Reason for revert:
Introduced memory leak; pixel changes in Chrome.

Original issue's description:
> Matrix convolution bounds fix; affectsTransparentBlack fixes.
>
> Because the convolution kernel is (currently) applied in device space,
> there's no way to know which object-space pixels will be touched. So
> return false from canComputeFastBounds().
>
> The results from the matrixconvolution GM were actually wrong, since
> they were showing edge differences on the clip boundaries, where they
> should really only show on crop boundaries. I added a crop to the GM
> to keep the results the same (which are useful to test the different
> convolution tile modes).
>
> While I was at it, SkImageFilter::affectsTransparentBlack() was
> inapplicable on most things except color filters, and its use on
> leaf nodes was confusing. So I removed it, and made
> SkImageFilter::canComputeFastBounds() virtual instead.
>
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/8705ec80518ef551994b82ca5ccaeb0241d6adec

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

Review URL: https://codereview.chromium.org/1497083005
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
8705ec80518ef551994b82ca5ccaeb0241d6adec 04-Dec-2015 senorblanco <senorblanco@chromium.org> Matrix convolution bounds fix; affectsTransparentBlack fixes.

Because the convolution kernel is (currently) applied in device space,
there's no way to know which object-space pixels will be touched. So
return false from canComputeFastBounds().

The results from the matrixconvolution GM were actually wrong, since
they were showing edge differences on the clip boundaries, where they
should really only show on crop boundaries. I added a crop to the GM
to keep the results the same (which are useful to test the different
convolution tile modes).

While I was at it, SkImageFilter::affectsTransparentBlack() was
inapplicable on most things except color filters, and its use on
leaf nodes was confusing. So I removed it, and made
SkImageFilter::canComputeFastBounds() virtual instead.

BUG=skia:

Review URL: https://codereview.chromium.org/1500923004
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
1d3ff434954189e194c468f429598465146dcf4b 20-Oct-2015 senorblanco <senorblanco@chromium.org> Image filters: Replace all use of tryAllocPixels() with createDevice().

In order to have a central pinch point for bitmap allocation, change all
filters to use Proxy::createDevice() instead of allocating memory
directly with SkBitmap::tryAllocPixels().

This will aid in moving filter backing stores and caches to
discardable memory.

BUG=skia:

Review URL: https://codereview.chromium.org/1414843003
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
b9519f86bbce946e505980a4fa950fdc4bcf74ab 15-Oct-2015 senorblanco <senorblanco@chromium.org> Image Filters: refactor all CPU input processing into a filterInput helper function.

No change in behaviour; this is a straight refactoring.

BUG=skia:3194

Review URL: https://codereview.chromium.org/1404743005
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
4a339529612a43871d021877e58698e067d6c4cd 06-Oct-2015 bsalomon <bsalomon@google.com> Bye bye processor data manager.

Review URL: https://codereview.chromium.org/1388113002
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
62ce0303fb3f9857ee3ab8df05934642c226b1a3 28-Aug-2015 bungeman <bungeman@google.com> Replace SkPin32 with SkTPin and remove.

SkPin32 is already just forwarding to SkTPin, so convert existing
users and remove SkPin32.

Review URL: https://codereview.chromium.org/1314583003
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
96fcdcc219d2a0d3579719b84b28bede76efba64 27-Aug-2015 halcanary <halcanary@google.com> Style Change: NULL->nullptr
DOCS_PREVIEW= https://skia.org/?cl=1316233002

Review URL: https://codereview.chromium.org/1316233002
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
385fe4d4b62d7d1dd76116dd570df3290a2f487b 26-Aug-2015 halcanary <halcanary@google.com> Style Change: SkNEW->new; SkDELETE->delete
DOCS_PREVIEW= https://skia.org/?cl=1316123003

Review URL: https://codereview.chromium.org/1316123003
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
5f10b5c1b5744106312e24835d235b72fdba5802 09-Jul-2015 joshualitt <joshualitt@chromium.org> More threading of GrProcessorDataManager

TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1230813003
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
9cc1775e7230579ad15345bdcb59fa517c17f870 09-Jul-2015 joshualitt <joshualitt@chromium.org> rename GrShaderDataManager -> GrProcessorDataManager

BUG=skia:

Review URL: https://codereview.chromium.org/1228683002
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
85ff25e8d905502ec09d057ecc6245f487bf94ce 08-Jul-2015 joshualitt <joshualitt@chromium.org> Thread GrShaderDataManager through Image filters

TBR=bsalomon@google.com
BUG=skia:

Review URL: https://codereview.chromium.org/1229613002
/external/skia/src/effects/SkMatrixConvolutionImageFilter.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/src/effects/SkMatrixConvolutionImageFilter.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/src/effects/SkMatrixConvolutionImageFilter.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/src/effects/SkMatrixConvolutionImageFilter.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/src/effects/SkMatrixConvolutionImageFilter.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/src/effects/SkMatrixConvolutionImageFilter.cpp
1379b87ae463246e586b869f7457ce5befc4472c 17-Nov-2014 sugoi <sugoi@chromium.org> Added missing validation

BUG=433359

Review URL: https://codereview.chromium.org/729583002
/external/skia/src/effects/SkMatrixConvolutionImageFilter.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/src/effects/SkMatrixConvolutionImageFilter.cpp
b0a8a377f832c59cee939ad721e1f87d378b7142 23-Sep-2014 joshualitt <joshualitt@chromium.org> Patch to create a distinct geometry processor. The vast majority of this patch
is just a rename. The meat is in GrGeometryProcessor, GrProcessor,
GrGL*Processor, GrProcessorStage, Gr*BackendProcessorFactory,
GrProcessUnitTestFactory, and the builders

BUG=skia:
R=bsalomon@google.com

Author: joshualitt@chromium.org

Review URL: https://codereview.chromium.org/582963002
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
848250415eddc54075f7eb8795e8db79e749c6ab 02-Sep-2014 reed <reed@google.com> make allocPixels throw on failure

BUG=skia:
R=mtklein@google.com, fmalita@google.com, fmalita@chromium.org

Author: reed@google.com

Review URL: https://codereview.chromium.org/510423005
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
5e5f948b6b363dbfc8c076d8ff0c6b8e9ea99958 26-Aug-2014 senorblanco <senorblanco@chromium.org> Reimplement deserialization of SkImageFilter's uniqueID.

9fa60d ("Simplify flattening to just write enough ... ") simplified just
a tad too much. In particular, it disabled deserialization of
SkImageFilter's uniqueID, which in turn caused the failure of
SkImageFilter's cache, which caused a large regression in Chrome's SVG
filter performance.

The medium-term fix is to switch to the new SkRecordDraw SkPicture
backend, which will make the unique IDs unnecessary.

This change is an "in case of emergecy" CL, in the event that there are
problems switching on the new backend in Chrome. For that reason, it's
minimalist: only the filters used by Chrome are modified, and whitespace
changes are kept to a minimum. In this way, it should be easy to revert
once the new backend goes in.

R=reed@google.com

Author: senorblanco@chromium.org

Review URL: https://codereview.chromium.org/503833002
/external/skia/src/effects/SkMatrixConvolutionImageFilter.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/src/effects/SkMatrixConvolutionImageFilter.cpp
5ae5fc59b27a48711e514b3ede548b228e393e9b 29-Jul-2014 joshualitt <joshualitt@chromium.org> Adding repeat mode to texture domain

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

Author: joshualitt@chromium.org

Review URL: https://codereview.chromium.org/422123003
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
ac9779234ef7a8cf3d791ab7690ef8c388662836 22-Jul-2014 joshualitt <joshualitt@chromium.org> Initial change to move 2D kernel to its own file.

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

Author: joshualitt@chromium.org

Review URL: https://codereview.chromium.org/379253003
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
63e99f7a03b2ac90ae7a00232674fd39c0bdcc68 21-Jul-2014 bsalomon <bsalomon@google.com> Allow GrGLEffects to produce variable length keys.

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

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/385713005
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
848faf00ec33d39ab3e31e9a11d805cae6ac6562 11-Jul-2014 bsalomon <bsalomon@google.com> This moves us towards variable length effect keys. The overall program key now allows for it. After the header it stores an array of offsets to effect keys. This allows us to grab the effect keys to pass to effects when they generate code. It also ensures that we can't get a collision by sets of keys that are different lengths but are the same when appended together.

R=robertphillips@google.com, jvanverth@google.com, egdaniel@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/356513003
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
83d081ae1d731b5039e99823620f5e287542ee39 08-Jul-2014 bsalomon <bsalomon@google.com> Goodbye GrEffectRef.

Also, reworked some var names and comments around SkShader::asNewEffect.

R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/374923002
/external/skia/src/effects/SkMatrixConvolutionImageFilter.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/src/effects/SkMatrixConvolutionImageFilter.cpp
55fad7af61c21d502acb9891d631e8aa29e3628c 08-Jul-2014 bsalomon <bsalomon@google.com> Remove GrEffect::CreateEffectRef and GrEffect::AutoEffectRef.

R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://codereview.chromium.org/371103003
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
6c22573edb234ad14df947278cfed010669a39a7 10-Jun-2014 reed <reed@chromium.org> hide SkBitmap::setConfig

patch from issue 325733002

TBR=scroggo

Author: reed@chromium.org

Review URL: https://codereview.chromium.org/322963002
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
56d135c03e1d38f0b9e17d79a3cbf8db2a915086 06-Jun-2014 sugoi <sugoi@chromium.org> Adding kernel offset validation

Fixing bug found by clusterfuzz in SkMatrixConvolutionImageFilter.

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

Author: sugoi@chromium.org

Review URL: https://codereview.chromium.org/319003002
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
c77392ed58ec78ab19fa0e3ff99fb8110854fba2 02-Jun-2014 reed <reed@google.com> use colortype instead of config

clone of https://codereview.chromium.org/305133006/

TBR=

BUG=skia:

Author: reed@google.com

Review URL: https://codereview.chromium.org/301233011
/external/skia/src/effects/SkMatrixConvolutionImageFilter.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/src/effects/SkMatrixConvolutionImageFilter.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/src/effects/SkMatrixConvolutionImageFilter.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/src/effects/SkMatrixConvolutionImageFilter.cpp
28fcae2ec77eb16a79e155f8d788b20457f1c951 11-Apr-2014 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert of Revert of Rename kPMColor_SkColorType to kN32_SkColorType. (https://codereview.chromium.org/234243002/)

Reason for revert:
Want to reland the original CL.

Original issue's description:
> Revert of Rename kPMColor_SkColorType to kN32_SkColorType. (https://codereview.chromium.org/227433009/)
>
> Reason for revert:
> breaking the Chrome deps roll.
> http://build.chromium.org/p/chromium.linux/builders/Linux%20GN%20%28dbg%29/builds/839/steps/compile/logs/stdio
>
> Original issue's description:
> > Rename kPMColor_SkColorType to kN32_SkColorType.
> >
> > The new name better represents what this flag means.
> >
> > BUG=skia:2384
> >
> > Committed: http://code.google.com/p/skia/source/detail?r=14117
>
> TBR=reed@google.com,scroggo@google.com
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:2384
>
> Committed: http://code.google.com/p/skia/source/detail?r=14144

R=reed@google.com, bensong@google.com
TBR=bensong@google.com, reed@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:2384

Author: scroggo@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@14156 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
96edc2459820f0f60ea9b57959c1e5018ef95e28 11-Apr-2014 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert of Rename kPMColor_SkColorType to kN32_SkColorType. (https://codereview.chromium.org/227433009/)

Reason for revert:
Chrome's side of define changes not easy to figure out quickly. Reverting this for DEPS roll for now.

Original issue's description:
> Rename kPMColor_SkColorType to kN32_SkColorType.
>
> The new name better represents what this flag means.
>
> BUG=skia:2384
>
> Committed: http://code.google.com/p/skia/source/detail?r=14117

R=reed@google.com, scroggo@google.com
TBR=reed@google.com, scroggo@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:2384

Author: bensong@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@14149 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
d923288e50b5a69afb0bdd5c161191b24cab8345 11-Apr-2014 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert of Revert of Rename kPMColor_SkColorType to kN32_SkColorType. (https://codereview.chromium.org/234243002/)

Reason for revert:
fixes on the chrome side are landing (brettw), keep fingers crossed.

Original issue's description:
> Revert of Rename kPMColor_SkColorType to kN32_SkColorType. (https://codereview.chromium.org/227433009/)
>
> Reason for revert:
> breaking the Chrome deps roll.
> http://build.chromium.org/p/chromium.linux/builders/Linux%20GN%20%28dbg%29/builds/839/steps/compile/logs/stdio
>
> Original issue's description:
> > Rename kPMColor_SkColorType to kN32_SkColorType.
> >
> > The new name better represents what this flag means.
> >
> > BUG=skia:2384
> >
> > Committed: http://code.google.com/p/skia/source/detail?r=14117
>
> TBR=reed@google.com,scroggo@google.com
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:2384
>
> Committed: http://code.google.com/p/skia/source/detail?r=14144

R=reed@google.com, scroggo@google.com
TBR=reed@google.com, scroggo@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:2384

Author: bensong@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@14145 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
757ebd20ef284b6428eb9f4b9b69826cc3640a82 11-Apr-2014 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert of Rename kPMColor_SkColorType to kN32_SkColorType. (https://codereview.chromium.org/227433009/)

Reason for revert:
breaking the Chrome deps roll.
http://build.chromium.org/p/chromium.linux/builders/Linux%20GN%20%28dbg%29/builds/839/steps/compile/logs/stdio

Original issue's description:
> Rename kPMColor_SkColorType to kN32_SkColorType.
>
> The new name better represents what this flag means.
>
> BUG=skia:2384
>
> Committed: http://code.google.com/p/skia/source/detail?r=14117

R=reed@google.com, scroggo@google.com
TBR=reed@google.com, scroggo@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:2384

Author: bensong@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@14144 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
149e9a107c356b0151433fb23c2b1c8d0634947c 09-Apr-2014 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Rename kPMColor_SkColorType to kN32_SkColorType.

The new name better represents what this flag means.

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

Author: scroggo@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@14117 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.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/SkMatrixConvolutionImageFilter.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/SkMatrixConvolutionImageFilter.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/SkMatrixConvolutionImageFilter.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/SkMatrixConvolutionImageFilter.cpp
84cd099704b3896ca66081a96508572a924f850c 12-Mar-2014 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Clean up SkImageFilter.

Rename more occurences of 'target' to 'kernelOffset'.
This is a follow-up patch to
https://codereview.chromium.org/182983003/

BUG=skia:2187
R=senorblanco@chromium.org

Author: dominikg@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13768 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.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/src/effects/SkMatrixConvolutionImageFilter.cpp
e24ad23ae67ffcb0dc545b7e426cf08d102e0868 16-Feb-2014 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> use SkColorType instead of SkBitmap::Config in views/effects

R=scroggo@google.com, reed@google.com
TBR=scroggo

Author: reed@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@13469 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.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/SkMatrixConvolutionImageFilter.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/SkMatrixConvolutionImageFilter.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/SkMatrixConvolutionImageFilter.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/SkMatrixConvolutionImageFilter.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/SkMatrixConvolutionImageFilter.cpp
d3baf20dd1de9940717dd50b5c9ff6061561342e 07-Nov-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Added support for Chrome's gpu command buffer extension BindUniformLocation.

R=bsalomon@google.com, bsalomon

Author: skaslev@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@12178 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
025128811219dc45fd99b6c4d1d14f833cf7a26e 31-Oct-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Adding size parameter to read array functions

In some cases, the allocated array into which the data will be read is using getArrayCount() to allocate itself, which should be safe, but some cases use fixed length arrays or compute the array size before reading, which could overflow if the stream is compromised.

To prevent that from happening, I added a check that will verify that the number of bytes to read will not exceed the capacity of the input buffer argument passed to all the read...Array() functions.

I chose to use the byte array for this initial version, so that "size" represents the same value across all read...Array() functions, but I could also use the element count, if it is preferred.

Note : readPointArray and writePointArray are unused, so I could also remove them

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

Author: sugoi@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@12058 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
d594dbec0407343b7ac13af9c4580ec5933ab060 23-Oct-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Follow up to serialization validation code

1 ) Added check for bool to make sure is it either 0 or 1 and not garbage

2 ) Added more solid kernel size checks in SkMatrixConvolutionImageFilter

3 ) Make sure array size is validated in SkMergeImageFilter

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

Author: sugoi@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@11925 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.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/SkMatrixConvolutionImageFilter.cpp
a34995e18b1f0a7d8c9f23451718bb30ff0105b0 23-Oct-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Implement SkColorFilter as a GrGLEffect

Adds GrEffect::willUseInputColor() which indicates whether or not the
input color affects the output of the effect. This is needed for
certain Xfermodes, such as kSrc_Mode. For these modes the color filter
will not use the input color.

An effect with GrEffect::willUseInputColor() true will cause all color
or coverage effects before it to be discarded, as their computations
cannot affect the output. In these cases program is marked as having
white input color.

This fixes an assert when Skia is compiled in a mode that prefers
using uniforms instead of attributes for constants. (Flags
GR_GL_USE_NV_PATH_RENDERING or GR_GL_NO_CONSTANT_ATTRIBUTES). Using
attributes hides the problem where the fragment shader does not need
input color for color filters that ignore DST part of the filter. The
assert would be hit when uniform manager tries to bind an uniform which
has been optimized away by the shader compiler.

Adds specific GrGLSLExpr4 and GrGLSLExpr1 classes. This way the GLSL
expressions like "(v - src.a)" can remain somewhat readable in form of
"(v - src.a())". The GrGLSLExpr<typename> template implements the
generic functionality, GrGLSLExprX is the specialization that exposes
the type-safe interface to this functionality.

Also adds operators so that GLSL binary operators of the form
"(float * vecX)" can be expressed in C++. Before only the equivalent
"(vecX * float)" was possible. This reverts the common blending
calculations to more conventional order, such as "(1-a) * c" instead of
"c * (1-a)".

Changes GrGLSLExpr1::OnesStr from 1 to 1.0 in order to preserve the
color filter blending formula string the same (with the exception of
variable name change).

Shaders change in case of input color being needed:
- vec4 filteredColor;
- filteredColor = (((1.0 - uFilterColor.a) * output_Stage0) + uFilterColor);
- fsColorOut = filteredColor;
+ vec4 output_Stage1;
+ { // Stage 1: ModeColorFilterEffect
+ output_Stage1 = (((1.0 - uFilterColor_Stage1.a) * output_Stage0) + uFilterColor_Stage1);
+ }
+ fsColorOut = output_Stage1;

Shaders change in case of input color being not needed:
-uniform vec4 uFilterColor;
-in vec4 vColor;
+uniform vec4 uFilterColor_Stage0;
out vec4 fsColorOut;
void main() {
- vec4 filteredColor;
- filteredColor = uFilterColor;
- fsColorOut = filteredColor;
+ vec4 output_Stage0;
+ { // Stage 0: ModeColorFilterEffect
+ output_Stage0 = uFilterColor_Stage0;
+ }
+ fsColorOut = output_Stage0;
}

R=bsalomon@google.com, robertphillips@google.com, jvanverth@google.com

Author: kkinnunen@nvidia.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@11912 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
2a4223c783e35f1c6095c4736a9246884e51a48d 20-Oct-2013 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix for cropped matrix convolution for BottomLeft render targets.

R=bsalomon@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@11872 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
7938bae14af94c1d48d122a2d686e123b66411a7 18-Oct-2013 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Implement crop rect support for SkMatrixConvolutionImageFilter.

R=bsalomon@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@11863 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
77af6805e5faea1e2a5c0220098aec9082f3a6e5 02-Oct-2013 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Make GPU coord transforms automatic

Adds a GrCoordTransform class and updates the framework to handle
coord transforms similar to how it handles textures with
GrTextureAccess. Renames GrGLEffectMatrix to GrGLCoordTransform and
slightly repurposes it to be used by the framework instead of effects.

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

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

git-svn-id: http://skia.googlecode.com/svn/trunk@11569 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.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/SkMatrixConvolutionImageFilter.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/SkMatrixConvolutionImageFilter.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/SkMatrixConvolutionImageFilter.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/SkMatrixConvolutionImageFilter.cpp
e0e7cfe44bb9d66d76120a79e5275c294bacaa22 09-Sep-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Change old PRG to be SkLCGRandom; change new one to SkRandom

The goal here is to get people to start using the new random number
generator, while leaving the old one in place so we don't have to
rebaseline GMs.

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

Author: jvanverth@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@11169 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
74a3a2135ca82ab9324b7e499caa3280348a4fda 30-Aug-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Rename ShaderType enum to ShaderVisibility

Renames ShaderType in GrGLShaderBuilder to ShaderVisibility. It is now
used solely as a bitfield. Methods that previously accepted a single
ShaderType value are split into separate calls:

- getShader -> vsGetShader, gsGetShader, fsGetShader
- emiitFunction -> fsEmitFunction
- appendTextureLookup -> fsAppendTextureLookup

No change in functionality. This is a refactoring to allow us to
separate the vertex/geometry and fragment parts of GrGLShaderBuilder.

R=bsalomon@google.com

Author: cdalton@nvidia.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@11044 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
7ab7ca4199e97126de01d507d34f60a07843937f 28-Aug-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix case where GrGLEffectMatrix gives back a dangling ptr for the coords var name.

R=robertphillips@google.com

Author: bsalomon@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@10982 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
fbaea5336690ffc4fd9ee695608e9457da10eeab 27-Aug-2013 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> In image filters, apply the CTM and offset to the crop rect. This is necessary to compensate for both clipping applied by the compositor (communicated via the CTM) and for cropping applied in upstream image filters (communicated via the offset). This requires a few ugly conversions, since the crop rect is an SkIRect, and the ctm is an SkMatrix.

I also had to offset the matrix passed to filter evaluation by drawSprite() and internalDrawBitmap() by the primitive position. This is the same offset that is applied when drawing the primitive, to compensate for the internal saveLayer().

Also apply the total matrix to the filter params in asNewEffect(), so that (for example) lighting params are offset by both the compositor clipping and upstream crop rects.

R=reed@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@10961 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
7425c124f685978a0a6f0a1f79e89154019e7c99 14-Aug-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Refactor GrGLUniformManager::UniformHandle to initialize itself by default

Refactor GrGLUniformManager::UniformHandle to initialize itself to
"invalid" state by default. This simplifies the effect
constructors. In the future, it should also help catch potential
uninitialized uniform variable usage.

Remove unneeded explicit uniform handle validity assertions before the
handle usage. The assertion will always be made when handle is
converted to index.

BUG=skia:1492
R=bsalomon@google.com

Author: kkinnunen@nvidia.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@10713 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
96ae688f03f05a53c2ae6e66a431e180b90be9cd 14-Aug-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> effects: Replaces uses of GrAssert with SkASSERT.

This is the first step on migrating from GrAssert to SkASSERT as requested by
Brian.

R=bsalomon@google.com, robertphillips@google.com, scroggo@google.com

Author: tfarina@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@10706 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
4e16bb2a322f2bd16cb1afd2f78c27e420a4b9db 26-Jul-2013 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Implement crop rect for lighting image filters. Changes for the CPU path were fairly straightforward: use the bounds rectangle when traversing the pixels, not the source rectangle.

For the GPU path, this required modifying the signature of SkImageFilter::asNewEffect() to receive the bounds offset, so that the lighting filters could offset the light position by the offset. It also required modifying the base-class implementation of SkImageFilter::filterImageGPU() (which implements single-pass filters) to intersect against the bounds rect, to pass its offset to asNewEffect(), and to modify the caller's offset (so it's drawn in the correct place).

Note: this will require rebaselining the lighting GM. Six new test cases were added, to accommodate a cropped version of each lighting filter.

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

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

git-svn-id: http://skia.googlecode.com/svn/trunk@10379 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.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/SkMatrixConvolutionImageFilter.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/SkMatrixConvolutionImageFilter.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/SkMatrixConvolutionImageFilter.cpp
d043ccee3788ea4192806bd8c94484ed003fa828 08-Apr-2013 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Allow single-pass filters (which use asNewEffect()) to participate in the image filter DAG. This was done by introducing the SkSinglePassImageFilter abstract base class, which implements canFilterImageGPU() and filterImageGPU() on behalf of the derived class. The derived class still only needs to asNewEffect(). This allows us to recurse on the filter input in SkSinglePassImageFilter::onFilterImageGPU(). It also allows us to remove any knowledge of single-pass image filters from SkGpuDevice and from the SkImageFilter base class as well.

BUG=

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

git-svn-id: http://skia.googlecode.com/svn/trunk@8563 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
c26d94fd7dc0b00cd6d0e42d28285f4a38aff021 25-Mar-2013 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Move nested class GrDrawTarget::Caps out as GrDrawTargetCaps.
Pass caps to GrEffect::TestCreate() functions so that they can return effects that will work with the capabilities.
Review URL: https://codereview.chromium.org/12965018

git-svn-id: http://skia.googlecode.com/svn/trunk@8369 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
35300c47fc6e59d8415a06042f230ed36deb60b3 21-Mar-2013 robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix minor valgrind-found memory leaks

https://codereview.chromium.org/12440066/



git-svn-id: http://skia.googlecode.com/svn/trunk@8297 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
c78188896e28a4ae49e406a7422b345ae177dafe 20-Mar-2013 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Attempt to reland 8264-5 with warning-as-error fixes.




git-svn-id: http://skia.googlecode.com/svn/trunk@8272 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
67e7cde5c5e59a8f1de7ee28276b8193ecb2bc7f 20-Mar-2013 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> revert 8265-8264 (broke build)



git-svn-id: http://skia.googlecode.com/svn/trunk@8268 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
ae81d5c4aa1716756b2cfb4c44f27f4dce2716ef 20-Mar-2013 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Adds local coords to GrEffect system.

Effects can ask the builder for local coords which may or may not be distinct from positions.

GrEffectStage tracks changes to relationship between pos and local coords.

GrGLEffectMatrix and GrSingleTextureEffect can use either pos or textures as intput coords

GrSimpleTextureEffect now allows for an explicit texture coords attribute.
Review URL: https://codereview.chromium.org/12531015

git-svn-id: http://skia.googlecode.com/svn/trunk@8264 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
f910d3b23bcf590ee937628dbab8e39a98ee5860 07-Mar-2013 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Make GrGLEffects use an interface to append their code.

A small step towards encapsulating GrGLShaderBuilder.
Review URL: https://codereview.chromium.org/12547012

git-svn-id: http://skia.googlecode.com/svn/trunk@8018 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
73a9694b4ceb67547e5863db5315488e7d5294f7 13-Feb-2013 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Use SkMWRandom in GLPrograms test.

R=jvanverth@google.com
Review URL: https://codereview.appspot.com/7306097

git-svn-id: http://skia.googlecode.com/svn/trunk@7721 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.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/SkMatrixConvolutionImageFilter.cpp
ef5dbe1cd90fe586f165e54cb6f7608942610793 28-Jan-2013 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Add an origin flag for backend (external) textures. Some textures in WebKit have a topdown orientation, and skia needs to be notified of this, so that they are not drawn upside-down.

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

git-svn-id: http://skia.googlecode.com/svn/trunk@7414 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
8a252f79629b189a03de22cd8ff0312c5bccedd1 22-Jan-2013 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Switch GrEffect::onIsEqual signature back to GrEffect from GrEffectRef.

R=robertphillips@google.com
Review URL: https://codereview.appspot.com/7188046

git-svn-id: http://skia.googlecode.com/svn/trunk@7326 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
6340a41108633ac1ce5941e5cd30538630c4c55b 22-Jan-2013 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Let them eat GrEffectRef.

Changes the remaining existing code that operates on naked GrEffects to GrEffectRef.
Review URL: https://codereview.appspot.com/7124058

git-svn-id: http://skia.googlecode.com/svn/trunk@7321 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
68b58c95384dd6c2fd389a5b4bbf8fc468819454 17-Jan-2013 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Remove default implementation of GrEffect::isEqual. Make GrSingleTextureEffect abstract.
Review URL: https://codereview.appspot.com/7142049

git-svn-id: http://skia.googlecode.com/svn/trunk@7254 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
a1ebbe447d5eab098111eb83580e55f2f5f6faca 16-Jan-2013 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Change some function/vars from EffectPtr to EffectRef to reflect GrEffectPtr->GrEffectRef renaming.



git-svn-id: http://skia.googlecode.com/svn/trunk@7226 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
0ac6af49975c54c2debf41e9200af416ecd2d973 16-Jan-2013 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Wrap GrEffects in GrEffectPtr.

This is the first step towards automatic recycling of scratch resouces in the cache via ref-cnts.

R=robertphillips@google.com
Review URL: https://codereview.appspot.com/7092061

git-svn-id: http://skia.googlecode.com/svn/trunk@7222 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
027c10207a45a9b754047136ea5403b764d9a751 14-Jan-2013 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix a problem in the matrix convolution image filter exposed by https://code.google.com/p/skia/source/detail?r=7152: when offsetting texture coordinates in a GrEffect, take the origin of the source bitmap origin into account, and flip Y coordinates when we need to.

NOTE: this will cause the matrixconvolution GM's to need to be rebaselined (again!).

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

git-svn-id: http://skia.googlecode.com/svn/trunk@7168 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
0263fcd72ee81ccff012bff85dbee89cd524a930 11-Jan-2013 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Implement getConstantColorComponents() for matrix convolution.

R=senorblanco@chromium.org
Review URL: https://codereview.appspot.com/7092047

git-svn-id: http://skia.googlecode.com/svn/trunk@7146 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
0e51577a14f903ffeafa117a75954baeb173ffb9 07-Jan-2013 humper@google.com <humper@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> fix warning from scalar --> int32 conversion

BUG=

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

git-svn-id: http://skia.googlecode.com/svn/trunk@7061 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
528952b5afea0e82bf6db9ef22128533d50ef9e3 29-Nov-2012 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Clean up some Windows compiler warnings.

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

git-svn-id: http://skia.googlecode.com/svn/trunk@6628 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
dbe49f735484f8862e378b63d0a074a301093dd0 05-Nov-2012 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Remove default texture coords / texture matrix
Review URL: https://codereview.appspot.com/6775100

git-svn-id: http://skia.googlecode.com/svn/trunk@6293 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
4187a2fc71e9f72401e5314a1dca41a556096c51 05-Nov-2012 robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Attempt to patch Chrome compiler failures



git-svn-id: http://skia.googlecode.com/svn/trunk@6289 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
17fc651dbe2e0624f6c85fb6e081d28a87d5a08b 02-Nov-2012 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Make all remaining effects use GrGLEffectMatrix

R=robertphillips@google.com
Review URL: https://codereview.appspot.com/6817079

git-svn-id: http://skia.googlecode.com/svn/trunk@6286 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
2eaaefd7e6a58339b3f93333f1e9cc92252cc303 29-Oct-2012 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Pass GrCustomStage to key-generation functions and emitCode().

R=robertphillips@google.com
Review URL: https://codereview.appspot.com/6819046

git-svn-id: http://skia.googlecode.com/svn/branches/gpu_dev@6182 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
22a800a2578564a8b66bd4d9903ef4186c37f35c 26-Oct-2012 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Make a bunch of GrGLEffects derive directly from GrGLEffect rather than GrGLLegacyEffect.
Review URL: https://codereview.appspot.com/6783053

git-svn-id: http://skia.googlecode.com/svn/branches/gpu_dev@6150 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
2d0baded0f45dfde9dc8c25313ff14ea18c0c915 26-Oct-2012 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Make the orientation of a texture accessible from and known by GrSurface.

R=robertphillips@google.com
Review URL: https://codereview.appspot.com/6801044

git-svn-id: http://skia.googlecode.com/svn/branches/gpu_dev@6148 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
28a15fb8d603847949a61657ef5cb73ed9915021 26-Oct-2012 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Make GrGLEffect::setData take GrEffectStage rather than GrEffect.

This allows the coord-change matrix to be communicated to setData(). An accessor for this matrix is also added to GrEffectStage.

R=robertphillips@google.com
Review URL: https://codereview.appspot.com/6779057

git-svn-id: http://skia.googlecode.com/svn/branches/gpu_dev@6143 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
46fba0d79335f17429bb71d87a04d93fb2ee992b 25-Oct-2012 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Rename StageKey and related stuff.

R=robertphillips@google.com
Review URL: https://codereview.appspot.com/6785049

git-svn-id: http://skia.googlecode.com/svn/trunk@6130 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
396e61fe440590744345e0c56970b26ab464591d 25-Oct-2012 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Rename GrProgramStageFactory to GrBackendEffectFactory.
Review URL: https://codereview.appspot.com/6773044

git-svn-id: http://skia.googlecode.com/svn/trunk@6125 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
422e81aeb1f4078367c85efe591c7df8c33874ec 25-Oct-2012 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> GrGLProgramStage Renaming Part 3

s/GLProgramStage/GLEffect
minor whitespace/spelling fixup

R=robertphillips@google.com
Review URL: https://codereview.appspot.com/6767054

git-svn-id: http://skia.googlecode.com/svn/trunk@6095 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
aa60093d0031731573b34c5529bb194f7c4c7dd0 25-Oct-2012 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> GrGLProgramStage Renaming Part 2

s/GrGLLegacyProgramStage/GrGLLegacyEffect
Review URL: https://codereview.appspot.com/6761056

git-svn-id: http://skia.googlecode.com/svn/trunk@6091 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
d698f77c13d97c61109b861eac4d25b14a5de935 25-Oct-2012 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> GrGLProgramStage Renaming Part 1.

Renamed cpp and h
s/GrGLProgramStage/GrGLEffect/
Review URL: https://codereview.appspot.com/6759054

git-svn-id: http://skia.googlecode.com/svn/trunk@6090 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
021fc736f89fddac4f26b3f32f50263ff8fe3279 25-Oct-2012 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> GrCustomStage Renaming Part 5

Stuff found by searching for "stage".

R=robertphillips@google.com
Review URL: https://codereview.appspot.com/6772043

git-svn-id: http://skia.googlecode.com/svn/trunk@6089 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
8ea78d83dc4e8243c16eedf8100a3987c54123fa 24-Oct-2012 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> GrCustomStage Renaming Part 4

Rename a bunch of things found by searching for "custom".
Review URL: https://codereview.appspot.com/6765048

git-svn-id: http://skia.googlecode.com/svn/trunk@6085 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
f271cc7183fe48ac64d2d9a454eb013c91b42d53 24-Oct-2012 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> GrCustomStage Renaming Part 3

Rename all things *CUSTOM_STAGE*, customStage*, and other miscellany

R=robertphillips@google.com
Review URL: https://codereview.appspot.com/6769048

git-svn-id: http://skia.googlecode.com/svn/trunk@6081 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
6f261bed0252e3f3caa595798364e0bf12a2573a 24-Oct-2012 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> GrCustomStage Renaming Part 2

GrSamplerState member rename
GrCustomStageUnitTest rename
some comment updates
Review URL: https://codereview.appspot.com/6771043

git-svn-id: http://skia.googlecode.com/svn/trunk@6078 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
a469c28c3c16214733a25201a286970f57b3d944 24-Oct-2012 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> CustomStage Renaming Part 1

Search and replace:
GrCustomStage->GrEffect
GrCustomStageTestFactory->GrEffectTestFactory

renamed the cpp/h files from customStage->effect

reordered gypi, #includes, forward decls to maintain alphabetical sort.

manually fixed up some whitespace and linewraps

deleted a commented out #include

R=robertphillips@google.com
Review URL: https://codereview.appspot.com/6758046

git-svn-id: http://skia.googlecode.com/svn/trunk@6076 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
374e75956e7a56bbbd2da5509f9c4117512515d2 23-Oct-2012 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Combine the emit functions in GrGLProgramStage.

R=robertphillips@google.com
Review URL: https://codereview.appspot.com/6741064

git-svn-id: http://skia.googlecode.com/svn/trunk@6057 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
706f66831a575bdc2b1ab1331b48b793cd487356 23-Oct-2012 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Reland r6330 thru r6333 but do without enabling GL_ARB_fragment_coord_conventions on Intel GPUs.



git-svn-id: http://skia.googlecode.com/svn/trunk@6048 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
d3353646c31ccb90cc43727ef0fa7869b4e4fe07 22-Oct-2012 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert r6330 thru 6333 while we figure out what to do about Intel bots (possible driver bug).

git-svn-id: http://skia.googlecode.com/svn/trunk@6037 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
159d42b546f94fdc5972f3fbdfde9fd8a8735953 22-Oct-2012 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Remove two params from GrGLProgramStage::setData that are no longer necessary.

R=senorblanco@chromium.org
Review URL: https://codereview.appspot.com/6744062

git-svn-id: http://skia.googlecode.com/svn/trunk@6031 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
dda28c9bde2a34b98e1383532c210270dacb7ca8 05-Oct-2012 skia.committer@gmail.com <skia.committer@gmail.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Sanitizing source files in Skia_Periodic_House_Keeping

git-svn-id: http://skia.googlecode.com/svn/trunk@5821 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
9f7827fcd9268a6f3066dd05117293950e467720 04-Oct-2012 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Build fix: work around what appears to be an Intel GLSL driver bug. Unreviewed.



git-svn-id: http://skia.googlecode.com/svn/trunk@5812 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
3bc16c8bc1ecb9ac4450f58093cc9e3edb8a50b8 04-Oct-2012 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Implement GPU path for matrix convolution. Note that when not convolving alpha,
the premultiplying is done less efficiently than in the raster path: it's
done on each texture access, rather than as a pre-processing pass. This was
so I could do the filter as a single custom stage; will try the optimization
separately.

This implementation gives a ~30X speedup on the GPU results for the
matrixconvolution bench (~10X due to the GPU, and ~3X due to texture
uploads/readback removal).

Note: this changes the matrixconvolution for the software path as well, so
it will likely break the bots until that test is rebaselined.

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



git-svn-id: http://skia.googlecode.com/svn/trunk@5809 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
8640d5024d57da5508bdf7585849e3b1f1cb365b 25-Sep-2012 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> This patch adds support for optional processing of the alpha channel in
the matrix convolution filter. Test cases are added to the GM and the
bench.

NOTE: This will require rebaselining the matrixconvolution GM, so it will
likely turn the bots red until that is done.

https://codereview.appspot.com/6547049/



git-svn-id: http://skia.googlecode.com/svn/trunk@5661 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
a0c2bc24381fea063008f9c8823756eb020603b3 21-Sep-2012 scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Make flattenables no longer depend on global static initializers.

Instead, force all builds to call InitializeFlattenables.

Remove the make_debugger script, which was created to force
rebuilding without global static initializers so that all flattenables
would be linked. It is no longer necessary since all flattenables
will be linked thanks to InitializeFlattenables, which now can (and
must) be called when global static initializers are turned on.

BUG=https://code.google.com/p/skia/issues/detail?id=903
BUG=https://code.google.com/p/skia/issues/detail?id=902

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

git-svn-id: http://skia.googlecode.com/svn/trunk@5642 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
cc9471c36d3967270f7eb26f8b53ce0f17bc9fbb 20-Sep-2012 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix premul alpha problems w/matrix convolution filter, and re-enable the bench.

http://codereview.appspot.com/6541043/



git-svn-id: http://skia.googlecode.com/svn/trunk@5610 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
b4ca9df976951adf632388371f9a8a9219d93014 20-Sep-2012 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Yet another speculative Android fix. Unreviewed.



git-svn-id: http://skia.googlecode.com/svn/trunk@5600 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
bc55a3c1c11c99e6feecaa8ba7bd700840622949 20-Sep-2012 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Speculative fix for Android GMs. Unreviewed.



git-svn-id: http://skia.googlecode.com/svn/trunk@5598 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/effects/SkMatrixConvolutionImageFilter.cpp
5faa2dc266ec933b3961f985e5718236f1ecbe47 18-Sep-2012 senorblanco@chromium.org <senorblanco@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Implements a matrix convolution filter (raster path only). The filtering loop
is templated on the tiling mode for speed: interior pixels are unconditionally
fetched; border pixels apply the appropriate tiling mode before fetching. It
handles target, bias, divisor (as gain), and edge modes (named to be more
skia-like). It does not handle the "preserveAlpha" semantics of
feConvolveMatrix, nor "kernelUnitLength".



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