| OLD | NEW |
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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/gl_renderer.h" | 5 #include "cc/output/gl_renderer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1152 int shader_tex_transform_location = -1; | 1152 int shader_tex_transform_location = -1; |
| 1153 int shader_backdrop_location = -1; | 1153 int shader_backdrop_location = -1; |
| 1154 int shader_backdrop_rect_location = -1; | 1154 int shader_backdrop_rect_location = -1; |
| 1155 | 1155 |
| 1156 BlendMode shader_blend_mode = ((background_texture || background_image) && | 1156 BlendMode shader_blend_mode = ((background_texture || background_image) && |
| 1157 !CanApplyBlendModeUsingBlendFunc(blend_mode)) | 1157 !CanApplyBlendModeUsingBlendFunc(blend_mode)) |
| 1158 ? BlendModeFromSkXfermode(blend_mode) | 1158 ? BlendModeFromSkXfermode(blend_mode) |
| 1159 : BlendModeNormal; | 1159 : BlendModeNormal; |
| 1160 | 1160 |
| 1161 if (use_aa && mask_texture_id && !use_color_matrix) { | 1161 if (use_aa && mask_texture_id && !use_color_matrix) { |
| 1162 const RenderPassMaskProgramAA* program = | 1162 const RenderPassMaskProgramAA* program = GetRenderPassMaskProgramAA( |
| 1163 GetRenderPassMaskProgramAA(tex_coord_precision, shader_blend_mode); | 1163 tex_coord_precision, mask_sampler, shader_blend_mode); |
| 1164 SetUseProgram(program->program()); | 1164 SetUseProgram(program->program()); |
| 1165 GLC(gl_, gl_->Uniform1i(program->fragment_shader().sampler_location(), 0)); | 1165 GLC(gl_, gl_->Uniform1i(program->fragment_shader().sampler_location(), 0)); |
| 1166 | 1166 |
| 1167 shader_quad_location = program->vertex_shader().quad_location(); | 1167 shader_quad_location = program->vertex_shader().quad_location(); |
| 1168 shader_edge_location = program->vertex_shader().edge_location(); | 1168 shader_edge_location = program->vertex_shader().edge_location(); |
| 1169 shader_viewport_location = program->vertex_shader().viewport_location(); | 1169 shader_viewport_location = program->vertex_shader().viewport_location(); |
| 1170 shader_mask_sampler_location = | 1170 shader_mask_sampler_location = |
| 1171 program->fragment_shader().mask_sampler_location(); | 1171 program->fragment_shader().mask_sampler_location(); |
| 1172 shader_mask_tex_coord_scale_location = | 1172 shader_mask_tex_coord_scale_location = |
| 1173 program->fragment_shader().mask_tex_coord_scale_location(); | 1173 program->fragment_shader().mask_tex_coord_scale_location(); |
| 1174 shader_mask_tex_coord_offset_location = | 1174 shader_mask_tex_coord_offset_location = |
| 1175 program->fragment_shader().mask_tex_coord_offset_location(); | 1175 program->fragment_shader().mask_tex_coord_offset_location(); |
| 1176 shader_matrix_location = program->vertex_shader().matrix_location(); | 1176 shader_matrix_location = program->vertex_shader().matrix_location(); |
| 1177 shader_alpha_location = program->fragment_shader().alpha_location(); | 1177 shader_alpha_location = program->fragment_shader().alpha_location(); |
| 1178 shader_tex_transform_location = | 1178 shader_tex_transform_location = |
| 1179 program->vertex_shader().tex_transform_location(); | 1179 program->vertex_shader().tex_transform_location(); |
| 1180 shader_backdrop_location = program->fragment_shader().backdrop_location(); | 1180 shader_backdrop_location = program->fragment_shader().backdrop_location(); |
| 1181 shader_backdrop_rect_location = | 1181 shader_backdrop_rect_location = |
| 1182 program->fragment_shader().backdrop_rect_location(); | 1182 program->fragment_shader().backdrop_rect_location(); |
| 1183 } else if (!use_aa && mask_texture_id && !use_color_matrix) { | 1183 } else if (!use_aa && mask_texture_id && !use_color_matrix) { |
| 1184 const RenderPassMaskProgram* program = | 1184 const RenderPassMaskProgram* program = GetRenderPassMaskProgram( |
| 1185 GetRenderPassMaskProgram(tex_coord_precision, shader_blend_mode); | 1185 tex_coord_precision, mask_sampler, shader_blend_mode); |
| 1186 SetUseProgram(program->program()); | 1186 SetUseProgram(program->program()); |
| 1187 GLC(gl_, gl_->Uniform1i(program->fragment_shader().sampler_location(), 0)); | 1187 GLC(gl_, gl_->Uniform1i(program->fragment_shader().sampler_location(), 0)); |
| 1188 | 1188 |
| 1189 shader_mask_sampler_location = | 1189 shader_mask_sampler_location = |
| 1190 program->fragment_shader().mask_sampler_location(); | 1190 program->fragment_shader().mask_sampler_location(); |
| 1191 shader_mask_tex_coord_scale_location = | 1191 shader_mask_tex_coord_scale_location = |
| 1192 program->fragment_shader().mask_tex_coord_scale_location(); | 1192 program->fragment_shader().mask_tex_coord_scale_location(); |
| 1193 shader_mask_tex_coord_offset_location = | 1193 shader_mask_tex_coord_offset_location = |
| 1194 program->fragment_shader().mask_tex_coord_offset_location(); | 1194 program->fragment_shader().mask_tex_coord_offset_location(); |
| 1195 shader_matrix_location = program->vertex_shader().matrix_location(); | 1195 shader_matrix_location = program->vertex_shader().matrix_location(); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1210 shader_viewport_location = program->vertex_shader().viewport_location(); | 1210 shader_viewport_location = program->vertex_shader().viewport_location(); |
| 1211 shader_matrix_location = program->vertex_shader().matrix_location(); | 1211 shader_matrix_location = program->vertex_shader().matrix_location(); |
| 1212 shader_alpha_location = program->fragment_shader().alpha_location(); | 1212 shader_alpha_location = program->fragment_shader().alpha_location(); |
| 1213 shader_tex_transform_location = | 1213 shader_tex_transform_location = |
| 1214 program->vertex_shader().tex_transform_location(); | 1214 program->vertex_shader().tex_transform_location(); |
| 1215 shader_backdrop_location = program->fragment_shader().backdrop_location(); | 1215 shader_backdrop_location = program->fragment_shader().backdrop_location(); |
| 1216 shader_backdrop_rect_location = | 1216 shader_backdrop_rect_location = |
| 1217 program->fragment_shader().backdrop_rect_location(); | 1217 program->fragment_shader().backdrop_rect_location(); |
| 1218 } else if (use_aa && mask_texture_id && use_color_matrix) { | 1218 } else if (use_aa && mask_texture_id && use_color_matrix) { |
| 1219 const RenderPassMaskColorMatrixProgramAA* program = | 1219 const RenderPassMaskColorMatrixProgramAA* program = |
| 1220 GetRenderPassMaskColorMatrixProgramAA(tex_coord_precision, | 1220 GetRenderPassMaskColorMatrixProgramAA( |
| 1221 shader_blend_mode); | 1221 tex_coord_precision, mask_sampler, shader_blend_mode); |
| 1222 SetUseProgram(program->program()); | 1222 SetUseProgram(program->program()); |
| 1223 GLC(gl_, gl_->Uniform1i(program->fragment_shader().sampler_location(), 0)); | 1223 GLC(gl_, gl_->Uniform1i(program->fragment_shader().sampler_location(), 0)); |
| 1224 | 1224 |
| 1225 shader_matrix_location = program->vertex_shader().matrix_location(); | 1225 shader_matrix_location = program->vertex_shader().matrix_location(); |
| 1226 shader_quad_location = program->vertex_shader().quad_location(); | 1226 shader_quad_location = program->vertex_shader().quad_location(); |
| 1227 shader_tex_transform_location = | 1227 shader_tex_transform_location = |
| 1228 program->vertex_shader().tex_transform_location(); | 1228 program->vertex_shader().tex_transform_location(); |
| 1229 shader_edge_location = program->vertex_shader().edge_location(); | 1229 shader_edge_location = program->vertex_shader().edge_location(); |
| 1230 shader_viewport_location = program->vertex_shader().viewport_location(); | 1230 shader_viewport_location = program->vertex_shader().viewport_location(); |
| 1231 shader_alpha_location = program->fragment_shader().alpha_location(); | 1231 shader_alpha_location = program->fragment_shader().alpha_location(); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 1258 shader_alpha_location = program->fragment_shader().alpha_location(); | 1258 shader_alpha_location = program->fragment_shader().alpha_location(); |
| 1259 shader_color_matrix_location = | 1259 shader_color_matrix_location = |
| 1260 program->fragment_shader().color_matrix_location(); | 1260 program->fragment_shader().color_matrix_location(); |
| 1261 shader_color_offset_location = | 1261 shader_color_offset_location = |
| 1262 program->fragment_shader().color_offset_location(); | 1262 program->fragment_shader().color_offset_location(); |
| 1263 shader_backdrop_location = program->fragment_shader().backdrop_location(); | 1263 shader_backdrop_location = program->fragment_shader().backdrop_location(); |
| 1264 shader_backdrop_rect_location = | 1264 shader_backdrop_rect_location = |
| 1265 program->fragment_shader().backdrop_rect_location(); | 1265 program->fragment_shader().backdrop_rect_location(); |
| 1266 } else if (!use_aa && mask_texture_id && use_color_matrix) { | 1266 } else if (!use_aa && mask_texture_id && use_color_matrix) { |
| 1267 const RenderPassMaskColorMatrixProgram* program = | 1267 const RenderPassMaskColorMatrixProgram* program = |
| 1268 GetRenderPassMaskColorMatrixProgram(tex_coord_precision, | 1268 GetRenderPassMaskColorMatrixProgram( |
| 1269 shader_blend_mode); | 1269 tex_coord_precision, mask_sampler, shader_blend_mode); |
| 1270 SetUseProgram(program->program()); | 1270 SetUseProgram(program->program()); |
| 1271 GLC(gl_, gl_->Uniform1i(program->fragment_shader().sampler_location(), 0)); | 1271 GLC(gl_, gl_->Uniform1i(program->fragment_shader().sampler_location(), 0)); |
| 1272 | 1272 |
| 1273 shader_matrix_location = program->vertex_shader().matrix_location(); | 1273 shader_matrix_location = program->vertex_shader().matrix_location(); |
| 1274 shader_tex_transform_location = | 1274 shader_tex_transform_location = |
| 1275 program->vertex_shader().tex_transform_location(); | 1275 program->vertex_shader().tex_transform_location(); |
| 1276 shader_mask_sampler_location = | 1276 shader_mask_sampler_location = |
| 1277 program->fragment_shader().mask_sampler_location(); | 1277 program->fragment_shader().mask_sampler_location(); |
| 1278 shader_mask_tex_coord_scale_location = | 1278 shader_mask_tex_coord_scale_location = |
| 1279 program->fragment_shader().mask_tex_coord_scale_location(); | 1279 program->fragment_shader().mask_tex_coord_scale_location(); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1330 // texture is already oriented the same way as the framebuffer, but the | 1330 // texture is already oriented the same way as the framebuffer, but the |
| 1331 // projection transform does a flip. | 1331 // projection transform does a flip. |
| 1332 GLC(gl_, | 1332 GLC(gl_, |
| 1333 gl_->Uniform4f(shader_tex_transform_location, | 1333 gl_->Uniform4f(shader_tex_transform_location, |
| 1334 0.0f, | 1334 0.0f, |
| 1335 tex_scale_y, | 1335 tex_scale_y, |
| 1336 tex_scale_x, | 1336 tex_scale_x, |
| 1337 -tex_scale_y)); | 1337 -tex_scale_y)); |
| 1338 | 1338 |
| 1339 GLint last_texture_unit = 0; | 1339 GLint last_texture_unit = 0; |
| 1340 scoped_ptr<ResourceProvider::ScopedSamplerGL> shader_mask_sampler_lock; | |
| 1341 if (shader_mask_sampler_location != -1) { | 1340 if (shader_mask_sampler_location != -1) { |
| 1342 DCHECK_NE(shader_mask_tex_coord_scale_location, 1); | 1341 DCHECK_NE(shader_mask_tex_coord_scale_location, 1); |
| 1343 DCHECK_NE(shader_mask_tex_coord_offset_location, 1); | 1342 DCHECK_NE(shader_mask_tex_coord_offset_location, 1); |
| 1344 DCHECK_EQ(SamplerType2D, mask_sampler); | |
| 1345 GLC(gl_, gl_->Uniform1i(shader_mask_sampler_location, 1)); | 1343 GLC(gl_, gl_->Uniform1i(shader_mask_sampler_location, 1)); |
| 1346 | 1344 |
| 1347 gfx::RectF mask_uv_rect = quad->MaskUVRect(); | 1345 gfx::RectF mask_uv_rect = quad->MaskUVRect(); |
| 1346 if (mask_sampler != SamplerType2D) { |
| 1347 mask_uv_rect.Scale(quad->mask_texture_size.width(), |
| 1348 quad->mask_texture_size.height()); |
| 1349 } |
| 1348 | 1350 |
| 1349 // Mask textures are oriented vertically flipped relative to the framebuffer | 1351 // Mask textures are oriented vertically flipped relative to the framebuffer |
| 1350 // and the RenderPass contents texture, so we flip the tex coords from the | 1352 // and the RenderPass contents texture, so we flip the tex coords from the |
| 1351 // RenderPass texture to find the mask texture coords. | 1353 // RenderPass texture to find the mask texture coords. |
| 1352 GLC(gl_, | 1354 GLC(gl_, |
| 1353 gl_->Uniform2f(shader_mask_tex_coord_offset_location, | 1355 gl_->Uniform2f(shader_mask_tex_coord_offset_location, |
| 1354 mask_uv_rect.x(), | 1356 mask_uv_rect.x(), |
| 1355 mask_uv_rect.bottom())); | 1357 mask_uv_rect.bottom())); |
| 1356 GLC(gl_, | 1358 GLC(gl_, |
| 1357 gl_->Uniform2f(shader_mask_tex_coord_scale_location, | 1359 gl_->Uniform2f(shader_mask_tex_coord_scale_location, |
| (...skipping 1524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2882 program->Initialize(output_surface_->context_provider(), | 2884 program->Initialize(output_surface_->context_provider(), |
| 2883 precision, | 2885 precision, |
| 2884 SamplerType2D, | 2886 SamplerType2D, |
| 2885 blend_mode); | 2887 blend_mode); |
| 2886 } | 2888 } |
| 2887 return program; | 2889 return program; |
| 2888 } | 2890 } |
| 2889 | 2891 |
| 2890 const GLRenderer::RenderPassMaskProgram* GLRenderer::GetRenderPassMaskProgram( | 2892 const GLRenderer::RenderPassMaskProgram* GLRenderer::GetRenderPassMaskProgram( |
| 2891 TexCoordPrecision precision, | 2893 TexCoordPrecision precision, |
| 2894 SamplerType sampler, |
| 2892 BlendMode blend_mode) { | 2895 BlendMode blend_mode) { |
| 2893 DCHECK_GE(precision, 0); | 2896 DCHECK_GE(precision, 0); |
| 2894 DCHECK_LT(precision, NumTexCoordPrecisions); | 2897 DCHECK_LT(precision, NumTexCoordPrecisions); |
| 2898 DCHECK_GE(sampler, 0); |
| 2899 DCHECK_LT(sampler, NumSamplerTypes); |
| 2895 DCHECK_GE(blend_mode, 0); | 2900 DCHECK_GE(blend_mode, 0); |
| 2896 DCHECK_LT(blend_mode, NumBlendModes); | 2901 DCHECK_LT(blend_mode, NumBlendModes); |
| 2897 RenderPassMaskProgram* program = | 2902 RenderPassMaskProgram* program = |
| 2898 &render_pass_mask_program_[precision][blend_mode]; | 2903 &render_pass_mask_program_[precision][sampler][blend_mode]; |
| 2899 if (!program->initialized()) { | 2904 if (!program->initialized()) { |
| 2900 TRACE_EVENT0("cc", "GLRenderer::renderPassMaskProgram::initialize"); | 2905 TRACE_EVENT0("cc", "GLRenderer::renderPassMaskProgram::initialize"); |
| 2901 program->Initialize(output_surface_->context_provider(), | 2906 program->Initialize( |
| 2902 precision, | 2907 output_surface_->context_provider(), precision, sampler, blend_mode); |
| 2903 SamplerType2D, | |
| 2904 blend_mode); | |
| 2905 } | 2908 } |
| 2906 return program; | 2909 return program; |
| 2907 } | 2910 } |
| 2908 | 2911 |
| 2909 const GLRenderer::RenderPassMaskProgramAA* | 2912 const GLRenderer::RenderPassMaskProgramAA* |
| 2910 GLRenderer::GetRenderPassMaskProgramAA(TexCoordPrecision precision, | 2913 GLRenderer::GetRenderPassMaskProgramAA(TexCoordPrecision precision, |
| 2914 SamplerType sampler, |
| 2911 BlendMode blend_mode) { | 2915 BlendMode blend_mode) { |
| 2912 DCHECK_GE(precision, 0); | 2916 DCHECK_GE(precision, 0); |
| 2913 DCHECK_LT(precision, NumTexCoordPrecisions); | 2917 DCHECK_LT(precision, NumTexCoordPrecisions); |
| 2918 DCHECK_GE(sampler, 0); |
| 2919 DCHECK_LT(sampler, NumSamplerTypes); |
| 2914 DCHECK_GE(blend_mode, 0); | 2920 DCHECK_GE(blend_mode, 0); |
| 2915 DCHECK_LT(blend_mode, NumBlendModes); | 2921 DCHECK_LT(blend_mode, NumBlendModes); |
| 2916 RenderPassMaskProgramAA* program = | 2922 RenderPassMaskProgramAA* program = |
| 2917 &render_pass_mask_program_aa_[precision][blend_mode]; | 2923 &render_pass_mask_program_aa_[precision][sampler][blend_mode]; |
| 2918 if (!program->initialized()) { | 2924 if (!program->initialized()) { |
| 2919 TRACE_EVENT0("cc", "GLRenderer::renderPassMaskProgramAA::initialize"); | 2925 TRACE_EVENT0("cc", "GLRenderer::renderPassMaskProgramAA::initialize"); |
| 2920 program->Initialize(output_surface_->context_provider(), | 2926 program->Initialize( |
| 2921 precision, | 2927 output_surface_->context_provider(), precision, sampler, blend_mode); |
| 2922 SamplerType2D, | |
| 2923 blend_mode); | |
| 2924 } | 2928 } |
| 2925 return program; | 2929 return program; |
| 2926 } | 2930 } |
| 2927 | 2931 |
| 2928 const GLRenderer::RenderPassColorMatrixProgram* | 2932 const GLRenderer::RenderPassColorMatrixProgram* |
| 2929 GLRenderer::GetRenderPassColorMatrixProgram(TexCoordPrecision precision, | 2933 GLRenderer::GetRenderPassColorMatrixProgram(TexCoordPrecision precision, |
| 2930 BlendMode blend_mode) { | 2934 BlendMode blend_mode) { |
| 2931 DCHECK_GE(precision, 0); | 2935 DCHECK_GE(precision, 0); |
| 2932 DCHECK_LT(precision, NumTexCoordPrecisions); | 2936 DCHECK_LT(precision, NumTexCoordPrecisions); |
| 2933 DCHECK_GE(blend_mode, 0); | 2937 DCHECK_GE(blend_mode, 0); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 2959 program->Initialize(output_surface_->context_provider(), | 2963 program->Initialize(output_surface_->context_provider(), |
| 2960 precision, | 2964 precision, |
| 2961 SamplerType2D, | 2965 SamplerType2D, |
| 2962 blend_mode); | 2966 blend_mode); |
| 2963 } | 2967 } |
| 2964 return program; | 2968 return program; |
| 2965 } | 2969 } |
| 2966 | 2970 |
| 2967 const GLRenderer::RenderPassMaskColorMatrixProgram* | 2971 const GLRenderer::RenderPassMaskColorMatrixProgram* |
| 2968 GLRenderer::GetRenderPassMaskColorMatrixProgram(TexCoordPrecision precision, | 2972 GLRenderer::GetRenderPassMaskColorMatrixProgram(TexCoordPrecision precision, |
| 2973 SamplerType sampler, |
| 2969 BlendMode blend_mode) { | 2974 BlendMode blend_mode) { |
| 2970 DCHECK_GE(precision, 0); | 2975 DCHECK_GE(precision, 0); |
| 2971 DCHECK_LT(precision, NumTexCoordPrecisions); | 2976 DCHECK_LT(precision, NumTexCoordPrecisions); |
| 2977 DCHECK_GE(sampler, 0); |
| 2978 DCHECK_LT(sampler, NumSamplerTypes); |
| 2972 DCHECK_GE(blend_mode, 0); | 2979 DCHECK_GE(blend_mode, 0); |
| 2973 DCHECK_LT(blend_mode, NumBlendModes); | 2980 DCHECK_LT(blend_mode, NumBlendModes); |
| 2974 RenderPassMaskColorMatrixProgram* program = | 2981 RenderPassMaskColorMatrixProgram* program = |
| 2975 &render_pass_mask_color_matrix_program_[precision][blend_mode]; | 2982 &render_pass_mask_color_matrix_program_[precision][sampler][blend_mode]; |
| 2976 if (!program->initialized()) { | 2983 if (!program->initialized()) { |
| 2977 TRACE_EVENT0("cc", | 2984 TRACE_EVENT0("cc", |
| 2978 "GLRenderer::renderPassMaskColorMatrixProgram::initialize"); | 2985 "GLRenderer::renderPassMaskColorMatrixProgram::initialize"); |
| 2979 program->Initialize(output_surface_->context_provider(), | 2986 program->Initialize( |
| 2980 precision, | 2987 output_surface_->context_provider(), precision, sampler, blend_mode); |
| 2981 SamplerType2D, | |
| 2982 blend_mode); | |
| 2983 } | 2988 } |
| 2984 return program; | 2989 return program; |
| 2985 } | 2990 } |
| 2986 | 2991 |
| 2987 const GLRenderer::RenderPassMaskColorMatrixProgramAA* | 2992 const GLRenderer::RenderPassMaskColorMatrixProgramAA* |
| 2988 GLRenderer::GetRenderPassMaskColorMatrixProgramAA(TexCoordPrecision precision, | 2993 GLRenderer::GetRenderPassMaskColorMatrixProgramAA(TexCoordPrecision precision, |
| 2994 SamplerType sampler, |
| 2989 BlendMode blend_mode) { | 2995 BlendMode blend_mode) { |
| 2990 DCHECK_GE(precision, 0); | 2996 DCHECK_GE(precision, 0); |
| 2991 DCHECK_LT(precision, NumTexCoordPrecisions); | 2997 DCHECK_LT(precision, NumTexCoordPrecisions); |
| 2998 DCHECK_GE(sampler, 0); |
| 2999 DCHECK_LT(sampler, NumSamplerTypes); |
| 2992 DCHECK_GE(blend_mode, 0); | 3000 DCHECK_GE(blend_mode, 0); |
| 2993 DCHECK_LT(blend_mode, NumBlendModes); | 3001 DCHECK_LT(blend_mode, NumBlendModes); |
| 2994 RenderPassMaskColorMatrixProgramAA* program = | 3002 RenderPassMaskColorMatrixProgramAA* program = |
| 2995 &render_pass_mask_color_matrix_program_aa_[precision][blend_mode]; | 3003 &render_pass_mask_color_matrix_program_aa_[precision][sampler] |
| 3004 [blend_mode]; |
| 2996 if (!program->initialized()) { | 3005 if (!program->initialized()) { |
| 2997 TRACE_EVENT0("cc", | 3006 TRACE_EVENT0("cc", |
| 2998 "GLRenderer::renderPassMaskColorMatrixProgramAA::initialize"); | 3007 "GLRenderer::renderPassMaskColorMatrixProgramAA::initialize"); |
| 2999 program->Initialize(output_surface_->context_provider(), | 3008 program->Initialize( |
| 3000 precision, | 3009 output_surface_->context_provider(), precision, sampler, blend_mode); |
| 3001 SamplerType2D, | |
| 3002 blend_mode); | |
| 3003 } | 3010 } |
| 3004 return program; | 3011 return program; |
| 3005 } | 3012 } |
| 3006 | 3013 |
| 3007 const GLRenderer::TileProgram* GLRenderer::GetTileProgram( | 3014 const GLRenderer::TileProgram* GLRenderer::GetTileProgram( |
| 3008 TexCoordPrecision precision, | 3015 TexCoordPrecision precision, |
| 3009 SamplerType sampler) { | 3016 SamplerType sampler) { |
| 3010 DCHECK_GE(precision, 0); | 3017 DCHECK_GE(precision, 0); |
| 3011 DCHECK_LT(precision, NumTexCoordPrecisions); | 3018 DCHECK_LT(precision, NumTexCoordPrecisions); |
| 3012 DCHECK_GE(sampler, 0); | 3019 DCHECK_GE(sampler, 0); |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3217 shared_geometry_ = nullptr; | 3224 shared_geometry_ = nullptr; |
| 3218 | 3225 |
| 3219 for (int i = 0; i < NumTexCoordPrecisions; ++i) { | 3226 for (int i = 0; i < NumTexCoordPrecisions; ++i) { |
| 3220 for (int j = 0; j < NumSamplerTypes; ++j) { | 3227 for (int j = 0; j < NumSamplerTypes; ++j) { |
| 3221 tile_program_[i][j].Cleanup(gl_); | 3228 tile_program_[i][j].Cleanup(gl_); |
| 3222 tile_program_opaque_[i][j].Cleanup(gl_); | 3229 tile_program_opaque_[i][j].Cleanup(gl_); |
| 3223 tile_program_swizzle_[i][j].Cleanup(gl_); | 3230 tile_program_swizzle_[i][j].Cleanup(gl_); |
| 3224 tile_program_swizzle_opaque_[i][j].Cleanup(gl_); | 3231 tile_program_swizzle_opaque_[i][j].Cleanup(gl_); |
| 3225 tile_program_aa_[i][j].Cleanup(gl_); | 3232 tile_program_aa_[i][j].Cleanup(gl_); |
| 3226 tile_program_swizzle_aa_[i][j].Cleanup(gl_); | 3233 tile_program_swizzle_aa_[i][j].Cleanup(gl_); |
| 3234 |
| 3235 for (int k = 0; k < NumBlendModes; k++) { |
| 3236 render_pass_mask_program_[i][j][k].Cleanup(gl_); |
| 3237 render_pass_mask_program_aa_[i][j][k].Cleanup(gl_); |
| 3238 render_pass_mask_color_matrix_program_aa_[i][j][k].Cleanup(gl_); |
| 3239 render_pass_mask_color_matrix_program_[i][j][k].Cleanup(gl_); |
| 3240 } |
| 3227 } | 3241 } |
| 3228 for (int j = 0; j < NumBlendModes; j++) { | 3242 for (int j = 0; j < NumBlendModes; j++) { |
| 3229 render_pass_mask_program_[i][j].Cleanup(gl_); | |
| 3230 render_pass_program_[i][j].Cleanup(gl_); | 3243 render_pass_program_[i][j].Cleanup(gl_); |
| 3231 render_pass_mask_program_aa_[i][j].Cleanup(gl_); | |
| 3232 render_pass_program_aa_[i][j].Cleanup(gl_); | 3244 render_pass_program_aa_[i][j].Cleanup(gl_); |
| 3233 render_pass_color_matrix_program_[i][j].Cleanup(gl_); | 3245 render_pass_color_matrix_program_[i][j].Cleanup(gl_); |
| 3234 render_pass_mask_color_matrix_program_aa_[i][j].Cleanup(gl_); | |
| 3235 render_pass_color_matrix_program_aa_[i][j].Cleanup(gl_); | 3246 render_pass_color_matrix_program_aa_[i][j].Cleanup(gl_); |
| 3236 render_pass_mask_color_matrix_program_[i][j].Cleanup(gl_); | |
| 3237 } | 3247 } |
| 3238 | 3248 |
| 3239 texture_program_[i].Cleanup(gl_); | 3249 texture_program_[i].Cleanup(gl_); |
| 3240 nonpremultiplied_texture_program_[i].Cleanup(gl_); | 3250 nonpremultiplied_texture_program_[i].Cleanup(gl_); |
| 3241 texture_background_program_[i].Cleanup(gl_); | 3251 texture_background_program_[i].Cleanup(gl_); |
| 3242 nonpremultiplied_texture_background_program_[i].Cleanup(gl_); | 3252 nonpremultiplied_texture_background_program_[i].Cleanup(gl_); |
| 3243 texture_io_surface_program_[i].Cleanup(gl_); | 3253 texture_io_surface_program_[i].Cleanup(gl_); |
| 3244 | 3254 |
| 3245 video_yuv_program_[i].Cleanup(gl_); | 3255 video_yuv_program_[i].Cleanup(gl_); |
| 3246 video_yuva_program_[i].Cleanup(gl_); | 3256 video_yuva_program_[i].Cleanup(gl_); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3336 context_support_->ScheduleOverlayPlane( | 3346 context_support_->ScheduleOverlayPlane( |
| 3337 overlay.plane_z_order, | 3347 overlay.plane_z_order, |
| 3338 overlay.transform, | 3348 overlay.transform, |
| 3339 pending_overlay_resources_.back()->texture_id(), | 3349 pending_overlay_resources_.back()->texture_id(), |
| 3340 overlay.display_rect, | 3350 overlay.display_rect, |
| 3341 overlay.uv_rect); | 3351 overlay.uv_rect); |
| 3342 } | 3352 } |
| 3343 } | 3353 } |
| 3344 | 3354 |
| 3345 } // namespace cc | 3355 } // namespace cc |
| OLD | NEW |