| 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 2267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2278 | 2278 |
| 2279 if (color_conversion_mode == COLOR_CONVERSION_MODE_LUT) { | 2279 if (color_conversion_mode == COLOR_CONVERSION_MODE_LUT) { |
| 2280 ColorLUTCache::LUT lut = color_lut_cache_.GetLUT(quad->video_color_space, | 2280 ColorLUTCache::LUT lut = color_lut_cache_.GetLUT(quad->video_color_space, |
| 2281 frame->device_color_space); | 2281 frame->device_color_space); |
| 2282 gl_->ActiveTexture(GL_TEXTURE5); | 2282 gl_->ActiveTexture(GL_TEXTURE5); |
| 2283 gl_->BindTexture(GL_TEXTURE_2D, lut.texture); | 2283 gl_->BindTexture(GL_TEXTURE_2D, lut.texture); |
| 2284 gl_->Uniform1i(program->lut_texture_location(), 5); | 2284 gl_->Uniform1i(program->lut_texture_location(), 5); |
| 2285 gl_->Uniform1f(program->lut_size_location(), lut.size); | 2285 gl_->Uniform1f(program->lut_size_location(), lut.size); |
| 2286 gl_->ActiveTexture(GL_TEXTURE0); | 2286 gl_->ActiveTexture(GL_TEXTURE0); |
| 2287 } | 2287 } |
| 2288 DCHECK_NE(program->yuv_and_resource_matrix_location(), -1); | |
| 2289 float yuv_to_rgb_matrix[16] = {0}; | 2288 float yuv_to_rgb_matrix[16] = {0}; |
| 2290 ComputeYUVToRGBMatrices(quad->color_space, quad->bits_per_channel, | 2289 ComputeYUVToRGBMatrices(quad->color_space, quad->bits_per_channel, |
| 2291 quad->resource_multiplier, quad->resource_offset, | 2290 quad->resource_multiplier, quad->resource_offset, |
| 2292 color_conversion_mode, yuv_to_rgb_matrix); | 2291 color_conversion_mode, yuv_to_rgb_matrix); |
| 2293 gl_->UniformMatrix4fv(program->yuv_and_resource_matrix_location(), 1, 0, | 2292 gl_->UniformMatrix4fv(program->yuv_and_resource_matrix_location(), 1, 0, |
| 2294 yuv_to_rgb_matrix); | 2293 yuv_to_rgb_matrix); |
| 2295 | 2294 |
| 2296 // The transform and vertex data are used to figure out the extents that the | 2295 // The transform and vertex data are used to figure out the extents that the |
| 2297 // un-antialiased quad should have and which vertex this is and the float | 2296 // un-antialiased quad should have and which vertex this is and the float |
| 2298 // quad passed in via uniform is the actual geometry that gets used to draw | 2297 // quad passed in via uniform is the actual geometry that gets used to draw |
| (...skipping 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3595 return; | 3594 return; |
| 3596 | 3595 |
| 3597 // Report GPU overdraw as a percentage of |max_result|. | 3596 // Report GPU overdraw as a percentage of |max_result|. |
| 3598 TRACE_COUNTER1( | 3597 TRACE_COUNTER1( |
| 3599 TRACE_DISABLED_BY_DEFAULT("cc.debug.overdraw"), "GPU Overdraw", | 3598 TRACE_DISABLED_BY_DEFAULT("cc.debug.overdraw"), "GPU Overdraw", |
| 3600 (std::accumulate(overdraw->begin(), overdraw->end(), 0) * 100) / | 3599 (std::accumulate(overdraw->begin(), overdraw->end(), 0) * 100) / |
| 3601 max_result); | 3600 max_result); |
| 3602 } | 3601 } |
| 3603 | 3602 |
| 3604 } // namespace cc | 3603 } // namespace cc |
| OLD | NEW |