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 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1185 int shader_tex_transform_location = -1; | 1185 int shader_tex_transform_location = -1; |
1186 int shader_backdrop_location = -1; | 1186 int shader_backdrop_location = -1; |
1187 int shader_backdrop_rect_location = -1; | 1187 int shader_backdrop_rect_location = -1; |
1188 | 1188 |
1189 BlendMode shader_blend_mode = ((background_texture || background_image) && | 1189 BlendMode shader_blend_mode = ((background_texture || background_image) && |
1190 !CanApplyBlendModeUsingBlendFunc(blend_mode)) | 1190 !CanApplyBlendModeUsingBlendFunc(blend_mode)) |
1191 ? BlendModeFromSkXfermode(blend_mode) | 1191 ? BlendModeFromSkXfermode(blend_mode) |
1192 : BlendModeNormal; | 1192 : BlendModeNormal; |
1193 | 1193 |
1194 if (use_aa && mask_texture_id && !use_color_matrix) { | 1194 if (use_aa && mask_texture_id && !use_color_matrix) { |
1195 const RenderPassMaskProgramAA* program = | 1195 const RenderPassMaskProgramAA* program = GetRenderPassMaskProgramAA( |
1196 GetRenderPassMaskProgramAA(tex_coord_precision, shader_blend_mode); | 1196 tex_coord_precision, mask_sampler, shader_blend_mode); |
1197 SetUseProgram(program->program()); | 1197 SetUseProgram(program->program()); |
1198 GLC(gl_, gl_->Uniform1i(program->fragment_shader().sampler_location(), 0)); | 1198 GLC(gl_, gl_->Uniform1i(program->fragment_shader().sampler_location(), 0)); |
1199 | 1199 |
1200 shader_quad_location = program->vertex_shader().quad_location(); | 1200 shader_quad_location = program->vertex_shader().quad_location(); |
1201 shader_edge_location = program->vertex_shader().edge_location(); | 1201 shader_edge_location = program->vertex_shader().edge_location(); |
1202 shader_viewport_location = program->vertex_shader().viewport_location(); | 1202 shader_viewport_location = program->vertex_shader().viewport_location(); |
1203 shader_mask_sampler_location = | 1203 shader_mask_sampler_location = |
1204 program->fragment_shader().mask_sampler_location(); | 1204 program->fragment_shader().mask_sampler_location(); |
1205 shader_mask_tex_coord_scale_location = | 1205 shader_mask_tex_coord_scale_location = |
1206 program->fragment_shader().mask_tex_coord_scale_location(); | 1206 program->fragment_shader().mask_tex_coord_scale_location(); |
1207 shader_mask_tex_coord_offset_location = | 1207 shader_mask_tex_coord_offset_location = |
1208 program->fragment_shader().mask_tex_coord_offset_location(); | 1208 program->fragment_shader().mask_tex_coord_offset_location(); |
1209 shader_matrix_location = program->vertex_shader().matrix_location(); | 1209 shader_matrix_location = program->vertex_shader().matrix_location(); |
1210 shader_alpha_location = program->fragment_shader().alpha_location(); | 1210 shader_alpha_location = program->fragment_shader().alpha_location(); |
1211 shader_tex_transform_location = | 1211 shader_tex_transform_location = |
1212 program->vertex_shader().tex_transform_location(); | 1212 program->vertex_shader().tex_transform_location(); |
1213 shader_backdrop_location = program->fragment_shader().backdrop_location(); | 1213 shader_backdrop_location = program->fragment_shader().backdrop_location(); |
1214 shader_backdrop_rect_location = | 1214 shader_backdrop_rect_location = |
1215 program->fragment_shader().backdrop_rect_location(); | 1215 program->fragment_shader().backdrop_rect_location(); |
1216 } else if (!use_aa && mask_texture_id && !use_color_matrix) { | 1216 } else if (!use_aa && mask_texture_id && !use_color_matrix) { |
1217 const RenderPassMaskProgram* program = | 1217 const RenderPassMaskProgram* program = GetRenderPassMaskProgram( |
1218 GetRenderPassMaskProgram(tex_coord_precision, shader_blend_mode); | 1218 tex_coord_precision, mask_sampler, shader_blend_mode); |
1219 SetUseProgram(program->program()); | 1219 SetUseProgram(program->program()); |
1220 GLC(gl_, gl_->Uniform1i(program->fragment_shader().sampler_location(), 0)); | 1220 GLC(gl_, gl_->Uniform1i(program->fragment_shader().sampler_location(), 0)); |
1221 | 1221 |
1222 shader_mask_sampler_location = | 1222 shader_mask_sampler_location = |
1223 program->fragment_shader().mask_sampler_location(); | 1223 program->fragment_shader().mask_sampler_location(); |
1224 shader_mask_tex_coord_scale_location = | 1224 shader_mask_tex_coord_scale_location = |
1225 program->fragment_shader().mask_tex_coord_scale_location(); | 1225 program->fragment_shader().mask_tex_coord_scale_location(); |
1226 shader_mask_tex_coord_offset_location = | 1226 shader_mask_tex_coord_offset_location = |
1227 program->fragment_shader().mask_tex_coord_offset_location(); | 1227 program->fragment_shader().mask_tex_coord_offset_location(); |
1228 shader_matrix_location = program->vertex_shader().matrix_location(); | 1228 shader_matrix_location = program->vertex_shader().matrix_location(); |
(...skipping 14 matching lines...) Expand all Loading... |
1243 shader_viewport_location = program->vertex_shader().viewport_location(); | 1243 shader_viewport_location = program->vertex_shader().viewport_location(); |
1244 shader_matrix_location = program->vertex_shader().matrix_location(); | 1244 shader_matrix_location = program->vertex_shader().matrix_location(); |
1245 shader_alpha_location = program->fragment_shader().alpha_location(); | 1245 shader_alpha_location = program->fragment_shader().alpha_location(); |
1246 shader_tex_transform_location = | 1246 shader_tex_transform_location = |
1247 program->vertex_shader().tex_transform_location(); | 1247 program->vertex_shader().tex_transform_location(); |
1248 shader_backdrop_location = program->fragment_shader().backdrop_location(); | 1248 shader_backdrop_location = program->fragment_shader().backdrop_location(); |
1249 shader_backdrop_rect_location = | 1249 shader_backdrop_rect_location = |
1250 program->fragment_shader().backdrop_rect_location(); | 1250 program->fragment_shader().backdrop_rect_location(); |
1251 } else if (use_aa && mask_texture_id && use_color_matrix) { | 1251 } else if (use_aa && mask_texture_id && use_color_matrix) { |
1252 const RenderPassMaskColorMatrixProgramAA* program = | 1252 const RenderPassMaskColorMatrixProgramAA* program = |
1253 GetRenderPassMaskColorMatrixProgramAA(tex_coord_precision, | 1253 GetRenderPassMaskColorMatrixProgramAA( |
1254 shader_blend_mode); | 1254 tex_coord_precision, mask_sampler, shader_blend_mode); |
1255 SetUseProgram(program->program()); | 1255 SetUseProgram(program->program()); |
1256 GLC(gl_, gl_->Uniform1i(program->fragment_shader().sampler_location(), 0)); | 1256 GLC(gl_, gl_->Uniform1i(program->fragment_shader().sampler_location(), 0)); |
1257 | 1257 |
1258 shader_matrix_location = program->vertex_shader().matrix_location(); | 1258 shader_matrix_location = program->vertex_shader().matrix_location(); |
1259 shader_quad_location = program->vertex_shader().quad_location(); | 1259 shader_quad_location = program->vertex_shader().quad_location(); |
1260 shader_tex_transform_location = | 1260 shader_tex_transform_location = |
1261 program->vertex_shader().tex_transform_location(); | 1261 program->vertex_shader().tex_transform_location(); |
1262 shader_edge_location = program->vertex_shader().edge_location(); | 1262 shader_edge_location = program->vertex_shader().edge_location(); |
1263 shader_viewport_location = program->vertex_shader().viewport_location(); | 1263 shader_viewport_location = program->vertex_shader().viewport_location(); |
1264 shader_alpha_location = program->fragment_shader().alpha_location(); | 1264 shader_alpha_location = program->fragment_shader().alpha_location(); |
(...skipping 26 matching lines...) Expand all Loading... |
1291 shader_alpha_location = program->fragment_shader().alpha_location(); | 1291 shader_alpha_location = program->fragment_shader().alpha_location(); |
1292 shader_color_matrix_location = | 1292 shader_color_matrix_location = |
1293 program->fragment_shader().color_matrix_location(); | 1293 program->fragment_shader().color_matrix_location(); |
1294 shader_color_offset_location = | 1294 shader_color_offset_location = |
1295 program->fragment_shader().color_offset_location(); | 1295 program->fragment_shader().color_offset_location(); |
1296 shader_backdrop_location = program->fragment_shader().backdrop_location(); | 1296 shader_backdrop_location = program->fragment_shader().backdrop_location(); |
1297 shader_backdrop_rect_location = | 1297 shader_backdrop_rect_location = |
1298 program->fragment_shader().backdrop_rect_location(); | 1298 program->fragment_shader().backdrop_rect_location(); |
1299 } else if (!use_aa && mask_texture_id && use_color_matrix) { | 1299 } else if (!use_aa && mask_texture_id && use_color_matrix) { |
1300 const RenderPassMaskColorMatrixProgram* program = | 1300 const RenderPassMaskColorMatrixProgram* program = |
1301 GetRenderPassMaskColorMatrixProgram(tex_coord_precision, | 1301 GetRenderPassMaskColorMatrixProgram( |
1302 shader_blend_mode); | 1302 tex_coord_precision, mask_sampler, shader_blend_mode); |
1303 SetUseProgram(program->program()); | 1303 SetUseProgram(program->program()); |
1304 GLC(gl_, gl_->Uniform1i(program->fragment_shader().sampler_location(), 0)); | 1304 GLC(gl_, gl_->Uniform1i(program->fragment_shader().sampler_location(), 0)); |
1305 | 1305 |
1306 shader_matrix_location = program->vertex_shader().matrix_location(); | 1306 shader_matrix_location = program->vertex_shader().matrix_location(); |
1307 shader_tex_transform_location = | 1307 shader_tex_transform_location = |
1308 program->vertex_shader().tex_transform_location(); | 1308 program->vertex_shader().tex_transform_location(); |
1309 shader_mask_sampler_location = | 1309 shader_mask_sampler_location = |
1310 program->fragment_shader().mask_sampler_location(); | 1310 program->fragment_shader().mask_sampler_location(); |
1311 shader_mask_tex_coord_scale_location = | 1311 shader_mask_tex_coord_scale_location = |
1312 program->fragment_shader().mask_tex_coord_scale_location(); | 1312 program->fragment_shader().mask_tex_coord_scale_location(); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1363 // texture is already oriented the same way as the framebuffer, but the | 1363 // texture is already oriented the same way as the framebuffer, but the |
1364 // projection transform does a flip. | 1364 // projection transform does a flip. |
1365 GLC(gl_, | 1365 GLC(gl_, |
1366 gl_->Uniform4f(shader_tex_transform_location, | 1366 gl_->Uniform4f(shader_tex_transform_location, |
1367 0.0f, | 1367 0.0f, |
1368 tex_scale_y, | 1368 tex_scale_y, |
1369 tex_scale_x, | 1369 tex_scale_x, |
1370 -tex_scale_y)); | 1370 -tex_scale_y)); |
1371 | 1371 |
1372 GLint last_texture_unit = 0; | 1372 GLint last_texture_unit = 0; |
1373 scoped_ptr<ResourceProvider::ScopedSamplerGL> shader_mask_sampler_lock; | |
1374 if (shader_mask_sampler_location != -1) { | 1373 if (shader_mask_sampler_location != -1) { |
1375 DCHECK_NE(shader_mask_tex_coord_scale_location, 1); | 1374 DCHECK_NE(shader_mask_tex_coord_scale_location, 1); |
1376 DCHECK_NE(shader_mask_tex_coord_offset_location, 1); | 1375 DCHECK_NE(shader_mask_tex_coord_offset_location, 1); |
1377 DCHECK_EQ(SamplerType2D, mask_sampler); | |
1378 GLC(gl_, gl_->Uniform1i(shader_mask_sampler_location, 1)); | 1376 GLC(gl_, gl_->Uniform1i(shader_mask_sampler_location, 1)); |
1379 | 1377 |
1380 gfx::RectF mask_uv_rect = quad->MaskUVRect(); | 1378 gfx::RectF mask_uv_rect = quad->MaskUVRect(); |
| 1379 if (mask_sampler != SamplerType2D) { |
| 1380 mask_uv_rect.Scale(quad->mask_texture_size.width(), |
| 1381 quad->mask_texture_size.height()); |
| 1382 } |
1381 | 1383 |
1382 // Mask textures are oriented vertically flipped relative to the framebuffer | 1384 // Mask textures are oriented vertically flipped relative to the framebuffer |
1383 // and the RenderPass contents texture, so we flip the tex coords from the | 1385 // and the RenderPass contents texture, so we flip the tex coords from the |
1384 // RenderPass texture to find the mask texture coords. | 1386 // RenderPass texture to find the mask texture coords. |
1385 GLC(gl_, | 1387 GLC(gl_, |
1386 gl_->Uniform2f(shader_mask_tex_coord_offset_location, | 1388 gl_->Uniform2f(shader_mask_tex_coord_offset_location, |
1387 mask_uv_rect.x(), | 1389 mask_uv_rect.x(), |
1388 mask_uv_rect.bottom())); | 1390 mask_uv_rect.bottom())); |
1389 GLC(gl_, | 1391 GLC(gl_, |
1390 gl_->Uniform2f(shader_mask_tex_coord_scale_location, | 1392 gl_->Uniform2f(shader_mask_tex_coord_scale_location, |
(...skipping 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2904 program->Initialize(output_surface_->context_provider(), | 2906 program->Initialize(output_surface_->context_provider(), |
2905 precision, | 2907 precision, |
2906 SamplerType2D, | 2908 SamplerType2D, |
2907 blend_mode); | 2909 blend_mode); |
2908 } | 2910 } |
2909 return program; | 2911 return program; |
2910 } | 2912 } |
2911 | 2913 |
2912 const GLRenderer::RenderPassMaskProgram* GLRenderer::GetRenderPassMaskProgram( | 2914 const GLRenderer::RenderPassMaskProgram* GLRenderer::GetRenderPassMaskProgram( |
2913 TexCoordPrecision precision, | 2915 TexCoordPrecision precision, |
| 2916 SamplerType sampler, |
2914 BlendMode blend_mode) { | 2917 BlendMode blend_mode) { |
2915 DCHECK_GE(precision, 0); | 2918 DCHECK_GE(precision, 0); |
2916 DCHECK_LT(precision, NumTexCoordPrecisions); | 2919 DCHECK_LT(precision, NumTexCoordPrecisions); |
| 2920 DCHECK_GE(sampler, 0); |
| 2921 DCHECK_LT(sampler, NumSamplerTypes); |
2917 DCHECK_GE(blend_mode, 0); | 2922 DCHECK_GE(blend_mode, 0); |
2918 DCHECK_LT(blend_mode, NumBlendModes); | 2923 DCHECK_LT(blend_mode, NumBlendModes); |
2919 RenderPassMaskProgram* program = | 2924 RenderPassMaskProgram* program = |
2920 &render_pass_mask_program_[precision][blend_mode]; | 2925 &render_pass_mask_program_[precision][sampler][blend_mode]; |
2921 if (!program->initialized()) { | 2926 if (!program->initialized()) { |
2922 TRACE_EVENT0("cc", "GLRenderer::renderPassMaskProgram::initialize"); | 2927 TRACE_EVENT0("cc", "GLRenderer::renderPassMaskProgram::initialize"); |
2923 program->Initialize(output_surface_->context_provider(), | 2928 program->Initialize( |
2924 precision, | 2929 output_surface_->context_provider(), precision, sampler, blend_mode); |
2925 SamplerType2D, | |
2926 blend_mode); | |
2927 } | 2930 } |
2928 return program; | 2931 return program; |
2929 } | 2932 } |
2930 | 2933 |
2931 const GLRenderer::RenderPassMaskProgramAA* | 2934 const GLRenderer::RenderPassMaskProgramAA* |
2932 GLRenderer::GetRenderPassMaskProgramAA(TexCoordPrecision precision, | 2935 GLRenderer::GetRenderPassMaskProgramAA(TexCoordPrecision precision, |
| 2936 SamplerType sampler, |
2933 BlendMode blend_mode) { | 2937 BlendMode blend_mode) { |
2934 DCHECK_GE(precision, 0); | 2938 DCHECK_GE(precision, 0); |
2935 DCHECK_LT(precision, NumTexCoordPrecisions); | 2939 DCHECK_LT(precision, NumTexCoordPrecisions); |
| 2940 DCHECK_GE(sampler, 0); |
| 2941 DCHECK_LT(sampler, NumSamplerTypes); |
2936 DCHECK_GE(blend_mode, 0); | 2942 DCHECK_GE(blend_mode, 0); |
2937 DCHECK_LT(blend_mode, NumBlendModes); | 2943 DCHECK_LT(blend_mode, NumBlendModes); |
2938 RenderPassMaskProgramAA* program = | 2944 RenderPassMaskProgramAA* program = |
2939 &render_pass_mask_program_aa_[precision][blend_mode]; | 2945 &render_pass_mask_program_aa_[precision][sampler][blend_mode]; |
2940 if (!program->initialized()) { | 2946 if (!program->initialized()) { |
2941 TRACE_EVENT0("cc", "GLRenderer::renderPassMaskProgramAA::initialize"); | 2947 TRACE_EVENT0("cc", "GLRenderer::renderPassMaskProgramAA::initialize"); |
2942 program->Initialize(output_surface_->context_provider(), | 2948 program->Initialize( |
2943 precision, | 2949 output_surface_->context_provider(), precision, sampler, blend_mode); |
2944 SamplerType2D, | |
2945 blend_mode); | |
2946 } | 2950 } |
2947 return program; | 2951 return program; |
2948 } | 2952 } |
2949 | 2953 |
2950 const GLRenderer::RenderPassColorMatrixProgram* | 2954 const GLRenderer::RenderPassColorMatrixProgram* |
2951 GLRenderer::GetRenderPassColorMatrixProgram(TexCoordPrecision precision, | 2955 GLRenderer::GetRenderPassColorMatrixProgram(TexCoordPrecision precision, |
2952 BlendMode blend_mode) { | 2956 BlendMode blend_mode) { |
2953 DCHECK_GE(precision, 0); | 2957 DCHECK_GE(precision, 0); |
2954 DCHECK_LT(precision, NumTexCoordPrecisions); | 2958 DCHECK_LT(precision, NumTexCoordPrecisions); |
2955 DCHECK_GE(blend_mode, 0); | 2959 DCHECK_GE(blend_mode, 0); |
(...skipping 25 matching lines...) Expand all Loading... |
2981 program->Initialize(output_surface_->context_provider(), | 2985 program->Initialize(output_surface_->context_provider(), |
2982 precision, | 2986 precision, |
2983 SamplerType2D, | 2987 SamplerType2D, |
2984 blend_mode); | 2988 blend_mode); |
2985 } | 2989 } |
2986 return program; | 2990 return program; |
2987 } | 2991 } |
2988 | 2992 |
2989 const GLRenderer::RenderPassMaskColorMatrixProgram* | 2993 const GLRenderer::RenderPassMaskColorMatrixProgram* |
2990 GLRenderer::GetRenderPassMaskColorMatrixProgram(TexCoordPrecision precision, | 2994 GLRenderer::GetRenderPassMaskColorMatrixProgram(TexCoordPrecision precision, |
| 2995 SamplerType sampler, |
2991 BlendMode blend_mode) { | 2996 BlendMode blend_mode) { |
2992 DCHECK_GE(precision, 0); | 2997 DCHECK_GE(precision, 0); |
2993 DCHECK_LT(precision, NumTexCoordPrecisions); | 2998 DCHECK_LT(precision, NumTexCoordPrecisions); |
| 2999 DCHECK_GE(sampler, 0); |
| 3000 DCHECK_LT(sampler, NumSamplerTypes); |
2994 DCHECK_GE(blend_mode, 0); | 3001 DCHECK_GE(blend_mode, 0); |
2995 DCHECK_LT(blend_mode, NumBlendModes); | 3002 DCHECK_LT(blend_mode, NumBlendModes); |
2996 RenderPassMaskColorMatrixProgram* program = | 3003 RenderPassMaskColorMatrixProgram* program = |
2997 &render_pass_mask_color_matrix_program_[precision][blend_mode]; | 3004 &render_pass_mask_color_matrix_program_[precision][sampler][blend_mode]; |
2998 if (!program->initialized()) { | 3005 if (!program->initialized()) { |
2999 TRACE_EVENT0("cc", | 3006 TRACE_EVENT0("cc", |
3000 "GLRenderer::renderPassMaskColorMatrixProgram::initialize"); | 3007 "GLRenderer::renderPassMaskColorMatrixProgram::initialize"); |
3001 program->Initialize(output_surface_->context_provider(), | 3008 program->Initialize( |
3002 precision, | 3009 output_surface_->context_provider(), precision, sampler, blend_mode); |
3003 SamplerType2D, | |
3004 blend_mode); | |
3005 } | 3010 } |
3006 return program; | 3011 return program; |
3007 } | 3012 } |
3008 | 3013 |
3009 const GLRenderer::RenderPassMaskColorMatrixProgramAA* | 3014 const GLRenderer::RenderPassMaskColorMatrixProgramAA* |
3010 GLRenderer::GetRenderPassMaskColorMatrixProgramAA(TexCoordPrecision precision, | 3015 GLRenderer::GetRenderPassMaskColorMatrixProgramAA(TexCoordPrecision precision, |
| 3016 SamplerType sampler, |
3011 BlendMode blend_mode) { | 3017 BlendMode blend_mode) { |
3012 DCHECK_GE(precision, 0); | 3018 DCHECK_GE(precision, 0); |
3013 DCHECK_LT(precision, NumTexCoordPrecisions); | 3019 DCHECK_LT(precision, NumTexCoordPrecisions); |
| 3020 DCHECK_GE(sampler, 0); |
| 3021 DCHECK_LT(sampler, NumSamplerTypes); |
3014 DCHECK_GE(blend_mode, 0); | 3022 DCHECK_GE(blend_mode, 0); |
3015 DCHECK_LT(blend_mode, NumBlendModes); | 3023 DCHECK_LT(blend_mode, NumBlendModes); |
3016 RenderPassMaskColorMatrixProgramAA* program = | 3024 RenderPassMaskColorMatrixProgramAA* program = |
3017 &render_pass_mask_color_matrix_program_aa_[precision][blend_mode]; | 3025 &render_pass_mask_color_matrix_program_aa_[precision][sampler] |
| 3026 [blend_mode]; |
3018 if (!program->initialized()) { | 3027 if (!program->initialized()) { |
3019 TRACE_EVENT0("cc", | 3028 TRACE_EVENT0("cc", |
3020 "GLRenderer::renderPassMaskColorMatrixProgramAA::initialize"); | 3029 "GLRenderer::renderPassMaskColorMatrixProgramAA::initialize"); |
3021 program->Initialize(output_surface_->context_provider(), | 3030 program->Initialize( |
3022 precision, | 3031 output_surface_->context_provider(), precision, sampler, blend_mode); |
3023 SamplerType2D, | |
3024 blend_mode); | |
3025 } | 3032 } |
3026 return program; | 3033 return program; |
3027 } | 3034 } |
3028 | 3035 |
3029 const GLRenderer::TileProgram* GLRenderer::GetTileProgram( | 3036 const GLRenderer::TileProgram* GLRenderer::GetTileProgram( |
3030 TexCoordPrecision precision, | 3037 TexCoordPrecision precision, |
3031 SamplerType sampler) { | 3038 SamplerType sampler) { |
3032 DCHECK_GE(precision, 0); | 3039 DCHECK_GE(precision, 0); |
3033 DCHECK_LT(precision, NumTexCoordPrecisions); | 3040 DCHECK_LT(precision, NumTexCoordPrecisions); |
3034 DCHECK_GE(sampler, 0); | 3041 DCHECK_GE(sampler, 0); |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3239 shared_geometry_ = nullptr; | 3246 shared_geometry_ = nullptr; |
3240 | 3247 |
3241 for (int i = 0; i < NumTexCoordPrecisions; ++i) { | 3248 for (int i = 0; i < NumTexCoordPrecisions; ++i) { |
3242 for (int j = 0; j < NumSamplerTypes; ++j) { | 3249 for (int j = 0; j < NumSamplerTypes; ++j) { |
3243 tile_program_[i][j].Cleanup(gl_); | 3250 tile_program_[i][j].Cleanup(gl_); |
3244 tile_program_opaque_[i][j].Cleanup(gl_); | 3251 tile_program_opaque_[i][j].Cleanup(gl_); |
3245 tile_program_swizzle_[i][j].Cleanup(gl_); | 3252 tile_program_swizzle_[i][j].Cleanup(gl_); |
3246 tile_program_swizzle_opaque_[i][j].Cleanup(gl_); | 3253 tile_program_swizzle_opaque_[i][j].Cleanup(gl_); |
3247 tile_program_aa_[i][j].Cleanup(gl_); | 3254 tile_program_aa_[i][j].Cleanup(gl_); |
3248 tile_program_swizzle_aa_[i][j].Cleanup(gl_); | 3255 tile_program_swizzle_aa_[i][j].Cleanup(gl_); |
| 3256 |
| 3257 for (int k = 0; k < NumBlendModes; k++) { |
| 3258 render_pass_mask_program_[i][j][k].Cleanup(gl_); |
| 3259 render_pass_mask_program_aa_[i][j][k].Cleanup(gl_); |
| 3260 render_pass_mask_color_matrix_program_aa_[i][j][k].Cleanup(gl_); |
| 3261 render_pass_mask_color_matrix_program_[i][j][k].Cleanup(gl_); |
| 3262 } |
3249 } | 3263 } |
3250 for (int j = 0; j < NumBlendModes; j++) { | 3264 for (int j = 0; j < NumBlendModes; j++) { |
3251 render_pass_mask_program_[i][j].Cleanup(gl_); | |
3252 render_pass_program_[i][j].Cleanup(gl_); | 3265 render_pass_program_[i][j].Cleanup(gl_); |
3253 render_pass_mask_program_aa_[i][j].Cleanup(gl_); | |
3254 render_pass_program_aa_[i][j].Cleanup(gl_); | 3266 render_pass_program_aa_[i][j].Cleanup(gl_); |
3255 render_pass_color_matrix_program_[i][j].Cleanup(gl_); | 3267 render_pass_color_matrix_program_[i][j].Cleanup(gl_); |
3256 render_pass_mask_color_matrix_program_aa_[i][j].Cleanup(gl_); | |
3257 render_pass_color_matrix_program_aa_[i][j].Cleanup(gl_); | 3268 render_pass_color_matrix_program_aa_[i][j].Cleanup(gl_); |
3258 render_pass_mask_color_matrix_program_[i][j].Cleanup(gl_); | |
3259 } | 3269 } |
3260 | 3270 |
3261 texture_program_[i].Cleanup(gl_); | 3271 texture_program_[i].Cleanup(gl_); |
3262 nonpremultiplied_texture_program_[i].Cleanup(gl_); | 3272 nonpremultiplied_texture_program_[i].Cleanup(gl_); |
3263 texture_background_program_[i].Cleanup(gl_); | 3273 texture_background_program_[i].Cleanup(gl_); |
3264 nonpremultiplied_texture_background_program_[i].Cleanup(gl_); | 3274 nonpremultiplied_texture_background_program_[i].Cleanup(gl_); |
3265 texture_io_surface_program_[i].Cleanup(gl_); | 3275 texture_io_surface_program_[i].Cleanup(gl_); |
3266 | 3276 |
3267 video_yuv_program_[i].Cleanup(gl_); | 3277 video_yuv_program_[i].Cleanup(gl_); |
3268 video_yuva_program_[i].Cleanup(gl_); | 3278 video_yuva_program_[i].Cleanup(gl_); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3358 context_support_->ScheduleOverlayPlane( | 3368 context_support_->ScheduleOverlayPlane( |
3359 overlay.plane_z_order, | 3369 overlay.plane_z_order, |
3360 overlay.transform, | 3370 overlay.transform, |
3361 pending_overlay_resources_.back()->texture_id(), | 3371 pending_overlay_resources_.back()->texture_id(), |
3362 overlay.display_rect, | 3372 overlay.display_rect, |
3363 overlay.uv_rect); | 3373 overlay.uv_rect); |
3364 } | 3374 } |
3365 } | 3375 } |
3366 | 3376 |
3367 } // namespace cc | 3377 } // namespace cc |
OLD | NEW |