| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 2959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2970 clipped_geometry_->PrepareForDraw(); | 2970 clipped_geometry_->PrepareForDraw(); |
| 2971 break; | 2971 break; |
| 2972 case NO_BINDING: | 2972 case NO_BINDING: |
| 2973 break; | 2973 break; |
| 2974 } | 2974 } |
| 2975 bound_geometry_ = binding; | 2975 bound_geometry_ = binding; |
| 2976 } | 2976 } |
| 2977 | 2977 |
| 2978 void GLRenderer::SetUseProgram(const ProgramKey& program_key, | 2978 void GLRenderer::SetUseProgram(const ProgramKey& program_key, |
| 2979 const gfx::ColorSpace& src_color_space) { | 2979 const gfx::ColorSpace& src_color_space) { |
| 2980 gfx::ColorSpace dst_color_space; | 2980 // Ensure that we do not apply any color conversion unless the color correct |
| 2981 if (settings_->enable_color_correct_rendering) | 2981 // rendering flag has been specified. This is because media mailboxes will |
| 2982 dst_color_space = current_frame()->current_render_pass->color_space; | 2982 // provide YUV color spaces despite YUV to RGB conversion already having been |
| 2983 SetUseProgram(program_key, src_color_space, dst_color_space); | 2983 // performed. |
| 2984 // TODO(ccameron): Ensure that media mailboxes be accurate. |
| 2985 // https://crbug.com/699243 |
| 2986 if (settings_->enable_color_correct_rendering) { |
| 2987 SetUseProgram(program_key, src_color_space, |
| 2988 current_frame()->current_render_pass->color_space); |
| 2989 } else { |
| 2990 SetUseProgram(program_key, gfx::ColorSpace(), gfx::ColorSpace()); |
| 2991 } |
| 2984 } | 2992 } |
| 2985 | 2993 |
| 2986 void GLRenderer::SetUseProgram(const ProgramKey& program_key_no_color, | 2994 void GLRenderer::SetUseProgram(const ProgramKey& program_key_no_color, |
| 2987 const gfx::ColorSpace& src_color_space, | 2995 const gfx::ColorSpace& src_color_space, |
| 2988 const gfx::ColorSpace& dst_color_space) { | 2996 const gfx::ColorSpace& dst_color_space) { |
| 2989 ProgramKey program_key = program_key_no_color; | 2997 ProgramKey program_key = program_key_no_color; |
| 2990 const gfx::ColorTransform* color_transform = | 2998 const gfx::ColorTransform* color_transform = |
| 2991 GetColorTransform(src_color_space, dst_color_space); | 2999 GetColorTransform(src_color_space, dst_color_space); |
| 2992 program_key.SetColorTransform(color_transform); | 3000 program_key.SetColorTransform(color_transform); |
| 2993 | 3001 |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3498 return; | 3506 return; |
| 3499 | 3507 |
| 3500 // Report GPU overdraw as a percentage of |max_result|. | 3508 // Report GPU overdraw as a percentage of |max_result|. |
| 3501 TRACE_COUNTER1( | 3509 TRACE_COUNTER1( |
| 3502 TRACE_DISABLED_BY_DEFAULT("cc.debug.overdraw"), "GPU Overdraw", | 3510 TRACE_DISABLED_BY_DEFAULT("cc.debug.overdraw"), "GPU Overdraw", |
| 3503 (std::accumulate(overdraw->begin(), overdraw->end(), 0) * 100) / | 3511 (std::accumulate(overdraw->begin(), overdraw->end(), 0) * 100) / |
| 3504 max_result); | 3512 max_result); |
| 3505 } | 3513 } |
| 3506 | 3514 |
| 3507 } // namespace cc | 3515 } // namespace cc |
| OLD | NEW |