aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkXfermode.cpp
Commit message (Collapse)AuthorAge
...
* 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
* 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
* 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
* ARM Skia NEON patches - 30 - Xfermode: NEON modeprocsGravatar commit-bot@chromium.org2013-10-17
| | | | | | | | | | | | | | | | | | | | | | | | Xfermode: NEON implementation of SIMD procs This patch contains a NEON implementation for a number of Xfermodes. It provides a big speedup on Xfermode benchmarks (currently up to 3x with gcc4.7 but up to 10x when gcc produces optimal code for it). Signed-off-by: Kévin PETIT <kevin.petit@arm.com> BUG= Committed: http://code.google.com/p/skia/source/detail?r=11777 Committed: http://code.google.com/p/skia/source/detail?r=11813 R=djsollen@google.com, mtklein@google.com, reed@google.com, robertphillips@google.com Author: kevin.petit.arm@gmail.com Review URL: https://codereview.chromium.org/26627004 git-svn-id: http://skia.googlecode.com/svn/trunk@11843 2bbb7eff-a529-9590-31e7-b0007b416f81
* Reverting r11813 (ARM Skia NEON patches - 30 - Xfermode: NEON modeprocs - ↵Gravatar robertphillips@google.com2013-10-17
| | | | | | https://codereview.chromium.org/26627004) due to Chromium compilation faliures. git-svn-id: http://skia.googlecode.com/svn/trunk@11833 2bbb7eff-a529-9590-31e7-b0007b416f81
* ARM Skia NEON patches - 30 - Xfermode: NEON modeprocsGravatar commit-bot@chromium.org2013-10-16
| | | | | | | | | | | | | | | | | | | | | | Xfermode: NEON implementation of SIMD procs This patch contains a NEON implementation for a number of Xfermodes. It provides a big speedup on Xfermode benchmarks (currently up to 3x with gcc4.7 but up to 10x when gcc produces optimal code for it). Signed-off-by: Kévin PETIT <kevin.petit@arm.com> BUG= Committed: http://code.google.com/p/skia/source/detail?r=11777 R=djsollen@google.com, mtklein@google.com, reed@google.com, robertphillips@google.com Author: kevin.petit.arm@gmail.com Review URL: https://codereview.chromium.org/26627004 git-svn-id: http://skia.googlecode.com/svn/trunk@11813 2bbb7eff-a529-9590-31e7-b0007b416f81
* Reverting r11777 (ARM Skia NEON patches - 30 - Xfermode: NEON modeprocs) due ↵Gravatar robertphillips@google.com2013-10-16
| | | | | | to Chromium compilation failure git-svn-id: http://skia.googlecode.com/svn/trunk@11799 2bbb7eff-a529-9590-31e7-b0007b416f81
* ARM Skia NEON patches - 30 - Xfermode: NEON modeprocsGravatar commit-bot@chromium.org2013-10-15
| | | | | | | | | | | | | | | | | | | Xfermode: NEON implementation of SIMD procs This patch contains a NEON implementation for a number of Xfermodes. It provides a big speedup on Xfermode benchmarks (currently up to 3x with gcc4.7 but up to 10x when gcc produces optimal code for it). Signed-off-by: Kévin PETIT <kevin.petit@arm.com> BUG= R=djsollen@google.com, mtklein@google.com, reed@google.com Author: kevin.petit.arm@gmail.com Review URL: https://codereview.chromium.org/26627004 git-svn-id: http://skia.googlecode.com/svn/trunk@11777 2bbb7eff-a529-9590-31e7-b0007b416f81
* Express (GLSL expression, possibly known value) pairs as a classGravatar commit-bot@chromium.org2013-10-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Express (GLSL expression, possibly known value) pairs as a class instead of two variables Introduces GrGLSLExpr<N> to encapsulate the expression and possibly constant-folded value of the expression. This simplifies passing of the expressions to functions. Changes the shaders with following patterns: { // Stage 0: Linear Gradient vec4 colorTemp = mix(uGradientStartColor_Stage0, uGradientEndColor_Stage0, clamp(vMatrixCoord_Stage0.x, 0.0, 1 colorTemp.rgb *= colorTemp.a; - output_Stage0 = vec4((vColor) * (colorTemp)); + output_Stage0 = (vColor * colorTemp); + } Previously the vector cast was always added if constant folding was effective, regardless of the term dimensions. Now the vector upcast is not inserted in places where it is not needed, ie. when the binary operator term is of the target dimension. Also, some parentheses can be omitted. It is assumed that GrGLSLExpr<N>("string") constructors construct a simple expression or parenthesized expression. Otherwise the shader code remains identical. R=jvanverth@google.com, bsalomon@google.com, robertphillips@google.com Author: kkinnunen@nvidia.com Review URL: https://codereview.chromium.org/25048002 git-svn-id: http://skia.googlecode.com/svn/trunk@11690 2bbb7eff-a529-9590-31e7-b0007b416f81
* ARM Skia NEON patches - 28 - Xfermode: SIMD modeprocsGravatar commit-bot@chromium.org2013-10-09
| | | | | | | | | | | | | | | | | | | | | | Xfermode: allow for SIMD modeprocs This patch introduces the ability to have SIMD Xfermode modeprocs. In the NEON implementation, SIMD modeprocs will process 8 pixels at a time. Signed-off-by: Kévin PETIT <kevin.petit@arm.com> BUG= Committed: http://code.google.com/p/skia/source/detail?r=11654 R=djsollen@google.com, mtklein@google.com, reed@google.com Author: kevin.petit.arm@gmail.com Review URL: https://codereview.chromium.org/23644006 git-svn-id: http://skia.googlecode.com/svn/trunk@11669 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "ARM Skia NEON patches - 28 - Xfermode: SIMD modeprocs"Gravatar djsollen@google.com2013-10-08
| | | | | | | | This reverts http://code.google.com/p/skia/source/detail?r=11654 Review URL: https://codereview.chromium.org/26340010 git-svn-id: http://skia.googlecode.com/svn/trunk@11655 2bbb7eff-a529-9590-31e7-b0007b416f81
* ARM Skia NEON patches - 28 - Xfermode: SIMD modeprocsGravatar commit-bot@chromium.org2013-10-08
| | | | | | | | | | | | | | | | | | | Xfermode: allow for SIMD modeprocs This patch introduces the ability to have SIMD Xfermode modeprocs. In the NEON implementation, SIMD modeprocs will process 8 pixels at a time. Signed-off-by: Kévin PETIT <kevin.petit@arm.com> BUG= R=djsollen@google.com, mtklein@google.com, reed@google.com Author: kevin.petit.arm@gmail.com Review URL: https://codereview.chromium.org/23644006 git-svn-id: http://skia.googlecode.com/svn/trunk@11654 2bbb7eff-a529-9590-31e7-b0007b416f81
* Make skia almost compile again with clang.Gravatar commit-bot@chromium.org2013-10-07
| | | | | | | | | | | | clang is reporting many unused functions and variables. R=bsalomon@google.com, robertphillips@google.com, reed@google.com Author: tfarina@chromium.org Review URL: https://codereview.chromium.org/26167002 git-svn-id: http://skia.googlecode.com/svn/trunk@11630 2bbb7eff-a529-9590-31e7-b0007b416f81
* commit to xfermode objects being immutableGravatar commit-bot@chromium.org2013-10-04
| | | | | | | | | | | BUG= R=djsollen@google.com, mtklein@google.com Author: reed@google.com Review URL: https://codereview.chromium.org/25968004 git-svn-id: http://skia.googlecode.com/svn/trunk@11614 2bbb7eff-a529-9590-31e7-b0007b416f81
* Make GPU coord transforms automaticGravatar bsalomon@google.com2013-10-02
| | | | | | | | | | | | | 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
* Revert 11247, 11250, 11251, 11257, and 11279 to unblock DEPS roll ↵Gravatar robertphillips@google.com2013-09-16
| | | | | | | | | | | | | | (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
* Revert the revert of 11247, 11250, 11251 and 11279 (Chrome already relies on ↵Gravatar robertphillips@google.com2013-09-16
| | | | | | changes in r11247) git-svn-id: http://skia.googlecode.com/svn/trunk@11287 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert 11247, 11250, 11251 and 11279 to unblock DEPS roll ↵Gravatar robertphillips@google.com2013-09-16
| | | | | | | | | | | | | (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
* Initial error handling codeGravatar commit-bot@chromium.org2013-09-13
| | | | | | | | | | | | | 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
* Change old PRG to be SkLCGRandom; change new one to SkRandomGravatar commit-bot@chromium.org2013-09-09
| | | | | | | | | | | | | | 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
* Rename ShaderType enum to ShaderVisibilityGravatar commit-bot@chromium.org2013-08-30
| | | | | | | | | | | | | | | | | | | | | 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
* Fix case where GrGLEffectMatrix gives back a dangling ptr for the coords var ↵Gravatar commit-bot@chromium.org2013-08-28
| | | | | | | | | | | | 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
* Replace uses of GrAssert by SkASSERT.Gravatar tfarina@chromium.org2013-08-17
| | | | | | | | R=bsalomon@google.com Review URL: https://codereview.chromium.org/22850006 git-svn-id: http://skia.googlecode.com/svn/trunk@10789 2bbb7eff-a529-9590-31e7-b0007b416f81
* ARM Skia NEON patches - 07 - Equation simplificationGravatar commit-bot@chromium.org2013-07-15
| | | | | | | | | | | | | | | | Misc: simplify the equation of the exclusion Xfermode The equation can be dramatically simplified. The results with gm are the same except that the code is faster. BUG= R=djsollen@google.com, reed@google.com, bsalomon@google.com, cabanier@adobe.com Author: kevin.petit.arm@gmail.com Review URL: https://chromiumcodereview.appspot.com/18112016 git-svn-id: http://skia.googlecode.com/svn/trunk@10069 2bbb7eff-a529-9590-31e7-b0007b416f81
* remove dst/rendertarget support for kARGB_4444_ConfigGravatar reed@google.com2013-06-21
| | | | | | | | BUG= Review URL: https://codereview.chromium.org/17335008 git-svn-id: http://skia.googlecode.com/svn/trunk@9727 2bbb7eff-a529-9590-31e7-b0007b416f81
* Implement SkXfermode image filter. This required changing the signature of ↵Gravatar senorblanco@chromium.org2013-05-31
| | | | | | | | | | | | | | SkXfermode::asNewEffectOrCoeffs(), to add an optional background texture. For the raster path, we do a straightforward 2-pass method: draw background, then composite the foreground over it. For the GPU path, if the xfermode can be expressed as an effect, we build an effect with the background texture incorporated, then do a single-pass draw fetching both foreground and background textures, and compositing to the result. If the xfermode is expressed as src/dst coefficients, we do a 2-pass draw as in the raster path and use fixed-function blending. R=bsalomon@google.com, reed@google.com Review URL: https://codereview.chromium.org/16125008 git-svn-id: http://skia.googlecode.com/svn/trunk@9373 2bbb7eff-a529-9590-31e7-b0007b416f81
* Make GrGLShaderBuilder check whether GrEffect advertised that it would ↵Gravatar commit-bot@chromium.org2013-05-09
| | | | | | | | | | | | require the dst color or fragment position R=senorblanco@chromium.org, robertphillips@google.com Author: bsalomon@google.com Review URL: https://chromiumcodereview.appspot.com/14998007 git-svn-id: http://skia.googlecode.com/svn/trunk@9074 2bbb7eff-a529-9590-31e7-b0007b416f81
* Stop using mix() to implement hard-light in shader.Gravatar commit-bot@chromium.org2013-04-29
| | | | | | | | | | R=jvanverth@google.com, robertphillips@google.com Author: bsalomon@google.com Review URL: https://chromiumcodereview.appspot.com/14541004 git-svn-id: http://skia.googlecode.com/svn/trunk@8910 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove inout params from saturation helper func in XferEffect.Gravatar commit-bot@chromium.org2013-04-29
| | | | | | | | | | R=robertphillips@google.com, jvanverth@google.com Author: bsalomon@google.com Review URL: https://chromiumcodereview.appspot.com/14535004 git-svn-id: http://skia.googlecode.com/svn/trunk@8909 2bbb7eff-a529-9590-31e7-b0007b416f81
* Remove redundant setting of alpha in hard-light GPU shader.Gravatar commit-bot@chromium.org2013-04-29
| | | | | | | | | | R=jvanverth@google.com Author: bsalomon@google.com Review URL: https://chromiumcodereview.appspot.com/14418005 git-svn-id: http://skia.googlecode.com/svn/trunk@8903 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2013-04-26
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8873 2bbb7eff-a529-9590-31e7-b0007b416f81
* Temporarily disable HardLight effect in unit tests.Gravatar jvanverth@google.com2013-04-25
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8865 2bbb7eff-a529-9590-31e7-b0007b416f81
* Some fixes for saturation computation XferEffect.Gravatar commit-bot@chromium.org2013-04-25
| | | | | | | | | | R=jvanverth@google.com, robertphillips@google.com Author: bsalomon@google.com Review URL: https://chromiumcodereview.appspot.com/14034018 git-svn-id: http://skia.googlecode.com/svn/trunk@8850 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add non-separable xfer modes to GPU backend.Gravatar bsalomon@google.com2013-04-22
| | | | | | Review URL: https://codereview.chromium.org/14371014 git-svn-id: http://skia.googlecode.com/svn/trunk@8815 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2013-04-20
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8785 2bbb7eff-a529-9590-31e7-b0007b416f81
* Final round of .0sGravatar bsalomon@google.com2013-04-19
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8774 2bbb7eff-a529-9590-31e7-b0007b416f81
* More .0sGravatar bsalomon@google.com2013-04-19
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8771 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add ".0" to 1 constants in xfermodes GLSL code.Gravatar bsalomon@google.com2013-04-19
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8770 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add all remaining separable xfer modes to GPU backend.Gravatar bsalomon@google.com2013-04-19
| | | | | | Review URL: https://codereview.chromium.org/14189024 git-svn-id: http://skia.googlecode.com/svn/trunk@8768 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add coeffecients for kScreen xfermode.Gravatar bsalomon@google.com2013-04-15
| | | | | | Review URL: https://codereview.chromium.org/14046021 git-svn-id: http://skia.googlecode.com/svn/trunk@8680 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add Xfermode bench. Also clear before rendering in bench (rather than after).Gravatar commit-bot@chromium.org2013-04-01
| | | | | | | | | | Author: bsalomon@google.com Reviewed By: robertphillips@google.com Review URL: https://chromiumcodereview.appspot.com/13334011 git-svn-id: http://skia.googlecode.com/svn/trunk@8454 2bbb7eff-a529-9590-31e7-b0007b416f81
* Fix GLPrograms test.Gravatar bsalomon@google.com2013-03-29
| | | | | | Review URL: https://codereview.chromium.org/13327008 git-svn-id: http://skia.googlecode.com/svn/trunk@8450 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add support for reading the dst pixel value in an effect. Use in a new ↵Gravatar bsalomon@google.com2013-03-29
| | | | | | | | | | | effect for the kDarken xfer mode. The current implementation is to always make a copy of the entire dst before the draw. It will only succeed if the RT is also a texture. Obviously, there is lots of room for improvement. Review URL: https://codereview.chromium.org/13314002 git-svn-id: http://skia.googlecode.com/svn/trunk@8449 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add interface to SkXfermode to return a GrEffect and blend coeffs.Gravatar bsalomon@google.com2013-03-27
| | | | | | Review URL: https://codereview.chromium.org/13097006 git-svn-id: http://skia.googlecode.com/svn/trunk@8412 2bbb7eff-a529-9590-31e7-b0007b416f81
* This changes fixes issues with the non-separable blend modes. They were not ↵Gravatar commit-bot@chromium.org2013-03-21
| | | | | | | | | | | | | | | | producing the correct results if alpha was involved. I fixed the math so everything happens in premultiplied alpha so there is no loss in precision. I also fixed the math of color-burn and color-dodge. Author: cabanier@gmail.com Reviewed By: reed@google.com Review URL: https://chromiumcodereview.appspot.com/12662006 git-svn-id: http://skia.googlecode.com/svn/trunk@8283 2bbb7eff-a529-9590-31e7-b0007b416f81
* land https://chromiumcodereview.appspot.com/12440004/Gravatar reed@google.com2013-03-07
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8013 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Skia_Periodic_House_KeepingGravatar skia.committer@gmail.com2013-03-06
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@8003 2bbb7eff-a529-9590-31e7-b0007b416f81
* Added support for non-separable blending modes.Gravatar commit-bot@chromium.org2013-03-05
| | | | | | | | Fixed scalar issue from https://codereview.appspot.com/7346044 Review URL: https://chromiumcodereview.appspot.com/12393049 git-svn-id: http://skia.googlecode.com/svn/trunk@7984 2bbb7eff-a529-9590-31e7-b0007b416f81
* land https://codereview.appspot.com/7221086/ -- add Multiply xfermode ↵Gravatar reed@google.com2013-02-04
| | | | | | matching CSS spec git-svn-id: http://skia.googlecode.com/svn/trunk@7553 2bbb7eff-a529-9590-31e7-b0007b416f81
* clone of https://codereview.appspot.com/7208043/Gravatar reed@google.com2013-01-30
| | | | | | Review URL: https://codereview.appspot.com/7232062 git-svn-id: http://skia.googlecode.com/svn/trunk@7476 2bbb7eff-a529-9590-31e7-b0007b416f81