aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects
Commit message (Collapse)AuthorAge
* Allow negative values in SkBlurImageFilter sigma.Gravatar senorblanco2014-09-09
| | | | | | | | | | | | | | | | | | | | | There are two ways negative sigma values may occur: in the original filter parameters, or after multiplication by a negative scaling CTM. The former case is invalid according to the spec, so we continue to check for it at validation time. In the latter case, we should interpret it as a horizontal flip in the kernel pixel access, and simply take the absolute value (since the filter kernel is symmetric). Also refactor all this logic into a single place for the CPU, GPU and onFilterBounds() paths. BUG=https://code.google.com/p/chromium/issues/detail?id=409602 R=sugoi@google.com, reed@google.com, sugoi@chromium.org Author: senorblanco@chromium.org Review URL: https://codereview.chromium.org/555603002
* "NULL !=" = NULLGravatar bsalomon2014-09-05
| | | | | | | | R=reed@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/544233002
* Hide fields in SkImageInfoGravatar reed2014-09-03
| | | | | | | | | R=rmistry@google.com TBR=bsalomon Author: reed@google.com Review URL: https://codereview.chromium.org/536003002
* make allocPixels throw on failureGravatar reed2014-09-02
| | | | | | | | | BUG=skia: R=mtklein@google.com, fmalita@google.com, fmalita@chromium.org Author: reed@google.com Review URL: https://codereview.chromium.org/510423005
* Move MakeDivByTextureWHMatrix to GrCoordTransformGravatar bsalomon2014-08-29
| | | | | | | | R=robertphillips@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/522873005
* Try out scalar picture sizesGravatar robertphillips2014-08-29
| | | | | | | | | | This paves the way for removing the 'fTile' parameter from SkPictureShader (although that should be a different CL). If we like this we could also move to providing an entire cull SkRect. R=reed@google.com, mtklein@google.com, fmalita@google.com, fmalita@chromium.org Author: robertphillips@google.com Review URL: https://codereview.chromium.org/513983002
* Reimplement deserialization of SkImageFilter's uniqueID.Gravatar senorblanco2014-08-26
| | | | | | | | | | | | | | | | | | | | | | | 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
* Fix recursive computation of filter bounds for drop shadow,Gravatar senorblanco2014-08-25
| | | | | | | | | | | | | | | | | | | | | | morphology, blur. [Reland with fixed tests.] Because we're computing "backwards" from a clip rect of destination pixels to be filled to the required source pixels, we should use tail recursion rather than head recursion in onFilterBounds(). This actually only makes a difference for drop-shadow, where the computation is non-commutative. Blur and morphology commute, but I moved them to tail recursion anyway for clarity (so all onFilterBounds use tail recursion). BUG=skia: R=bsalomon@google.com Author: senorblanco@chromium.org Review URL: https://codereview.chromium.org/481273005
* Revert of Fix recursive computation of filter bounds for drop shadow, ↵Gravatar djsollen2014-08-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (patchset #1 of https://codereview.chromium.org/481273005/) Reason for revert: This CL is currently breaking the Win7 and Win8 bots on some of the new tests (in DM). Original issue's description: > Fix recursive computation of filter bounds for drop shadow, > morphology, blur. > > Because we're computing "backwards" from a clip rect of destination > pixels to be filled to the required source pixels, we should use tail > recursion rather than head recursion in onFilterBounds(). > > This actually only makes a difference for drop-shadow, where > the computation is non-commutative. Blur and morphology commute, but I > moved them to tail recursion anyway for clarity (so all onFilterBounds > use tail recursion). > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/28648fe4a69b0cee8df42b5966e4e645c3aabefb R=bsalomon@google.com, senorblanco@chromium.org TBR=bsalomon@google.com, senorblanco@chromium.org NOTREECHECKS=true NOTRY=true BUG=skia: Author: djsollen@google.com Review URL: https://codereview.chromium.org/504773003
* Fix recursive computation of filter bounds for drop shadow,Gravatar senorblanco2014-08-25
| | | | | | | | | | | | | | | | | | | | morphology, blur. Because we're computing "backwards" from a clip rect of destination pixels to be filled to the required source pixels, we should use tail recursion rather than head recursion in onFilterBounds(). This actually only makes a difference for drop-shadow, where the computation is non-commutative. Blur and morphology commute, but I moved them to tail recursion anyway for clarity (so all onFilterBounds use tail recursion). BUG=skia: R=bsalomon@google.com Author: senorblanco@chromium.org Review URL: https://codereview.chromium.org/481273005
* Don't leak the shader by reffing twice in SkRectShaderImageFilter.Gravatar mtklein2014-08-22
| | | | | | | | | BUG=skia: R=bsalomon@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/501563002
* extend SkShader to report a luminance-color to be used for gamma correctionGravatar reed2014-08-22
| | | | | | | | | BUG=skia:590 R=bungeman@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/492963002
* fix leak in new createprocGravatar reed2014-08-22
| | | | | | | | | BUG=skia: R=caryclark@google.com, mike@reedtribe.org, mtklein@google.com Author: reed@chromium.org Review URL: https://codereview.chromium.org/461253007
* Initial refactor of shaderbuilder to prepare for geometry shadersGravatar joshualitt2014-08-21
| | | | | | | | | | | gitignore for eclipse BUG=skia: R=bsalomon@google.com, bsalomon@chromium.org Author: joshualitt@chromium.org Review URL: https://codereview.chromium.org/491673002
* remember to init fOrigPos in legacy constructorGravatar reed2014-08-21
| | | | | | | | | NOTREECHECKS=True R=caryclark@google.com, mtklein@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/496833002
* Does this fix things?Gravatar mtklein2014-08-21
| | | | | | | | | | | NOTREECHECKS=true CQ_EXTRA_TRYBOTS=tryserver.skia:Test-Win7-ShuttleA-HD2000-x86-Debug-Trybot BUG=skia: R=mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/492343002
* rename gradients private BitmapCache to GradientBitmapCacheGravatar reed2014-08-21
| | | | | | | | | R=caryclark@google.com NOTREECHECKS=True Author: reed@google.com Review URL: https://codereview.chromium.org/474983005
* Simplify flattening to just write enough to call the ↵Gravatar reed2014-08-21
| | | | | | | | | | | | | | | | | | 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
* Check all scratch texture allocations for image filters.Gravatar senorblanco2014-08-15
| | | | | | | | | | BUG=403677 R=bsalomon@google.com NOTREECHECKS=true Author: senorblanco@chromium.org Review URL: https://codereview.chromium.org/473283002
* remove SkStippleMaskFilter - no external clientsGravatar reed2014-08-12
| | | | | | | | TBR= Author: reed@google.com Review URL: https://codereview.chromium.org/462013002
* 2D kernel initial wiring for GuassianGravatar joshualitt2014-08-11
| | | | | | | | | BUG=skia: R=senorblanco@chromium.org, bsalomon@chromium.org, bsalomon@google.com Author: joshualitt@chromium.org Review URL: https://codereview.chromium.org/418223009
* add localMatrix to gradient DescriptorGravatar reed2014-08-11
| | | | | | | | | | | | this consolidation will also help transisition to new flattening pattern, where we want to have a flatten/unflatten method on all of the common gradient params (i.e. Descriptor). BUG=skia: R=egdaniel@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/461643002
* Intersect SkPictureImageFilter bounds against clip bounds.Gravatar senorblanco2014-07-30
| | | | | | | | | | | | | | Intersect SkPictureImageFilter bounds against clip bounds to avoid unnecessary processing. This is how the other filters work (via applyCropRect()), but SkPictureImageFilter maintains its own crop. BUG=skia: R=bsalomon@google.com Author: senorblanco@chromium.org Review URL: https://codereview.chromium.org/428263003
* Rename GrGLUniformManager to GrGLProgramDataManagerGravatar kkinnunen2014-07-30
| | | | | | | | | | | | | Rename GrGLUniformManager to GrGLProgramDataManager in anticipation that the class would be used to manage shader resources that are not uniforms. This is needed in order to implement NVPR on GLES. R=bsalomon@google.com Author: kkinnunen@nvidia.com Review URL: https://codereview.chromium.org/365853002
* Adding repeat mode to texture domainGravatar joshualitt2014-07-29
| | | | | | | | | 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
* Fix thread unsafe mutex initialization.Gravatar bungeman2014-07-25
| | | | | | | | | BUG=skia:2779 R=robertphillips@google.com, mtklein@google.com, reed@android.com, bsalomon@google.com Author: bungeman@google.com Review URL: https://codereview.chromium.org/419113002
* Remove the single-sigma version of SkDropShadowImageFilter::Create().Gravatar senorblanco2014-07-22
| | | | | | | | | | | It's no longer used in Chrome. BUG=skia: R=bsalomon@google.com Author: senorblanco@chromium.org Review URL: https://codereview.chromium.org/407203002
* Initial change to move 2D kernel to its own file.Gravatar joshualitt2014-07-22
| | | | | | | | | BUG=skia: R=bsalomon@chromium.org, senorblanco@chromium.org, bsalomon@google.com Author: joshualitt@chromium.org Review URL: https://codereview.chromium.org/379253003
* Allow GrGLEffects to produce variable length keys.Gravatar bsalomon2014-07-21
| | | | | | | | R=robertphillips@google.com, jvanverth@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/385713005
* Remove use of SK_SUPPORT_LEGACY_LAYERRASTERIZER_API.Gravatar dominikg2014-07-21
| | | | | | | | | | | | Mozilla have removed any uses of the legacy API from their Moz2D code. Since they were the last users we know of, we can remove the legacy API. BUG=skia:2187 R=scroggo@google.com, reed@google.com Author: dominikg@chromium.org Review URL: https://codereview.chromium.org/402613003
* Make SkPictureShader and SkPictureImageFilter use const SkPicturesGravatar robertphillips2014-07-14
| | | | | | | | | R=mtklein@google.com, reed@google.com TBR=reed@google.com Author: robertphillips@google.com Review URL: https://codereview.chromium.org/390023002
* This moves us towards variable length effect keys. The overall program key ↵Gravatar bsalomon2014-07-11
| | | | | | | | | | 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
* Always initialize SkDashPathEffect fields.Gravatar mtklein2014-07-09
| | | | | | | | | | | | | | | | | | | SkDashPathEffect is flattened into a hash key as part of the old-and-busted SkPicture paint deduping code. If all its fields aren't intialized, this hash will be based on uninitialized data. This means the hash won't be deterministic, and worse, Valgrind and MSAN will make us feel bad. An alternative to this is to have SkDashPath::CalcDashParameters always guarantee it writes something to all its output parameters, even when the dash intervals make no sense. I like it being dumb and its users defensive, but could go either way. BUG=391001 R=reed@google.com, mtklein@google.com Author: mtklein@chromium.org Review URL: https://codereview.chromium.org/379813004
* Goodbye GrEffectRef.Gravatar bsalomon2014-07-08
| | | | | | | | | | 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
* Clean up SkImageFilter constructors.Gravatar senorblanco2014-07-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove GrEffect::CreateEffectRef and GrEffect::AutoEffectRef.Gravatar bsalomon2014-07-08
| | | | | | | | R=robertphillips@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/371103003
* Make GrDrawState and GrPaint take GrEffect* instead of GrEffectRef*.Gravatar bsalomon2014-07-08
| | | | | | | | | | | | | | Make Sk-effect virtuals produce GrEffect* rather than GrEffectRef* Make GrEffectRef a typedef for GrEffect. Committed: https://skia.googlesource.com/skia/+/2011fe9cdfa63b83489a146cea6a724cede352c8 R=robertphillips@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/377503004
* Revert of Make GrDrawState and GrPaint take GrEffect* instead of ↵Gravatar reed2014-07-07
| | | | | | | | | | | | | | | | | | | | | | | | | GrEffectRef*. (https://codereview.chromium.org/377503004/) Reason for revert: broke linux builders Original issue's description: > Make GrDrawState and GrPaint take GrEffect* instead of GrEffectRef*. > > Make Sk-effect virtuals produce GrEffect* rather than GrEffectRef* > > Make GrEffectRef a typedef for GrEffect. > > Committed: https://skia.googlesource.com/skia/+/2011fe9cdfa63b83489a146cea6a724cede352c8 R=robertphillips@google.com, bsalomon@google.com TBR=bsalomon@google.com, robertphillips@google.com NOTREECHECKS=true NOTRY=true Author: reed@google.com Review URL: https://codereview.chromium.org/372053003
* Make GrDrawState and GrPaint take GrEffect* instead of GrEffectRef*.Gravatar bsalomon2014-07-07
| | | | | | | | | | | | Make Sk-effect virtuals produce GrEffect* rather than GrEffectRef* Make GrEffectRef a typedef for GrEffect. R=robertphillips@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/377503004
* Fix SkColorFilterImageFilter matrix optimization.Gravatar senorblanco2014-07-03
| | | | | | | | | | | | | The order of matrices passed to multiplication was wrong (apparently, this optimization was only being tested with matrices which commute). See Chrome bug http://crbug.com/378362 R=sugoi@chromium.org Author: senorblanco@chromium.org Review URL: https://codereview.chromium.org/371523002
* Adding 64 bit checksGravatar sugoi2014-07-03
| | | | | | | | | | | | | Added a few more checks to avoid overflowing 32 bit sizes while computing convolutions. I also changed a dangerously misleading INHERITED typedef. BUG=389570 R=senorblanco@google.com, senorblanco@chromium.org Author: sugoi@chromium.org Review URL: https://codereview.chromium.org/361403006
* move SkChecksum and SkEmptyShader to privateGravatar reed2014-07-03
| | | | | | | | TBR=reed@google.com Author: reed@chromium.org Review URL: https://codereview.chromium.org/366133002
* Make perlin noise do CTM-correct scaling.Gravatar senorblanco2014-06-27
| | | | | | | | | | | | | | | | When drawing perlin noise, generate noise at the resolution determined by CTM, not by the resolution at construction time. This required moving the generation of PaintingData to getContext() and asNewEffect() for the raster and GPU paths, respectively. It also required adjusting the matrices used during rendering to be translate-only. R=sugoi@chromium.org, bsalomon@google.com Author: senorblanco@chromium.org Review URL: https://codereview.chromium.org/358903002
* Remove SkBicubicImageFilter, and all related tests.Gravatar senorblanco2014-06-25
| | | | | | | | | | | | | Now that we have SkResizeImageFilter, and the bicubic resizing is part of skia proper, there's no need for a specialized image filter. BUG=skia: R=bsalomon@google.com Author: senorblanco@chromium.org Review URL: https://codereview.chromium.org/357793002
* Make GrGLShaderBuilder::fragmentPosition() return a vec4, with 1.0 as the zw ↵Gravatar bsalomon2014-06-24
| | | | | | | | | | | | | | components when in the y-flip case. This works around an Adreno driver bug. Revert "Stop referencing gl_FragCoord z and w components." This reverts commit 160a52ba217012ed73c240f6d67b3bbf2b4879d6. R=jvanverth@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/354663002
* Stop referencing gl_FragCoord z and w components.Gravatar bsalomon2014-06-20
| | | | | | | | | | This fixes an Adreno driver bug where GL programs fail to link if the FS refers to these components of gl_FragCoord. R=jvanverth@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/345083002
* Revert of remove guarded code - there are no more callers ↵Gravatar reed2014-06-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (https://codereview.chromium.org/343783002/) Reason for revert: webkit still uses getTotalClip -- need to find where they define the guard. ../../skia/ext/skia_utils_mac.mm:400:42: error: no member named 'getTotalClip' in 'SkCanvas' const SkRegion& clipRgn = canvas_->getTotalClip(); ~~~~~~~ ^ Original issue's description: > remove guarded code - there are no more callers > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/c5d5cf9489977aa6fba077d1dc242029fbb4859e R=scroggo@google.com, reed@google.com TBR=reed@google.com, scroggo@google.com NOTREECHECKS=true NOTRY=true BUG=skia: Author: reed@chromium.org Review URL: https://codereview.chromium.org/342843002
* remove guarded code - there are no more callersGravatar reed2014-06-18
| | | | | | | | | BUG=skia: R=scroggo@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/343783002
* Fifth attempt to land faster rect blur. Remove unnecessary conditionals ↵Gravatar humper2014-06-17
| | | | | | | | | | | | | | | from the shader. approved over in https://codereview.chromium.org/331863006/; reuploading because it had the wrong base url BUG=skia:2095 R=bsalomon@google.com TBR=bsalomon Author: humper@google.com Review URL: https://codereview.chromium.org/341543005
* Perlin noise cleanup.Gravatar senorblanco2014-06-16
| | | | | | | | | | | Remove Simplex noise implementation and now-redundant base classes. BUG=skia: R=sugoi@chromium.org, sugoi@google.com, reed@google.com Author: senorblanco@chromium.org Review URL: https://codereview.chromium.org/336043002