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 3640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3651 bool use_color_lut) { | 3651 bool use_color_lut) { |
3652 DCHECK_GE(precision, 0); | 3652 DCHECK_GE(precision, 0); |
3653 DCHECK_LE(precision, LAST_TEX_COORD_PRECISION); | 3653 DCHECK_LE(precision, LAST_TEX_COORD_PRECISION); |
3654 DCHECK_GE(sampler, 0); | 3654 DCHECK_GE(sampler, 0); |
3655 DCHECK_LE(sampler, LAST_SAMPLER_TYPE); | 3655 DCHECK_LE(sampler, LAST_SAMPLER_TYPE); |
3656 VideoYUVProgram* program = | 3656 VideoYUVProgram* program = |
3657 &video_yuv_program_[precision][sampler][use_alpha_plane][use_nv12] | 3657 &video_yuv_program_[precision][sampler][use_alpha_plane][use_nv12] |
3658 [use_color_lut]; | 3658 [use_color_lut]; |
3659 if (!program->initialized()) { | 3659 if (!program->initialized()) { |
3660 TRACE_EVENT0("cc", "GLRenderer::videoYUVProgram::initialize"); | 3660 TRACE_EVENT0("cc", "GLRenderer::videoYUVProgram::initialize"); |
3661 program->mutable_fragment_shader()->SetFeatures(use_alpha_plane, use_nv12, | 3661 program->InitializeVideoYUV(output_surface_->context_provider(), precision, |
3662 use_color_lut); | 3662 sampler, use_alpha_plane, use_nv12, |
3663 program->Initialize(output_surface_->context_provider(), precision, | 3663 use_color_lut); |
3664 sampler); | |
3665 } | 3664 } |
3666 return program; | 3665 return program; |
3667 } | 3666 } |
3668 | 3667 |
3669 const GLRenderer::VideoStreamTextureProgram* | 3668 const GLRenderer::VideoStreamTextureProgram* |
3670 GLRenderer::GetVideoStreamTextureProgram(TexCoordPrecision precision) { | 3669 GLRenderer::GetVideoStreamTextureProgram(TexCoordPrecision precision) { |
3671 DCHECK_GE(precision, 0); | 3670 DCHECK_GE(precision, 0); |
3672 DCHECK_LE(precision, LAST_TEX_COORD_PRECISION); | 3671 DCHECK_LE(precision, LAST_TEX_COORD_PRECISION); |
3673 VideoStreamTextureProgram* program = | 3672 VideoStreamTextureProgram* program = |
3674 &video_stream_texture_program_[precision]; | 3673 &video_stream_texture_program_[precision]; |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4059 // The alpha has already been applied when copying the RPDQ to an IOSurface. | 4058 // The alpha has already been applied when copying the RPDQ to an IOSurface. |
4060 GLfloat alpha = 1; | 4059 GLfloat alpha = 1; |
4061 gl_->ScheduleCALayerSharedStateCHROMIUM(alpha, is_clipped, clip_rect, | 4060 gl_->ScheduleCALayerSharedStateCHROMIUM(alpha, is_clipped, clip_rect, |
4062 sorting_context_id, gl_transform); | 4061 sorting_context_id, gl_transform); |
4063 gl_->ScheduleCALayerCHROMIUM( | 4062 gl_->ScheduleCALayerCHROMIUM( |
4064 texture_id, contents_rect, ca_layer_overlay->background_color, | 4063 texture_id, contents_rect, ca_layer_overlay->background_color, |
4065 ca_layer_overlay->edge_aa_mask, bounds_rect, filter); | 4064 ca_layer_overlay->edge_aa_mask, bounds_rect, filter); |
4066 } | 4065 } |
4067 | 4066 |
4068 } // namespace cc | 4067 } // namespace cc |
OLD | NEW |