diff options
| author | 2017-03-16 17:41:40 +0000 | |
|---|---|---|
| committer | 2017-03-16 17:41:43 +0000 | |
| commit | 9e8f05f77d53020fe1c506778476e8039cd603c8 (patch) | |
| tree | 519c36588524b548680f6e1fa107dfbfef3129c5 /libs/hwui/ProgramCache.cpp | |
| parent | 587b60282e4d9f9cb4bd02df0bb13e69d098b0db (diff) | |
| parent | 0d86d7ebc2b83f0bdd28bb99e57289215947f2e0 (diff) | |
Merge "Improve dithering of alpha gradients"
Diffstat (limited to 'libs/hwui/ProgramCache.cpp')
| -rw-r--r-- | libs/hwui/ProgramCache.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libs/hwui/ProgramCache.cpp b/libs/hwui/ProgramCache.cpp index 40ab7788f218..3f842e0b5679 100644 --- a/libs/hwui/ProgramCache.cpp +++ b/libs/hwui/ProgramCache.cpp @@ -190,7 +190,7 @@ const char* gFS_Transfer_Functions = R"__SHADER__( // Dithering must be done in the quantization space // When we are writing to an sRGB framebuffer, we must do the following: // EOTF(OETF(color) + dither) -// The dithering pattern is generated with a triangle noise generator in the range [-0.0,1.0] +// The dithering pattern is generated with a triangle noise generator in the range [-1.0,1.0] // TODO: Handle linear fp16 render targets const char* gFS_Gradient_Functions = R"__SHADER__( float triangleNoise(const highp vec2 n) { @@ -203,7 +203,7 @@ const char* gFS_Gradient_Functions = R"__SHADER__( const char* gFS_Gradient_Preamble[2] = { // Linear framebuffer "\nvec4 dither(const vec4 color) {\n" - " return vec4(color.rgb + (triangleNoise(gl_FragCoord.xy * screenSize.xy) / 255.0), color.a);\n" + " return color + (triangleNoise(gl_FragCoord.xy * screenSize.xy) / 255.0);\n" "}\n" "\nvec4 gammaMix(const vec4 a, const vec4 b, float v) {\n" " vec4 c = mix(a, b, v);\n" |