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 2299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2310 SetUseProgram(program->program()); | 2310 SetUseProgram(program->program()); |
2311 | 2311 |
2312 ToGLMatrix(&gl_matrix[0], quad->matrix); | 2312 ToGLMatrix(&gl_matrix[0], quad->matrix); |
2313 | 2313 |
2314 ResourceProvider::ScopedReadLockGL lock(resource_provider_, | 2314 ResourceProvider::ScopedReadLockGL lock(resource_provider_, |
2315 quad->resource_id()); | 2315 quad->resource_id()); |
2316 | 2316 |
2317 DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_)); | 2317 DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_)); |
2318 gl_->BindTexture(GL_TEXTURE_EXTERNAL_OES, lock.texture_id()); | 2318 gl_->BindTexture(GL_TEXTURE_EXTERNAL_OES, lock.texture_id()); |
2319 | 2319 |
| 2320 // TODO(liberato): stream_texture_android should stop sending |gl_matrix| to |
| 2321 // the video frame provider with this change (and to us), but it should |
| 2322 // start reporting the current matrix via |
| 2323 // GLStreamTextureImage::GetTextureMatrix. Until then, though, this will use |
| 2324 // the matrix that we provide to it, unless the GLStreamTextureImage |
| 2325 // overrides it. This lets it also work with AVDACodecImage, which provides |
| 2326 // the correct custom matrix and supplies a default one to us. |
2320 gl_->UniformMatrix4fvStreamTextureMatrixCHROMIUM( | 2327 gl_->UniformMatrix4fvStreamTextureMatrixCHROMIUM( |
2321 program->vertex_shader().tex_matrix_location(), false, gl_matrix); | 2328 program->vertex_shader().tex_matrix_location(), false, gl_matrix); |
2322 | 2329 |
2323 gl_->Uniform1i(program->fragment_shader().sampler_location(), 0); | 2330 gl_->Uniform1i(program->fragment_shader().sampler_location(), 0); |
2324 | 2331 |
2325 SetShaderOpacity(quad->shared_quad_state->opacity, | 2332 SetShaderOpacity(quad->shared_quad_state->opacity, |
2326 program->fragment_shader().alpha_location()); | 2333 program->fragment_shader().alpha_location()); |
2327 if (!clip_region) { | 2334 if (!clip_region) { |
2328 DrawQuadGeometry(frame, quad->shared_quad_state->quad_to_target_transform, | 2335 DrawQuadGeometry(frame, quad->shared_quad_state->quad_to_target_transform, |
2329 gfx::RectF(quad->rect), | 2336 gfx::RectF(quad->rect), |
(...skipping 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3679 texture_id = pending_overlay_resources_.back()->texture_id(); | 3686 texture_id = pending_overlay_resources_.back()->texture_id(); |
3680 } | 3687 } |
3681 | 3688 |
3682 context_support_->ScheduleOverlayPlane( | 3689 context_support_->ScheduleOverlayPlane( |
3683 overlay.plane_z_order, overlay.transform, texture_id, | 3690 overlay.plane_z_order, overlay.transform, texture_id, |
3684 ToNearestRect(overlay.display_rect), overlay.uv_rect); | 3691 ToNearestRect(overlay.display_rect), overlay.uv_rect); |
3685 } | 3692 } |
3686 } | 3693 } |
3687 | 3694 |
3688 } // namespace cc | 3695 } // namespace cc |
OLD | NEW |