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 "cc/output/shader.h" | 5 #include "cc/output/shader.h" |
6 | 6 |
| 7 #include <stddef.h> |
| 8 |
7 #include <algorithm> | 9 #include <algorithm> |
8 | 10 |
9 #include "base/basictypes.h" | |
10 #include "base/logging.h" | 11 #include "base/logging.h" |
11 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
12 #include "cc/output/static_geometry_binding.h" | 13 #include "cc/output/static_geometry_binding.h" |
13 #include "gpu/command_buffer/client/gles2_interface.h" | 14 #include "gpu/command_buffer/client/gles2_interface.h" |
14 #include "ui/gfx/geometry/point.h" | 15 #include "ui/gfx/geometry/point.h" |
15 #include "ui/gfx/geometry/size.h" | 16 #include "ui/gfx/geometry/size.h" |
16 | 17 |
17 template <size_t size> | 18 template <size_t size> |
18 std::string StripLambda(const char(&shader)[size]) { | 19 std::string StripLambda(const char(&shader)[size]) { |
19 // Must contain at least "[]() {}" and trailing null (included in size). | 20 // Must contain at least "[]() {}" and trailing null (included in size). |
(...skipping 2225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2245 void main() { | 2246 void main() { |
2246 vec4 d4 = min(edge_dist[0], edge_dist[1]); | 2247 vec4 d4 = min(edge_dist[0], edge_dist[1]); |
2247 vec2 d2 = min(d4.xz, d4.yw); | 2248 vec2 d2 = min(d4.xz, d4.yw); |
2248 float aa = clamp(gl_FragCoord.w * min(d2.x, d2.y), 0.0, 1.0); | 2249 float aa = clamp(gl_FragCoord.w * min(d2.x, d2.y), 0.0, 1.0); |
2249 gl_FragColor = color * aa; | 2250 gl_FragColor = color * aa; |
2250 } | 2251 } |
2251 }); | 2252 }); |
2252 } | 2253 } |
2253 | 2254 |
2254 } // namespace cc | 2255 } // namespace cc |
OLD | NEW |