aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/effects
Commit message (Collapse)AuthorAge
* Code cleanup following recapture of skpsGravatar robertphillips@google.com2013-12-03
| | | | | | | | https://codereview.chromium.org/88233003/ git-svn-id: http://skia.googlecode.com/svn/trunk@12472 2bbb7eff-a529-9590-31e7-b0007b416f81
* Reverting r12427Gravatar rmistry@google.com2013-12-02
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@12428 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Housekeeper-NightlyGravatar skia.committer@gmail.com2013-12-02
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@12427 2bbb7eff-a529-9590-31e7-b0007b416f81
* Enhance SkDropShadowImageFilter to support separate X & Y sigmas, and crop ↵Gravatar senorblanco@chromium.org2013-11-26
| | | | | | | | | | | | | | rect. This required a new flavour of the constructor. This is driven by the feDropShadow filter effect in SVG, which unlike the shorthand version accepts separate X & Y sigmas. Covered by new GM dropshadowimagefilter. R=reed@google.com Review URL: https://codereview.chromium.org/88243004 git-svn-id: http://skia.googlecode.com/svn/trunk@12401 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "Revert "remove kA1_Config, as it is no longer supported""Gravatar commit-bot@chromium.org2013-11-26
| | | | | | | | | | | | | This reverts commit 36d712f2d4c5c79719280ad95523e6aaa88b068e. BUG= R=rmistry@google.com, mtklein@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/86483002 git-svn-id: http://skia.googlecode.com/svn/trunk@12392 2bbb7eff-a529-9590-31e7-b0007b416f81
* Adding more validationGravatar commit-bot@chromium.org2013-11-25
| | | | | | | | | | | | | | | | - 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
* Revert "remove kA1_Config, as it is no longer supported"Gravatar reed@google.com2013-11-25
| | | | | | This reverts commit 2d72d8b242eac6e9d30228f5b0a407236491c369. git-svn-id: http://skia.googlecode.com/svn/trunk@12387 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove SkFloatToScalar macroGravatar commit-bot@chromium.org2013-11-25
| | | | | | | | | | | BUG= R=reed@google.com, djsollen@google.com Author: caryclark@google.com Review URL: https://codereview.chromium.org/85463005 git-svn-id: http://skia.googlecode.com/svn/trunk@12385 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove kA1_Config, as it is no longer supportedGravatar reed@google.com2013-11-25
| | | | | | | | | BUG= R=djsollen@google.com Review URL: https://codereview.chromium.org/83093005 git-svn-id: http://skia.googlecode.com/svn/trunk@12384 2bbb7eff-a529-9590-31e7-b0007b416f81
* fix general-pespective for conical gradient bug=1744Gravatar mike@reedtribe.org2013-11-14
| | | | | | | | | BUG= R=edisonn@google.com Review URL: https://codereview.chromium.org/71303003 git-svn-id: http://skia.googlecode.com/svn/trunk@12299 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove some now-unused #ifdefs.Gravatar senorblanco@chromium.org2013-11-12
| | | | | | | | R=mtklein@google.com, mtklein, reed@google.com Review URL: https://codereview.chromium.org/68473003 git-svn-id: http://skia.googlecode.com/svn/trunk@12246 2bbb7eff-a529-9590-31e7-b0007b416f81
* Implement a speedup for Y-only blurs by transposing.Gravatar senorblanco@chromium.org2013-11-11
| | | | | | | | | R=mtklein@google.com, mtklein, reed@google.com BUG= Review URL: https://codereview.chromium.org/66413007 git-svn-id: http://skia.googlecode.com/svn/trunk@12227 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix memory leak in filterRRectToNineGravatar robertphillips@google.com2013-11-11
| | | | | | | | https://codereview.chromium.org/65723005/ git-svn-id: http://skia.googlecode.com/svn/trunk@12222 2bbb7eff-a529-9590-31e7-b0007b416f81
* SSE2 implementation of RGBA box blurs. This yields ~2X perf improvement on ↵Gravatar senorblanco@chromium.org2013-11-08
| | | | | | | | | | Xeon ES-2690. R=mtklein@google.com Review URL: https://codereview.chromium.org/61643011 git-svn-id: http://skia.googlecode.com/svn/trunk@12204 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add ability to ninepatch blurred rounded rectangleGravatar scroggo@google.com2013-11-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Speed up drawing large blurry round rectangles by converting them to nine patches. SkDraw: Add drawRRect. SkBitmapDevice: Call SkDraw::drawRRect instead of converting SkRRect to an SkPath. SkMaskFilter/SkBlurMaskFilter: Create a nine patch of a blurred round rect and draw it instead of drawing the entire thing. SkPDFDevice: Override drawRRect to perform the old behavior in SkBitmapDevice::drawRect. Depends on https://codereview.chromium.org/52703003 Tests are in https://codereview.chromium.org/52793005 BUG=https://b.corp.google.com/issue?id=11174385 R=reed@google.com, robertphillips@google.com Review URL: https://codereview.chromium.org/48623006 git-svn-id: http://skia.googlecode.com/svn/trunk@12198 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add GM to verify removal of 32767 limit in ↵Gravatar robertphillips@google.com2013-11-07
| | | | | | | | | | SkBlurMaskFilter::filterRectsToNine is okay https://codereview.chromium.org/60513013/ git-svn-id: http://skia.googlecode.com/svn/trunk@12181 2bbb7eff-a529-9590-31e7-b0007b416f81
* Added support for Chrome's gpu command buffer extension BindUniformLocation.Gravatar commit-bot@chromium.org2013-11-07
| | | | | | | | | | 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
* Implement the y-transpose optimization in image (RGBA) blurs. This gives ↵Gravatar senorblanco@chromium.org2013-11-07
| | | | | | | | | | ~38% performance improvement on my Linux box. Also unify the box blur functions with a template. R=mtklein@google.com, mtklein, reed@google.com Review URL: https://codereview.chromium.org/59133006 git-svn-id: http://skia.googlecode.com/svn/trunk@12171 2bbb7eff-a529-9590-31e7-b0007b416f81
* Perlin issue fixedGravatar commit-bot@chromium.org2013-11-06
| | | | | | | | | | | BUG=skia:1799 R=sugoi@chromium.org, sugoi@google.com, senorblanco@chromium.org Author: bsalomon@google.com Review URL: https://codereview.chromium.org/59173005 git-svn-id: http://skia.googlecode.com/svn/trunk@12150 2bbb7eff-a529-9590-31e7-b0007b416f81
* Check that Mode is valid for ModeColorFilterEffectGravatar commit-bot@chromium.org2013-11-05
| | | | | | | | | | R=robertphillips@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/53983005 git-svn-id: http://skia.googlecode.com/svn/trunk@12131 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add SK_PREFETCH and use in SkBlurImageFilter.Gravatar commit-bot@chromium.org2013-11-05
| | | | | | | | | | | | | | | Relative speed is 1.2-1.6x on desktop, 1.0-1.2x on Nexus 4. (Division remains the bottleneck, now more so.) BUG= R=senorblanco@google.com, reed@google.com, senorblanco@chromium.org Author: mtklein@google.com Review URL: https://codereview.chromium.org/57823003 git-svn-id: http://skia.googlecode.com/svn/trunk@12129 2bbb7eff-a529-9590-31e7-b0007b416f81
* Change SkBlurImageFilter to use fixed-point division. Yields ~1.8X speedup onGravatar senorblanco@chromium.org2013-11-04
| | | | | | | | | | | | | MacBookPro. Note: this will require defining SK_DISABLE_BLUR_DIVISION_OPTIMIZATION in Chrome, a la https://codereview.chromium.org/49973005. R=mtklein@google.com Review URL: https://codereview.chromium.org/57513002 git-svn-id: http://skia.googlecode.com/svn/trunk@12113 2bbb7eff-a529-9590-31e7-b0007b416f81
* Adding a way to disable SkOffsetImageFilter's optimized path in blink/chromeGravatar commit-bot@chromium.org2013-11-01
| | | | | | | | | | | BUG= R=senorblanco@chromium.org, reed@google.com, sugoi@google.com Author: sugoi@chromium.org Review URL: https://codereview.chromium.org/54543005 git-svn-id: http://skia.googlecode.com/svn/trunk@12075 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add can-ignore-rect hint to clear callGravatar robertphillips@google.com2013-10-31
| | | | | | | | https://codereview.chromium.org/53823003/ git-svn-id: http://skia.googlecode.com/svn/trunk@12064 2bbb7eff-a529-9590-31e7-b0007b416f81
* Adding size parameter to read array functionsGravatar commit-bot@chromium.org2013-10-31
| | | | | | | | | | | | | | | | | | | 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
* Revert "Revert "add SK_ATTR_DEPRECATED -- will need to disable for chrome, ↵Gravatar reed@google.com2013-10-31
| | | | | | | | | | | | since it triggers a warning"" This reverts commit 1e787c38fa71f2a21fd728f1b1d620b9b09b0d3d. BUG= Review URL: https://codereview.chromium.org/54603004 git-svn-id: http://skia.googlecode.com/svn/trunk@12057 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it ↵Gravatar reed@google.com2013-10-31
| | | | | | | | triggers a warning" This reverts commit 1d22c4aaf9d8f053f25194a1ed74b137bfb19497. git-svn-id: http://skia.googlecode.com/svn/trunk@12056 2bbb7eff-a529-9590-31e7-b0007b416f81
* add SK_ATTR_DEPRECATED -- will need to disable for chrome, since it triggers ↵Gravatar reed@google.com2013-10-31
| | | | | | | | | | | a warning BUG= R=robertphillips@google.com, senorblanco@chromium.org, vandebo@chromium.org Review URL: https://codereview.chromium.org/51033004 git-svn-id: http://skia.googlecode.com/svn/trunk@12055 2bbb7eff-a529-9590-31e7-b0007b416f81
* Implement SSE2-based implementations of the morphology filters (dilate & ↵Gravatar senorblanco@chromium.org2013-10-30
| | | | | | | | | | | | erode). This gives a 3-5X speedup over the naive implementation, and also mitigates a timing-based security attack in Chrome (https://code.google.com/p/chromium/issues/detail?id=251711). NOTE: this will require a corresponding GYP change on the Skia roll into Chrome: https://codereview.chromium.org/52453004/ R=mtklein@google.com, reed@google.com Review URL: https://codereview.chromium.org/52603004 git-svn-id: http://skia.googlecode.com/svn/trunk@12038 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Housekeeper-NightlyGravatar skia.committer@gmail.com2013-10-30
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@12013 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix bug in erosion filteringGravatar robertphillips@google.com2013-10-29
| | | | | | | | https://codereview.chromium.org/50813002/ git-svn-id: http://skia.googlecode.com/svn/trunk@11996 2bbb7eff-a529-9590-31e7-b0007b416f81
* Minor changesGravatar robertphillips@google.com2013-10-24
| | | | | | | | https://codereview.chromium.org/39973004/ git-svn-id: http://skia.googlecode.com/svn/trunk@11940 2bbb7eff-a529-9590-31e7-b0007b416f81
* Always create an instance when testing GrEffects for SkXfermode and ↵Gravatar commit-bot@chromium.org2013-10-24
| | | | | | | | | | | | | | | | | | SkArithmeticMode Previously the TestCreate methods of the effects would create a static instance and return that for all invocations. This is probably a copy-paste error going back to initial TestCreate method in r8449. At that time, the effect was always the same and thus static usage made sense. R=bsalomon@google.com, senorblanco@google.com Author: kkinnunen@nvidia.com Review URL: https://codereview.chromium.org/39393002 git-svn-id: http://skia.googlecode.com/svn/trunk@11939 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix ModeColorFilterEffect assert during GLProgramsTestGravatar commit-bot@chromium.org2013-10-24
| | | | | | | | | | | | | | | | | | Select random filter mode for the test-case until the mode is not Dst. SkModeColorFilter with Dst mode will not create a ModeColorFilterEffect, and thus the case is not implemented. Also changes it so that each call to ModeColorFilterEffect::TestCreate creates a new GrEffect. Previously only one static effect was ever created, due to copy-paste error. R=bsalomon@google.com Author: kkinnunen@nvidia.com Review URL: https://codereview.chromium.org/39403002 git-svn-id: http://skia.googlecode.com/svn/trunk@11938 2bbb7eff-a529-9590-31e7-b0007b416f81
* Split up SkXfermode::asNewEffectOrCoeff() into asNewEffect(), asCoeff().Gravatar senorblanco@chromium.org2013-10-23
| | | | | | | | R=bsalomon@google.com Review URL: https://codereview.chromium.org/37593002 git-svn-id: http://skia.googlecode.com/svn/trunk@11926 2bbb7eff-a529-9590-31e7-b0007b416f81
* Follow up to serialization validation codeGravatar commit-bot@chromium.org2013-10-23
| | | | | | | | | | | | | | | | | 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
* Initial error handling codeGravatar commit-bot@chromium.org2013-10-23
| | | | | | | | | | | | | | | | 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
* Lighting filter uses input on raster pathGravatar commit-bot@chromium.org2013-10-23
| | | | | | | | | | | BUG= R=senorblanco@chromium.org Author: sugoi@chromium.org Review URL: https://codereview.chromium.org/35703002 git-svn-id: http://skia.googlecode.com/svn/trunk@11918 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove GrContext from SkXfermode::[Aa]sNewEffectOrCoeff() and all subclasses,Gravatar senorblanco@chromium.org2013-10-23
| | | | | | | | | | since it's unused. R=bsalomon@google.com Review URL: https://codereview.chromium.org/31853003 git-svn-id: http://skia.googlecode.com/svn/trunk@11913 2bbb7eff-a529-9590-31e7-b0007b416f81
* Implement SkColorFilter as a GrGLEffectGravatar commit-bot@chromium.org2013-10-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Magnifier gpu path fixGravatar commit-bot@chromium.org2013-10-21
| | | | | | | | | | | | | The y axis was inverted for the offset, which should have been computed on the other side of the magnifying rectangle. BUG= R=bsalomon@google.com, senorblanco@google.com, senorblanco@chromium.org Author: sugoi@chromium.org Review URL: https://codereview.chromium.org/28273005 git-svn-id: http://skia.googlecode.com/svn/trunk@11883 2bbb7eff-a529-9590-31e7-b0007b416f81
* Reverting revert of r11862 (Constify SkFlattenable::getFactory()) or ↵Gravatar robertphillips@google.com2013-10-21
| | | | | | reverting r11871. git-svn-id: http://skia.googlecode.com/svn/trunk@11876 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix for cropped matrix convolution for BottomLeft render targets.Gravatar senorblanco@chromium.org2013-10-20
| | | | | | | | 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
* Reverted due to Chromium compilation failures. Please see:Gravatar robertphillips@google.com2013-10-20
| | | | | | | | https://codereview.chromium.org/30973002/ git-svn-id: http://skia.googlecode.com/svn/trunk@11871 2bbb7eff-a529-9590-31e7-b0007b416f81
* Implement crop rect support for SkMatrixConvolutionImageFilter.Gravatar senorblanco@chromium.org2013-10-18
| | | | | | | | 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
* Constify SkFlattenable::getFactory().Gravatar commit-bot@chromium.org2013-10-18
| | | | | | | | | | | | | | This allows us to also constify the argument of SkFlattenableWriteBuffer::writeFlattenable() - which I've recently found myself const-casting for no apparent good reason. R=bungeman@google.com, mtklein@google.com, reed@google.com Author: fmalita@chromium.org Review URL: https://codereview.chromium.org/29143005 git-svn-id: http://skia.googlecode.com/svn/trunk@11862 2bbb7eff-a529-9590-31e7-b0007b416f81
* Make SkImageFilter::asNewEffect() (and all derived-class overrides) protected.Gravatar senorblanco@chromium.org2013-10-17
| | | | | | | | R=bsalomon@google.com, bsalomon Review URL: https://codereview.chromium.org/26937006 git-svn-id: http://skia.googlecode.com/svn/trunk@11847 2bbb7eff-a529-9590-31e7-b0007b416f81
* Clear out SK_SCALAR_IS_FLOAT from SkRadialGradient, and merge the logic for ↵Gravatar commit-bot@chromium.org2013-10-16
| | | | | | | | | | | | | | | radial_mirror and radial_repeat. New radial/repeated bench is 10-20x faster now using float instead of fixed; the rest are unaffected. BUG= R=reed@google.com Author: mtklein@google.com Review URL: https://codereview.chromium.org/26410003 git-svn-id: http://skia.googlecode.com/svn/trunk@11824 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove support for SK_CROP_RECT_IS_INT, now that it is no longer used in ↵Gravatar senorblanco@chromium.org2013-10-16
| | | | | | | | | | | Blink or Chrome. BUG= R=reed@google.com, reed Review URL: https://codereview.chromium.org/27521002 git-svn-id: http://skia.googlecode.com/svn/trunk@11812 2bbb7eff-a529-9590-31e7-b0007b416f81
* force readbuffer clients to use specialized readFoo for flattenablesGravatar reed@google.com2013-10-16
| | | | | | | | | BUG= R=mtklein@google.com Review URL: https://codereview.chromium.org/26702002 git-svn-id: http://skia.googlecode.com/svn/trunk@11803 2bbb7eff-a529-9590-31e7-b0007b416f81