aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/GpuColorFilterTest.cpp
Commit message (Collapse)AuthorAge
* Generate list of GPU contexts outside testsGravatar kkinnunen2015-12-01
| | | | | | | | | | | | Use DEF_GPUTEST_FOR_*_CONTEXT macros to obtain the test GPU context. Makes changing the context -related classes easier, since not all tests need to be changed. BUG=skia:2992 Review URL: https://codereview.chromium.org/1448873002
* Bye bye processor data manager.Gravatar bsalomon2015-10-06
| | | | Review URL: https://codereview.chromium.org/1388113002
* Use child processors to implement compose color filter.Gravatar bsalomon2015-09-29
| | | | Review URL: https://codereview.chromium.org/1368423003
* Make skpaint->grpaint flow work for composing draws (verts and atlas)Gravatar bsalomon2015-09-28
| | | | | | One side effect is that the SkShader's (or implicit shader's) fragment processor is responsible for the transition from an unpremul paint color to a premul color. Review URL: https://codereview.chromium.org/1348583002
* Create fragment processor for performing input color blend with child processorGravatar bsalomon2015-09-15
| | | | | | The new FP is used to implement SkXM::Mode color filters and SkXM::Mode image filters. Also, these now support all advanced SkXM::Mode xfermodes. Review URL: https://codereview.chromium.org/1334293003
* Style Change: NULL->nullptrGravatar halcanary2015-08-27
| | | | | | DOCS_PREVIEW= https://skia.org/?cl=1316233002 Review URL: https://codereview.chromium.org/1316233002
* rename GrShaderDataManager -> GrProcessorDataManagerGravatar joshualitt2015-07-09
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/1228683002
* More threading of GrShaderDataManagerGravatar joshualitt2015-07-08
| | | | | | | TBR=bsalomon@google.com BUG=skia: Review URL: https://codereview.chromium.org/1213613016
* change colorfilter to return an array of frag processorsGravatar reed2015-03-03
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/973593002
* Add device space skshader GM to test kDevice_GrCoordSetGravatar bsalomon2014-12-29
| | | | Review URL: https://codereview.chromium.org/816003002
* Move GrInvariantOutput out of GrProcessor and into its own class.Gravatar egdaniel2014-11-12
| | | | | | | | This will help with the ability to subclass, add to, etc. GrInvariantOutput. Also it was simply getting a little too big to be a "supporting" subclass BUG=skia: Review URL: https://codereview.chromium.org/699943003
* Move willUseInputColor check to computeInvariantOutputGravatar egdaniel2014-10-15
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/656503002
* Split GrFragmentProcessor into its own headerGravatar bsalomon2014-10-15
| | | | Review URL: https://codereview.chromium.org/660573002
* Create helper functions to use in computeInvariantOutput callsGravatar egdaniel2014-10-13
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/643743003
* Add isSingleComponent bool to getConstantColorComponentGravatar egdaniel2014-10-03
| | | | | | | | | | Initial step to allowing effects to use/output 1 or 4 color/coverage components. This cl doesn't change any current logic and all effects still assume they are working with 4 components. BUG=skia: Committed: https://skia.googlesource.com/skia/+/3b8af078281a5a20f951b9fd84f38d92b8f6217b Review URL: https://codereview.chromium.org/608253002
* Revert of Add isSingleComponent bool to getConstantColorComponent (patchset ↵Gravatar robertphillips2014-10-02
| | | | | | | | | | | | | | | | | | | | | | | #6 id:100001 of https://codereview.chromium.org/608253002/) Reason for revert: Changing some GMs Original issue's description: > Add isSingleComponent bool to getConstantColorComponent > > Initial step to allowing effects to use/output 1 or 4 color/coverage components. This cl doesn't change any current logic and all effects still assume they are working with 4 components. > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/3b8af078281a5a20f951b9fd84f38d92b8f6217b TBR=joshualitt@chromium.org,bsalomon@google.com,reed@google.com,egdaniel@google.com NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/617853003
* Add isSingleComponent bool to getConstantColorComponentGravatar egdaniel2014-10-02
| | | | | | | | Initial step to allowing effects to use/output 1 or 4 color/coverage components. This cl doesn't change any current logic and all effects still assume they are working with 4 components. BUG=skia: Review URL: https://codereview.chromium.org/608253002
* Patch to create a distinct geometry processor. The vast majority of this patchGravatar joshualitt2014-09-23
| | | | | | | | | | | | | 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
* 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
* 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
* Move macros from TestClassDef.h to Test.hGravatar commit-bot@chromium.org2014-01-14
| | | | | | | | | | | | | | Motivation: those macros don't make any sense without the definitions in Test.h. BUG= R=mtklein@google.com Author: halcanary@google.com Review URL: https://codereview.chromium.org/138563004 git-svn-id: http://skia.googlecode.com/svn/trunk@13074 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add a DEF_GPUTEST() macro.Gravatar tfarina@chromium.org2014-01-10
| | | | | | | | | | | | | This macro is similar to DEF_TEST() and simplifies the process of setting up a GPU test. BUG=skia:1952 TEST=tests R=mtklein@google.com Review URL: https://codereview.chromium.org/132293005 git-svn-id: http://skia.googlecode.com/svn/trunk@13033 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