| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #if USE(ACCELERATED_COMPOSITING) | 7 #if USE(ACCELERATED_COMPOSITING) |
| 8 | 8 |
| 9 #include "ShaderChromium.h" | 9 #include "ShaderChromium.h" |
| 10 | 10 |
| 11 #include <public/WebGraphicsContext3D.h> | 11 #include <public/WebGraphicsContext3D.h> |
| 12 #include <wtf/StdLibExtras.h> | 12 #include <wtf/StdLibExtras.h> |
| 13 | 13 |
| 14 #define SHADER0(Src) #Src | 14 #define SHADER0(Src) #Src |
| 15 #define SHADER(Src) SHADER0(Src) | 15 #define SHADER(Src) SHADER0(Src) |
| 16 | 16 |
| 17 using WebKit::WebGraphicsContext3D; | 17 using WebKit::WebGraphicsContext3D; |
| 18 | 18 |
| 19 namespace WebCore { | 19 namespace cc { |
| 20 | 20 |
| 21 namespace { | 21 namespace { |
| 22 | 22 |
| 23 static void getProgramUniformLocations(WebGraphicsContext3D* context, unsigned p
rogram, const char** shaderUniforms, size_t count, size_t maxLocations, int* loc
ations, bool usingBindUniform, int* baseUniformIndex) | 23 static void getProgramUniformLocations(WebGraphicsContext3D* context, unsigned p
rogram, const char** shaderUniforms, size_t count, size_t maxLocations, int* loc
ations, bool usingBindUniform, int* baseUniformIndex) |
| 24 { | 24 { |
| 25 for (size_t uniformIndex = 0; uniformIndex < count; uniformIndex ++) { | 25 for (size_t uniformIndex = 0; uniformIndex < count; uniformIndex ++) { |
| 26 ASSERT(uniformIndex < maxLocations); | 26 ASSERT(uniformIndex < maxLocations); |
| 27 | 27 |
| 28 if (usingBindUniform) { | 28 if (usingBindUniform) { |
| 29 locations[uniformIndex] = (*baseUniformIndex)++; | 29 locations[uniformIndex] = (*baseUniformIndex)++; |
| (...skipping 843 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 873 vec4 color1 = vec4(1.0, 1.0, 1.0, 1.0); | 873 vec4 color1 = vec4(1.0, 1.0, 1.0, 1.0); |
| 874 vec4 color2 = vec4(0.945, 0.945, 0.945, 1.0); | 874 vec4 color2 = vec4(0.945, 0.945, 0.945, 1.0); |
| 875 vec2 texCoord = clamp(v_texCoord, 0.0, 1.0) * texTransform.zw + texT
ransform.xy; | 875 vec2 texCoord = clamp(v_texCoord, 0.0, 1.0) * texTransform.zw + texT
ransform.xy; |
| 876 vec2 coord = mod(floor(texCoord * frequency * 2.0), 2.0); | 876 vec2 coord = mod(floor(texCoord * frequency * 2.0), 2.0); |
| 877 float picker = abs(coord.x - coord.y); | 877 float picker = abs(coord.x - coord.y); |
| 878 gl_FragColor = mix(color1, color2, picker) * alpha; | 878 gl_FragColor = mix(color1, color2, picker) * alpha; |
| 879 } | 879 } |
| 880 ); | 880 ); |
| 881 } | 881 } |
| 882 | 882 |
| 883 } // namespace WebCore | 883 } // namespace cc |
| 884 | 884 |
| 885 #endif // USE(ACCELERATED_COMPOSITING) | 885 #endif // USE(ACCELERATED_COMPOSITING) |
| OLD | NEW |