History log of /external/skia/src/gpu/GrPaint.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
88cb22b6b4816c7a9ca6c5b795965b4606f9eb7b 30-Apr-2014 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Convert GrCrash->SkFAIL GrDebugCrash->SkDEBUGFAIL

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
/external/skia/src/gpu/GrPaint.cpp
a34995e18b1f0a7d8c9f23451718bb30ff0105b0 23-Oct-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Implement SkColorFilter as a GrGLEffect

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
/external/skia/src/gpu/GrPaint.cpp
f6de475e5cbd143f348ff7738919e397b7fe7f57 17-Aug-2013 tfarina@chromium.org <tfarina@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Replace uses of GrAssert by SkASSERT.

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
/external/skia/src/gpu/GrPaint.cpp
24ab3b0ce50b3428f063849b6160e468f047487c 14-Aug-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Add blend optimization helpers and use to convert rect draws to clears.

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
/external/skia/src/gpu/GrPaint.cpp
75796db3b3f685520eaec2dc0478bdbd4987bae6 07-Aug-2013 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert "Add blend optimization helpers and use to convert rect draws to clears."

This reverts commit r10537.

git-svn-id: http://skia.googlecode.com/svn/trunk@10601 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/gpu/GrPaint.cpp
c1cdf21ab88b63c07990e6bbce559397bf207b47 06-Aug-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Add blend optimization helpers and use to convert rect draws to clears.

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
/external/skia/src/gpu/GrPaint.cpp
9b6a185e36f3145aa53732e8fb30c870ff38a93c 05-Aug-2013 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert "Add blend optimization helpers and use to convert rect draws to clears."

This reverts commit r10537.

git-svn-id: http://skia.googlecode.com/svn/trunk@10542 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/gpu/GrPaint.cpp
66017f6cc52770c04078dc74ddcda27349002652 05-Aug-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Add blend optimization helpers and use to convert rect draws to clears.

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
/external/skia/src/gpu/GrPaint.cpp
b88ab93c379905535d2c86c619e419ce78341220 14-Jul-2013 skia.committer@gmail.com <skia.committer@gmail.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Sanitizing source files in Housekeeper-Nightly

git-svn-id: http://skia.googlecode.com/svn/trunk@10067 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/gpu/GrPaint.cpp
42dacab4e7366d9f53989558cc8d045c3d065bcd 13-Jul-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Make GrPaint have a variable sized array of color and coverage stages rather 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
/external/skia/src/gpu/GrPaint.cpp