aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrPaint.cpp
Commit message (Collapse)AuthorAge
* Move GrProcessorDataManager to GrMemoryPoolGravatar joshualitt2015-07-10
| | | | | | | TBR=bsalomon@google.com BUG=skia: Review URL: https://codereview.chromium.org/1225363002
* More threading of GrProcessorDataManagerGravatar joshualitt2015-07-09
| | | | | | | TBR=bsalomon@google.com BUG=skia: Review URL: https://codereview.chromium.org/1230813003
* Update XPF invariant info to not account for conflationGravatar cdalton2015-06-02
| | | | | | | | | | Renames getInvariantOutput to getInvariantBlendedColor on GrXPFactory and redefines it to not account for coverage conflation. This is the information that all the callsites actually wanted to know. BUG=skia: Review URL: https://codereview.chromium.org/1161273005
* Use SkXfermode as public facing enum for GrPorterDuffXPGravatar egdaniel2015-02-17
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/926593005
* XPFactory lazily initializie in drawstate / GrPaintGravatar joshualitt2015-01-22
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/866573002
* removing coord change matricesGravatar joshualitt2014-12-29
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/821243003
* Add XP to handle the cases where we disable color write.Gravatar egdaniel2014-12-22
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/787233003
* Add an InvariantOutput for the XPF.Gravatar egdaniel2014-12-18
| | | | | | | | | | | The Invariant output holds information about final post blended color and other general information like will it blend with dst. Having this new struct allowed me to also remove some functions that were previously querying subsets of the invariant output. BUG=skia: Review URL: https://codereview.chromium.org/814933002
* Make all blending up to GrOptDrawState be handled by the xp/xp factory.Gravatar egdaniel2014-12-09
| | | | | | | | | | | | In this cl the blending information is extracted for the xp and stored in the ODS which is then used as it currently is. In the follow up cl, an XP backend will be added and at that point all blending work will take place inside XP's. BUG=skia: Committed: https://skia.googlesource.com/skia/+/7c66342a399b529634bed0fabfaa562db2c0dbd4 Review URL: https://codereview.chromium.org/759713002
* Revert of Make all blending up to GrOptDrawState be handled by the xp/xp ↵Gravatar egdaniel2014-12-08
| | | | | | | | | | | | | | | | | | | | | | | | | factory. (patchset #7 id:140001 of https://codereview.chromium.org/759713002/) Reason for revert: break many gm's Original issue's description: > Make all blending up to GrOptDrawState be handled by the xp/xp factory. > > In this cl the blending information is extracted for the xp and stored in the ODS > which is then used as it currently is. In the follow up cl, an XP backend will be added > and at that point all blending work will take place inside XP's. > > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/7c66342a399b529634bed0fabfaa562db2c0dbd4 TBR=bsalomon@google.com NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/766653008
* Make all blending up to GrOptDrawState be handled by the xp/xp factory.Gravatar egdaniel2014-12-08
| | | | | | | | | | In this cl the blending information is extracted for the xp and stored in the ODS which is then used as it currently is. In the follow up cl, an XP backend will be added and at that point all blending work will take place inside XP's. BUG=skia: Review URL: https://codereview.chromium.org/759713002
* Use static XPF for porter duff xp factories.Gravatar egdaniel2014-12-03
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/776843004
* Add XferProcessor factory in GrPaint and GrDrawState.Gravatar egdaniel2014-12-03
| | | | | | | | In this CL the XP should have zero effect on the actual rendering pipeline. BUG=skia: Review URL: https://codereview.chromium.org/751283002
* Add GrProcOptInfo class to track various output information for color and ↵Gravatar egdaniel2014-11-13
| | | | | | | | coverage stages. BUG=skia: Review URL: https://codereview.chromium.org/719203002
* 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
* Remove coverage from grpaintGravatar joshualitt2014-11-11
| | | | | | BUG=skia: Review URL: https://codereview.chromium.org/683133006
* Force input coverage to be only a byte in gpu shaders.Gravatar egdaniel2014-11-03
| | | | | | | | Prime coverage invariant output calculations with single component BUG=skia: Review URL: https://codereview.chromium.org/649783003
* 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
* "NULL !=" = NULLGravatar bsalomon2014-09-05
| | | | | | | | R=reed@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/544233002
* 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
* Remove use of GrEffectRef from draw state and below.Gravatar bsalomon2014-07-07
| | | | | | | | R=robertphillips@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/372773002
* Convert GrCrash->SkFAIL GrDebugCrash->SkDEBUGFAILGravatar commit-bot@chromium.org2014-04-30
| | | | | | | | | | R=robertphillips@google.com, reed@google.com, mtklein@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/257393004 git-svn-id: http://skia.googlecode.com/svn/trunk@14460 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
* 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
* Add blend optimization helpers and use to convert rect draws to clears.Gravatar commit-bot@chromium.org2013-08-14
| | | | | | | | | | R=robertphillips@google.com, jvanverth@google.com Author: bsalomon@google.com Review URL: https://chromiumcodereview.appspot.com/22558003 git-svn-id: http://skia.googlecode.com/svn/trunk@10723 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "Add blend optimization helpers and use to convert rect draws to clears."Gravatar bsalomon@google.com2013-08-07
| | | | | | This reverts commit r10537. git-svn-id: http://skia.googlecode.com/svn/trunk@10601 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add blend optimization helpers and use to convert rect draws to clears.Gravatar commit-bot@chromium.org2013-08-06
| | | | | | | | | | | | Committed: http://code.google.com/p/skia/source/detail?r=10537 R=robertphillips@google.com, jvanverth@google.com, reed@google.com Author: bsalomon@google.com Review URL: https://chromiumcodereview.appspot.com/21877006 git-svn-id: http://skia.googlecode.com/svn/trunk@10562 2bbb7eff-a529-9590-31e7-b0007b416f81
* Revert "Add blend optimization helpers and use to convert rect draws to clears."Gravatar bsalomon@google.com2013-08-05
| | | | | | This reverts commit r10537. git-svn-id: http://skia.googlecode.com/svn/trunk@10542 2bbb7eff-a529-9590-31e7-b0007b416f81
* Add blend optimization helpers and use to convert rect draws to clears.Gravatar commit-bot@chromium.org2013-08-05
| | | | | | | | | | R=robertphillips@google.com, jvanverth@google.com, reed@google.com Author: bsalomon@google.com Review URL: https://chromiumcodereview.appspot.com/21877006 git-svn-id: http://skia.googlecode.com/svn/trunk@10537 2bbb7eff-a529-9590-31e7-b0007b416f81
* Sanitizing source files in Housekeeper-NightlyGravatar skia.committer@gmail.com2013-07-14
| | | | git-svn-id: http://skia.googlecode.com/svn/trunk@10067 2bbb7eff-a529-9590-31e7-b0007b416f81
* Make GrPaint have a variable sized array of color and coverage stages rather ↵Gravatar commit-bot@chromium.org2013-07-13
than a fixed size. R=robertphillips@google.com, jvanverth@google.com Author: bsalomon@google.com Review URL: https://chromiumcodereview.appspot.com/18686007 git-svn-id: http://skia.googlecode.com/svn/trunk@10062 2bbb7eff-a529-9590-31e7-b0007b416f81