| 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 2186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2197 SetUseProgram(program->program()); | 2197 SetUseProgram(program->program()); |
| 2198 | 2198 |
| 2199 ToGLMatrix(&gl_matrix[0], quad->matrix); | 2199 ToGLMatrix(&gl_matrix[0], quad->matrix); |
| 2200 | 2200 |
| 2201 ResourceProvider::ScopedReadLockGL lock(resource_provider_, | 2201 ResourceProvider::ScopedReadLockGL lock(resource_provider_, |
| 2202 quad->resource_id()); | 2202 quad->resource_id()); |
| 2203 | 2203 |
| 2204 DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_)); | 2204 DCHECK_EQ(GL_TEXTURE0, GetActiveTextureUnit(gl_)); |
| 2205 gl_->BindTexture(GL_TEXTURE_EXTERNAL_OES, lock.texture_id()); | 2205 gl_->BindTexture(GL_TEXTURE_EXTERNAL_OES, lock.texture_id()); |
| 2206 | 2206 |
| 2207 // TODO(liberato): stream_texture_android should stop sending |gl_matrix| to | |
| 2208 // the video frame provider with this change (and to us), but it should | |
| 2209 // start reporting the current matrix via | |
| 2210 // GLStreamTextureImage::GetTextureMatrix. Until then, though, this will use | |
| 2211 // the matrix that we provide to it, unless the GLStreamTextureImage | |
| 2212 // overrides it. This lets it also work with AVDACodecImage, which provides | |
| 2213 // the correct custom matrix and supplies a default one to us. | |
| 2214 gl_->UniformMatrix4fvStreamTextureMatrixCHROMIUM( | 2207 gl_->UniformMatrix4fvStreamTextureMatrixCHROMIUM( |
| 2215 program->vertex_shader().tex_matrix_location(), false, gl_matrix); | 2208 program->vertex_shader().tex_matrix_location(), false, gl_matrix); |
| 2216 | 2209 |
| 2217 gl_->Uniform1i(program->fragment_shader().sampler_location(), 0); | 2210 gl_->Uniform1i(program->fragment_shader().sampler_location(), 0); |
| 2218 | 2211 |
| 2219 SetShaderOpacity(quad->shared_quad_state->opacity, | 2212 SetShaderOpacity(quad->shared_quad_state->opacity, |
| 2220 program->fragment_shader().alpha_location()); | 2213 program->fragment_shader().alpha_location()); |
| 2221 if (!clip_region) { | 2214 if (!clip_region) { |
| 2222 DrawQuadGeometry(frame, quad->shared_quad_state->quad_to_target_transform, | 2215 DrawQuadGeometry(frame, quad->shared_quad_state->quad_to_target_transform, |
| 2223 gfx::RectF(quad->rect), | 2216 gfx::RectF(quad->rect), |
| (...skipping 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3599 texture_id = pending_overlay_resources_.back()->texture_id(); | 3592 texture_id = pending_overlay_resources_.back()->texture_id(); |
| 3600 } | 3593 } |
| 3601 | 3594 |
| 3602 context_support_->ScheduleOverlayPlane( | 3595 context_support_->ScheduleOverlayPlane( |
| 3603 overlay.plane_z_order, overlay.transform, texture_id, | 3596 overlay.plane_z_order, overlay.transform, texture_id, |
| 3604 ToNearestRect(overlay.display_rect), overlay.uv_rect); | 3597 ToNearestRect(overlay.display_rect), overlay.uv_rect); |
| 3605 } | 3598 } |
| 3606 } | 3599 } |
| 3607 | 3600 |
| 3608 } // namespace cc | 3601 } // namespace cc |
| OLD | NEW |