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 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 int shader_tex_transform_location = -1; | 1117 int shader_tex_transform_location = -1; |
1118 int shader_backdrop_location = -1; | 1118 int shader_backdrop_location = -1; |
1119 int shader_backdrop_rect_location = -1; | 1119 int shader_backdrop_rect_location = -1; |
1120 | 1120 |
1121 BlendMode shader_blend_mode = ((background_texture || background_image) && | 1121 BlendMode shader_blend_mode = ((background_texture || background_image) && |
1122 !CanApplyBlendModeUsingBlendFunc(blend_mode)) | 1122 !CanApplyBlendModeUsingBlendFunc(blend_mode)) |
1123 ? BlendModeFromSkXfermode(blend_mode) | 1123 ? BlendModeFromSkXfermode(blend_mode) |
1124 : BlendModeNormal; | 1124 : BlendModeNormal; |
1125 | 1125 |
1126 if (use_aa && mask_texture_id && !use_color_matrix) { | 1126 if (use_aa && mask_texture_id && !use_color_matrix) { |
1127 const RenderPassMaskProgramAA* program = | 1127 const RenderPassMaskProgramAA* program = GetRenderPassMaskProgramAA( |
1128 GetRenderPassMaskProgramAA(tex_coord_precision, shader_blend_mode); | 1128 tex_coord_precision, mask_sampler, shader_blend_mode); |
1129 SetUseProgram(program->program()); | 1129 SetUseProgram(program->program()); |
1130 GLC(gl_, gl_->Uniform1i(program->fragment_shader().sampler_location(), 0)); | 1130 GLC(gl_, gl_->Uniform1i(program->fragment_shader().sampler_location(), 0)); |
1131 | 1131 |
1132 shader_quad_location = program->vertex_shader().quad_location(); | 1132 shader_quad_location = program->vertex_shader().quad_location(); |
1133 shader_edge_location = program->vertex_shader().edge_location(); | 1133 shader_edge_location = program->vertex_shader().edge_location(); |
1134 shader_viewport_location = program->vertex_shader().viewport_location(); | 1134 shader_viewport_location = program->vertex_shader().viewport_location(); |
1135 shader_mask_sampler_location = | 1135 shader_mask_sampler_location = |
1136 program->fragment_shader().mask_sampler_location(); | 1136 program->fragment_shader().mask_sampler_location(); |
1137 shader_mask_tex_coord_scale_location = | 1137 shader_mask_tex_coord_scale_location = |
1138 program->fragment_shader().mask_tex_coord_scale_location(); | 1138 program->fragment_shader().mask_tex_coord_scale_location(); |
1139 shader_mask_tex_coord_offset_location = | 1139 shader_mask_tex_coord_offset_location = |
1140 program->fragment_shader().mask_tex_coord_offset_location(); | 1140 program->fragment_shader().mask_tex_coord_offset_location(); |
1141 shader_matrix_location = program->vertex_shader().matrix_location(); | 1141 shader_matrix_location = program->vertex_shader().matrix_location(); |
1142 shader_alpha_location = program->fragment_shader().alpha_location(); | 1142 shader_alpha_location = program->fragment_shader().alpha_location(); |
1143 shader_tex_transform_location = | 1143 shader_tex_transform_location = |
1144 program->vertex_shader().tex_transform_location(); | 1144 program->vertex_shader().tex_transform_location(); |
1145 shader_backdrop_location = program->fragment_shader().backdrop_location(); | 1145 shader_backdrop_location = program->fragment_shader().backdrop_location(); |
1146 shader_backdrop_rect_location = | 1146 shader_backdrop_rect_location = |
1147 program->fragment_shader().backdrop_rect_location(); | 1147 program->fragment_shader().backdrop_rect_location(); |
1148 } else if (!use_aa && mask_texture_id && !use_color_matrix) { | 1148 } else if (!use_aa && mask_texture_id && !use_color_matrix) { |
1149 const RenderPassMaskProgram* program = | 1149 const RenderPassMaskProgram* program = GetRenderPassMaskProgram( |
1150 GetRenderPassMaskProgram(tex_coord_precision, shader_blend_mode); | 1150 tex_coord_precision, mask_sampler, shader_blend_mode); |
1151 SetUseProgram(program->program()); | 1151 SetUseProgram(program->program()); |
1152 GLC(gl_, gl_->Uniform1i(program->fragment_shader().sampler_location(), 0)); | 1152 GLC(gl_, gl_->Uniform1i(program->fragment_shader().sampler_location(), 0)); |
1153 | 1153 |
1154 shader_mask_sampler_location = | 1154 shader_mask_sampler_location = |
1155 program->fragment_shader().mask_sampler_location(); | 1155 program->fragment_shader().mask_sampler_location(); |
1156 shader_mask_tex_coord_scale_location = | 1156 shader_mask_tex_coord_scale_location = |
1157 program->fragment_shader().mask_tex_coord_scale_location(); | 1157 program->fragment_shader().mask_tex_coord_scale_location(); |
1158 shader_mask_tex_coord_offset_location = | 1158 shader_mask_tex_coord_offset_location = |
1159 program->fragment_shader().mask_tex_coord_offset_location(); | 1159 program->fragment_shader().mask_tex_coord_offset_location(); |
1160 shader_matrix_location = program->vertex_shader().matrix_location(); | 1160 shader_matrix_location = program->vertex_shader().matrix_location(); |
(...skipping 14 matching lines...) Expand all Loading... |
1175 shader_viewport_location = program->vertex_shader().viewport_location(); | 1175 shader_viewport_location = program->vertex_shader().viewport_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 RenderPassMaskColorMatrixProgramAA* program = | 1184 const RenderPassMaskColorMatrixProgramAA* program = |
1185 GetRenderPassMaskColorMatrixProgramAA(tex_coord_precision, | 1185 GetRenderPassMaskColorMatrixProgramAA( |
1186 shader_blend_mode); | 1186 tex_coord_precision, mask_sampler, shader_blend_mode); |
1187 SetUseProgram(program->program()); | 1187 SetUseProgram(program->program()); |
1188 GLC(gl_, gl_->Uniform1i(program->fragment_shader().sampler_location(), 0)); | 1188 GLC(gl_, gl_->Uniform1i(program->fragment_shader().sampler_location(), 0)); |
1189 | 1189 |
1190 shader_matrix_location = program->vertex_shader().matrix_location(); | 1190 shader_matrix_location = program->vertex_shader().matrix_location(); |
1191 shader_quad_location = program->vertex_shader().quad_location(); | 1191 shader_quad_location = program->vertex_shader().quad_location(); |
1192 shader_tex_transform_location = | 1192 shader_tex_transform_location = |
1193 program->vertex_shader().tex_transform_location(); | 1193 program->vertex_shader().tex_transform_location(); |
1194 shader_edge_location = program->vertex_shader().edge_location(); | 1194 shader_edge_location = program->vertex_shader().edge_location(); |
1195 shader_viewport_location = program->vertex_shader().viewport_location(); | 1195 shader_viewport_location = program->vertex_shader().viewport_location(); |
1196 shader_alpha_location = program->fragment_shader().alpha_location(); | 1196 shader_alpha_location = program->fragment_shader().alpha_location(); |
(...skipping 26 matching lines...) Expand all Loading... |
1223 shader_alpha_location = program->fragment_shader().alpha_location(); | 1223 shader_alpha_location = program->fragment_shader().alpha_location(); |
1224 shader_color_matrix_location = | 1224 shader_color_matrix_location = |
1225 program->fragment_shader().color_matrix_location(); | 1225 program->fragment_shader().color_matrix_location(); |
1226 shader_color_offset_location = | 1226 shader_color_offset_location = |
1227 program->fragment_shader().color_offset_location(); | 1227 program->fragment_shader().color_offset_location(); |
1228 shader_backdrop_location = program->fragment_shader().backdrop_location(); | 1228 shader_backdrop_location = program->fragment_shader().backdrop_location(); |
1229 shader_backdrop_rect_location = | 1229 shader_backdrop_rect_location = |
1230 program->fragment_shader().backdrop_rect_location(); | 1230 program->fragment_shader().backdrop_rect_location(); |
1231 } else if (!use_aa && mask_texture_id && use_color_matrix) { | 1231 } else if (!use_aa && mask_texture_id && use_color_matrix) { |
1232 const RenderPassMaskColorMatrixProgram* program = | 1232 const RenderPassMaskColorMatrixProgram* program = |
1233 GetRenderPassMaskColorMatrixProgram(tex_coord_precision, | 1233 GetRenderPassMaskColorMatrixProgram( |
1234 shader_blend_mode); | 1234 tex_coord_precision, mask_sampler, shader_blend_mode); |
1235 SetUseProgram(program->program()); | 1235 SetUseProgram(program->program()); |
1236 GLC(gl_, gl_->Uniform1i(program->fragment_shader().sampler_location(), 0)); | 1236 GLC(gl_, gl_->Uniform1i(program->fragment_shader().sampler_location(), 0)); |
1237 | 1237 |
1238 shader_matrix_location = program->vertex_shader().matrix_location(); | 1238 shader_matrix_location = program->vertex_shader().matrix_location(); |
1239 shader_tex_transform_location = | 1239 shader_tex_transform_location = |
1240 program->vertex_shader().tex_transform_location(); | 1240 program->vertex_shader().tex_transform_location(); |
1241 shader_mask_sampler_location = | 1241 shader_mask_sampler_location = |
1242 program->fragment_shader().mask_sampler_location(); | 1242 program->fragment_shader().mask_sampler_location(); |
1243 shader_mask_tex_coord_scale_location = | 1243 shader_mask_tex_coord_scale_location = |
1244 program->fragment_shader().mask_tex_coord_scale_location(); | 1244 program->fragment_shader().mask_tex_coord_scale_location(); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1295 // texture is already oriented the same way as the framebuffer, but the | 1295 // texture is already oriented the same way as the framebuffer, but the |
1296 // projection transform does a flip. | 1296 // projection transform does a flip. |
1297 GLC(gl_, | 1297 GLC(gl_, |
1298 gl_->Uniform4f(shader_tex_transform_location, | 1298 gl_->Uniform4f(shader_tex_transform_location, |
1299 0.0f, | 1299 0.0f, |
1300 tex_scale_y, | 1300 tex_scale_y, |
1301 tex_scale_x, | 1301 tex_scale_x, |
1302 -tex_scale_y)); | 1302 -tex_scale_y)); |
1303 | 1303 |
1304 GLint last_texture_unit = 0; | 1304 GLint last_texture_unit = 0; |
1305 scoped_ptr<ResourceProvider::ScopedSamplerGL> shader_mask_sampler_lock; | |
1306 if (shader_mask_sampler_location != -1) { | 1305 if (shader_mask_sampler_location != -1) { |
1307 DCHECK_NE(shader_mask_tex_coord_scale_location, 1); | 1306 DCHECK_NE(shader_mask_tex_coord_scale_location, 1); |
1308 DCHECK_NE(shader_mask_tex_coord_offset_location, 1); | 1307 DCHECK_NE(shader_mask_tex_coord_offset_location, 1); |
1309 DCHECK_EQ(SamplerType2D, mask_sampler); | |
1310 GLC(gl_, gl_->Uniform1i(shader_mask_sampler_location, 1)); | 1308 GLC(gl_, gl_->Uniform1i(shader_mask_sampler_location, 1)); |
1311 | 1309 |
1312 gfx::RectF mask_uv_rect = quad->MaskUVRect(); | 1310 gfx::RectF mask_uv_rect = quad->MaskUVRect(); |
| 1311 if (mask_sampler != SamplerType2D) { |
| 1312 mask_uv_rect.Scale(quad->mask_texture_size.width(), |
| 1313 quad->mask_texture_size.height()); |
| 1314 } |
1313 | 1315 |
1314 // Mask textures are oriented vertically flipped relative to the framebuffer | 1316 // Mask textures are oriented vertically flipped relative to the framebuffer |
1315 // and the RenderPass contents texture, so we flip the tex coords from the | 1317 // and the RenderPass contents texture, so we flip the tex coords from the |
1316 // RenderPass texture to find the mask texture coords. | 1318 // RenderPass texture to find the mask texture coords. |
1317 GLC(gl_, | 1319 GLC(gl_, |
1318 gl_->Uniform2f(shader_mask_tex_coord_offset_location, | 1320 gl_->Uniform2f(shader_mask_tex_coord_offset_location, |
1319 mask_uv_rect.x(), | 1321 mask_uv_rect.x(), |
1320 mask_uv_rect.bottom())); | 1322 mask_uv_rect.bottom())); |
1321 GLC(gl_, | 1323 GLC(gl_, |
1322 gl_->Uniform2f(shader_mask_tex_coord_scale_location, | 1324 gl_->Uniform2f(shader_mask_tex_coord_scale_location, |
(...skipping 1513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2836 program->Initialize(output_surface_->context_provider(), | 2838 program->Initialize(output_surface_->context_provider(), |
2837 precision, | 2839 precision, |
2838 SamplerType2D, | 2840 SamplerType2D, |
2839 blend_mode); | 2841 blend_mode); |
2840 } | 2842 } |
2841 return program; | 2843 return program; |
2842 } | 2844 } |
2843 | 2845 |
2844 const GLRenderer::RenderPassMaskProgram* GLRenderer::GetRenderPassMaskProgram( | 2846 const GLRenderer::RenderPassMaskProgram* GLRenderer::GetRenderPassMaskProgram( |
2845 TexCoordPrecision precision, | 2847 TexCoordPrecision precision, |
| 2848 SamplerType sampler, |
2846 BlendMode blend_mode) { | 2849 BlendMode blend_mode) { |
2847 DCHECK_GE(precision, 0); | 2850 DCHECK_GE(precision, 0); |
2848 DCHECK_LT(precision, NumTexCoordPrecisions); | 2851 DCHECK_LT(precision, NumTexCoordPrecisions); |
| 2852 DCHECK_GE(sampler, 0); |
| 2853 DCHECK_LT(sampler, NumSamplerTypes); |
2849 DCHECK_GE(blend_mode, 0); | 2854 DCHECK_GE(blend_mode, 0); |
2850 DCHECK_LT(blend_mode, NumBlendModes); | 2855 DCHECK_LT(blend_mode, NumBlendModes); |
2851 RenderPassMaskProgram* program = | 2856 RenderPassMaskProgram* program = |
2852 &render_pass_mask_program_[precision][blend_mode]; | 2857 &render_pass_mask_program_[precision][sampler][blend_mode]; |
2853 if (!program->initialized()) { | 2858 if (!program->initialized()) { |
2854 TRACE_EVENT0("cc", "GLRenderer::renderPassMaskProgram::initialize"); | 2859 TRACE_EVENT0("cc", "GLRenderer::renderPassMaskProgram::initialize"); |
2855 program->Initialize(output_surface_->context_provider(), | 2860 program->Initialize( |
2856 precision, | 2861 output_surface_->context_provider(), precision, sampler, blend_mode); |
2857 SamplerType2D, | |
2858 blend_mode); | |
2859 } | 2862 } |
2860 return program; | 2863 return program; |
2861 } | 2864 } |
2862 | 2865 |
2863 const GLRenderer::RenderPassMaskProgramAA* | 2866 const GLRenderer::RenderPassMaskProgramAA* |
2864 GLRenderer::GetRenderPassMaskProgramAA(TexCoordPrecision precision, | 2867 GLRenderer::GetRenderPassMaskProgramAA(TexCoordPrecision precision, |
| 2868 SamplerType sampler, |
2865 BlendMode blend_mode) { | 2869 BlendMode blend_mode) { |
2866 DCHECK_GE(precision, 0); | 2870 DCHECK_GE(precision, 0); |
2867 DCHECK_LT(precision, NumTexCoordPrecisions); | 2871 DCHECK_LT(precision, NumTexCoordPrecisions); |
| 2872 DCHECK_GE(sampler, 0); |
| 2873 DCHECK_LT(sampler, NumSamplerTypes); |
2868 DCHECK_GE(blend_mode, 0); | 2874 DCHECK_GE(blend_mode, 0); |
2869 DCHECK_LT(blend_mode, NumBlendModes); | 2875 DCHECK_LT(blend_mode, NumBlendModes); |
2870 RenderPassMaskProgramAA* program = | 2876 RenderPassMaskProgramAA* program = |
2871 &render_pass_mask_program_aa_[precision][blend_mode]; | 2877 &render_pass_mask_program_aa_[precision][sampler][blend_mode]; |
2872 if (!program->initialized()) { | 2878 if (!program->initialized()) { |
2873 TRACE_EVENT0("cc", "GLRenderer::renderPassMaskProgramAA::initialize"); | 2879 TRACE_EVENT0("cc", "GLRenderer::renderPassMaskProgramAA::initialize"); |
2874 program->Initialize(output_surface_->context_provider(), | 2880 program->Initialize( |
2875 precision, | 2881 output_surface_->context_provider(), precision, sampler, blend_mode); |
2876 SamplerType2D, | |
2877 blend_mode); | |
2878 } | 2882 } |
2879 return program; | 2883 return program; |
2880 } | 2884 } |
2881 | 2885 |
2882 const GLRenderer::RenderPassColorMatrixProgram* | 2886 const GLRenderer::RenderPassColorMatrixProgram* |
2883 GLRenderer::GetRenderPassColorMatrixProgram(TexCoordPrecision precision, | 2887 GLRenderer::GetRenderPassColorMatrixProgram(TexCoordPrecision precision, |
2884 BlendMode blend_mode) { | 2888 BlendMode blend_mode) { |
2885 DCHECK_GE(precision, 0); | 2889 DCHECK_GE(precision, 0); |
2886 DCHECK_LT(precision, NumTexCoordPrecisions); | 2890 DCHECK_LT(precision, NumTexCoordPrecisions); |
2887 DCHECK_GE(blend_mode, 0); | 2891 DCHECK_GE(blend_mode, 0); |
(...skipping 25 matching lines...) Expand all Loading... |
2913 program->Initialize(output_surface_->context_provider(), | 2917 program->Initialize(output_surface_->context_provider(), |
2914 precision, | 2918 precision, |
2915 SamplerType2D, | 2919 SamplerType2D, |
2916 blend_mode); | 2920 blend_mode); |
2917 } | 2921 } |
2918 return program; | 2922 return program; |
2919 } | 2923 } |
2920 | 2924 |
2921 const GLRenderer::RenderPassMaskColorMatrixProgram* | 2925 const GLRenderer::RenderPassMaskColorMatrixProgram* |
2922 GLRenderer::GetRenderPassMaskColorMatrixProgram(TexCoordPrecision precision, | 2926 GLRenderer::GetRenderPassMaskColorMatrixProgram(TexCoordPrecision precision, |
| 2927 SamplerType sampler, |
2923 BlendMode blend_mode) { | 2928 BlendMode blend_mode) { |
2924 DCHECK_GE(precision, 0); | 2929 DCHECK_GE(precision, 0); |
2925 DCHECK_LT(precision, NumTexCoordPrecisions); | 2930 DCHECK_LT(precision, NumTexCoordPrecisions); |
| 2931 DCHECK_GE(sampler, 0); |
| 2932 DCHECK_LT(sampler, NumSamplerTypes); |
2926 DCHECK_GE(blend_mode, 0); | 2933 DCHECK_GE(blend_mode, 0); |
2927 DCHECK_LT(blend_mode, NumBlendModes); | 2934 DCHECK_LT(blend_mode, NumBlendModes); |
2928 RenderPassMaskColorMatrixProgram* program = | 2935 RenderPassMaskColorMatrixProgram* program = |
2929 &render_pass_mask_color_matrix_program_[precision][blend_mode]; | 2936 &render_pass_mask_color_matrix_program_[precision][sampler][blend_mode]; |
2930 if (!program->initialized()) { | 2937 if (!program->initialized()) { |
2931 TRACE_EVENT0("cc", | 2938 TRACE_EVENT0("cc", |
2932 "GLRenderer::renderPassMaskColorMatrixProgram::initialize"); | 2939 "GLRenderer::renderPassMaskColorMatrixProgram::initialize"); |
2933 program->Initialize(output_surface_->context_provider(), | 2940 program->Initialize( |
2934 precision, | 2941 output_surface_->context_provider(), precision, sampler, blend_mode); |
2935 SamplerType2D, | |
2936 blend_mode); | |
2937 } | 2942 } |
2938 return program; | 2943 return program; |
2939 } | 2944 } |
2940 | 2945 |
2941 const GLRenderer::RenderPassMaskColorMatrixProgramAA* | 2946 const GLRenderer::RenderPassMaskColorMatrixProgramAA* |
2942 GLRenderer::GetRenderPassMaskColorMatrixProgramAA(TexCoordPrecision precision, | 2947 GLRenderer::GetRenderPassMaskColorMatrixProgramAA(TexCoordPrecision precision, |
| 2948 SamplerType sampler, |
2943 BlendMode blend_mode) { | 2949 BlendMode blend_mode) { |
2944 DCHECK_GE(precision, 0); | 2950 DCHECK_GE(precision, 0); |
2945 DCHECK_LT(precision, NumTexCoordPrecisions); | 2951 DCHECK_LT(precision, NumTexCoordPrecisions); |
| 2952 DCHECK_GE(sampler, 0); |
| 2953 DCHECK_LT(sampler, NumSamplerTypes); |
2946 DCHECK_GE(blend_mode, 0); | 2954 DCHECK_GE(blend_mode, 0); |
2947 DCHECK_LT(blend_mode, NumBlendModes); | 2955 DCHECK_LT(blend_mode, NumBlendModes); |
2948 RenderPassMaskColorMatrixProgramAA* program = | 2956 RenderPassMaskColorMatrixProgramAA* program = |
2949 &render_pass_mask_color_matrix_program_aa_[precision][blend_mode]; | 2957 &render_pass_mask_color_matrix_program_aa_[precision][sampler] |
| 2958 [blend_mode]; |
2950 if (!program->initialized()) { | 2959 if (!program->initialized()) { |
2951 TRACE_EVENT0("cc", | 2960 TRACE_EVENT0("cc", |
2952 "GLRenderer::renderPassMaskColorMatrixProgramAA::initialize"); | 2961 "GLRenderer::renderPassMaskColorMatrixProgramAA::initialize"); |
2953 program->Initialize(output_surface_->context_provider(), | 2962 program->Initialize( |
2954 precision, | 2963 output_surface_->context_provider(), precision, sampler, blend_mode); |
2955 SamplerType2D, | |
2956 blend_mode); | |
2957 } | 2964 } |
2958 return program; | 2965 return program; |
2959 } | 2966 } |
2960 | 2967 |
2961 const GLRenderer::TileProgram* GLRenderer::GetTileProgram( | 2968 const GLRenderer::TileProgram* GLRenderer::GetTileProgram( |
2962 TexCoordPrecision precision, | 2969 TexCoordPrecision precision, |
2963 SamplerType sampler) { | 2970 SamplerType sampler) { |
2964 DCHECK_GE(precision, 0); | 2971 DCHECK_GE(precision, 0); |
2965 DCHECK_LT(precision, NumTexCoordPrecisions); | 2972 DCHECK_LT(precision, NumTexCoordPrecisions); |
2966 DCHECK_GE(sampler, 0); | 2973 DCHECK_GE(sampler, 0); |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3171 shared_geometry_ = nullptr; | 3178 shared_geometry_ = nullptr; |
3172 | 3179 |
3173 for (int i = 0; i < NumTexCoordPrecisions; ++i) { | 3180 for (int i = 0; i < NumTexCoordPrecisions; ++i) { |
3174 for (int j = 0; j < NumSamplerTypes; ++j) { | 3181 for (int j = 0; j < NumSamplerTypes; ++j) { |
3175 tile_program_[i][j].Cleanup(gl_); | 3182 tile_program_[i][j].Cleanup(gl_); |
3176 tile_program_opaque_[i][j].Cleanup(gl_); | 3183 tile_program_opaque_[i][j].Cleanup(gl_); |
3177 tile_program_swizzle_[i][j].Cleanup(gl_); | 3184 tile_program_swizzle_[i][j].Cleanup(gl_); |
3178 tile_program_swizzle_opaque_[i][j].Cleanup(gl_); | 3185 tile_program_swizzle_opaque_[i][j].Cleanup(gl_); |
3179 tile_program_aa_[i][j].Cleanup(gl_); | 3186 tile_program_aa_[i][j].Cleanup(gl_); |
3180 tile_program_swizzle_aa_[i][j].Cleanup(gl_); | 3187 tile_program_swizzle_aa_[i][j].Cleanup(gl_); |
| 3188 |
| 3189 for (int k = 0; k < NumBlendModes; k++) { |
| 3190 render_pass_mask_program_[i][j][k].Cleanup(gl_); |
| 3191 render_pass_mask_program_aa_[i][j][k].Cleanup(gl_); |
| 3192 render_pass_mask_color_matrix_program_aa_[i][j][k].Cleanup(gl_); |
| 3193 render_pass_mask_color_matrix_program_[i][j][k].Cleanup(gl_); |
| 3194 } |
3181 } | 3195 } |
3182 for (int j = 0; j < NumBlendModes; j++) { | 3196 for (int j = 0; j < NumBlendModes; j++) { |
3183 render_pass_mask_program_[i][j].Cleanup(gl_); | |
3184 render_pass_program_[i][j].Cleanup(gl_); | 3197 render_pass_program_[i][j].Cleanup(gl_); |
3185 render_pass_mask_program_aa_[i][j].Cleanup(gl_); | |
3186 render_pass_program_aa_[i][j].Cleanup(gl_); | 3198 render_pass_program_aa_[i][j].Cleanup(gl_); |
3187 render_pass_color_matrix_program_[i][j].Cleanup(gl_); | 3199 render_pass_color_matrix_program_[i][j].Cleanup(gl_); |
3188 render_pass_mask_color_matrix_program_aa_[i][j].Cleanup(gl_); | |
3189 render_pass_color_matrix_program_aa_[i][j].Cleanup(gl_); | 3200 render_pass_color_matrix_program_aa_[i][j].Cleanup(gl_); |
3190 render_pass_mask_color_matrix_program_[i][j].Cleanup(gl_); | |
3191 } | 3201 } |
3192 | 3202 |
3193 texture_program_[i].Cleanup(gl_); | 3203 texture_program_[i].Cleanup(gl_); |
3194 nonpremultiplied_texture_program_[i].Cleanup(gl_); | 3204 nonpremultiplied_texture_program_[i].Cleanup(gl_); |
3195 texture_background_program_[i].Cleanup(gl_); | 3205 texture_background_program_[i].Cleanup(gl_); |
3196 nonpremultiplied_texture_background_program_[i].Cleanup(gl_); | 3206 nonpremultiplied_texture_background_program_[i].Cleanup(gl_); |
3197 texture_io_surface_program_[i].Cleanup(gl_); | 3207 texture_io_surface_program_[i].Cleanup(gl_); |
3198 | 3208 |
3199 video_yuv_program_[i].Cleanup(gl_); | 3209 video_yuv_program_[i].Cleanup(gl_); |
3200 video_yuva_program_[i].Cleanup(gl_); | 3210 video_yuva_program_[i].Cleanup(gl_); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3290 context_support_->ScheduleOverlayPlane( | 3300 context_support_->ScheduleOverlayPlane( |
3291 overlay.plane_z_order, | 3301 overlay.plane_z_order, |
3292 overlay.transform, | 3302 overlay.transform, |
3293 pending_overlay_resources_.back()->texture_id(), | 3303 pending_overlay_resources_.back()->texture_id(), |
3294 overlay.display_rect, | 3304 overlay.display_rect, |
3295 overlay.uv_rect); | 3305 overlay.uv_rect); |
3296 } | 3306 } |
3297 } | 3307 } |
3298 | 3308 |
3299 } // namespace cc | 3309 } // namespace cc |
OLD | NEW |