Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Side by Side Diff: cc/output/shader.cc

Issue 1947333002: Add support for GL_TEXTURE_EXTERNAL_OES NV12 textures in cc/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | cc/resources/video_resource_updater.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 case SAMPLER_TYPE_2D_RECT: 126 case SAMPLER_TYPE_2D_RECT:
127 DCHECK_NE(shader_string.find("SamplerType"), std::string::npos); 127 DCHECK_NE(shader_string.find("SamplerType"), std::string::npos);
128 DCHECK_NE(shader_string.find("TextureLookup"), std::string::npos); 128 DCHECK_NE(shader_string.find("TextureLookup"), std::string::npos);
129 return "#extension GL_ARB_texture_rectangle : require\n" 129 return "#extension GL_ARB_texture_rectangle : require\n"
130 "#define SamplerType sampler2DRect\n" 130 "#define SamplerType sampler2DRect\n"
131 "#define TextureLookup texture2DRect\n" + 131 "#define TextureLookup texture2DRect\n" +
132 shader_string; 132 shader_string;
133 case SAMPLER_TYPE_EXTERNAL_OES: 133 case SAMPLER_TYPE_EXTERNAL_OES:
134 DCHECK_NE(shader_string.find("SamplerType"), std::string::npos); 134 DCHECK_NE(shader_string.find("SamplerType"), std::string::npos);
135 DCHECK_NE(shader_string.find("TextureLookup"), std::string::npos); 135 DCHECK_NE(shader_string.find("TextureLookup"), std::string::npos);
136 return "#extension GL_OES_EGL_image_external : require\n" 136 return "#extension GL_OES_EGL_image_external : enable\n"
137 "#extension GL_NV_EGL_stream_consumer_external : enable\n"
137 "#define SamplerType samplerExternalOES\n" 138 "#define SamplerType samplerExternalOES\n"
138 "#define TextureLookup texture2D\n" + 139 "#define TextureLookup texture2D\n" +
139 shader_string; 140 shader_string;
140 case SAMPLER_TYPE_NA: 141 case SAMPLER_TYPE_NA:
141 DCHECK_EQ(shader_string.find("SamplerType"), std::string::npos); 142 DCHECK_EQ(shader_string.find("SamplerType"), std::string::npos);
142 DCHECK_EQ(shader_string.find("TextureLookup"), std::string::npos); 143 DCHECK_EQ(shader_string.find("TextureLookup"), std::string::npos);
143 return shader_string; 144 return shader_string;
144 default: 145 default:
145 NOTREACHED(); 146 NOTREACHED();
146 break; 147 break;
(...skipping 2165 matching lines...) Expand 10 before | Expand all | Expand 10 after
2312 void main() { 2313 void main() {
2313 vec4 d4 = min(edge_dist[0], edge_dist[1]); 2314 vec4 d4 = min(edge_dist[0], edge_dist[1]);
2314 vec2 d2 = min(d4.xz, d4.yw); 2315 vec2 d2 = min(d4.xz, d4.yw);
2315 float aa = clamp(gl_FragCoord.w * min(d2.x, d2.y), 0.0, 1.0); 2316 float aa = clamp(gl_FragCoord.w * min(d2.x, d2.y), 0.0, 1.0);
2316 gl_FragColor = color * aa; 2317 gl_FragColor = color * aa;
2317 } 2318 }
2318 }); 2319 });
2319 } 2320 }
2320 2321
2321 } // namespace cc 2322 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/resources/video_resource_updater.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698