Chromium Code Reviews| Index: media/gpu/avda_shared_state.cc |
| diff --git a/media/gpu/avda_shared_state.cc b/media/gpu/avda_shared_state.cc |
| index 12b25256fabf2e4ac2a9c84ec0ef1dcea54730ea..3fe7e0d54169220d99a1620ab809ec146992e678 100644 |
| --- a/media/gpu/avda_shared_state.cc |
| +++ b/media/gpu/avda_shared_state.cc |
| @@ -16,7 +16,14 @@ namespace media { |
| AVDASharedState::AVDASharedState() |
| : surface_texture_service_id_(0), |
| frame_available_event_(base::WaitableEvent::ResetPolicy::AUTOMATIC, |
| - base::WaitableEvent::InitialState::NOT_SIGNALED) {} |
| + base::WaitableEvent::InitialState::NOT_SIGNALED), |
| + |
| + gl_matrix_{ |
| + 1, 0, 1, 0, // Default to a sane guess just in case we can't get the |
|
liberato (no reviews please)
2016/10/05 15:35:17
methinks that the 1 in the third column should be
|
| + 0, 1, 0, 0, // matrix on the first call. Will be Y-flipped later. |
| + 0, 0, 1, 0, // |
| + 0, 0, 0, 1, // Comment preserves 4x4 formatting. |
| + } {} |
| AVDASharedState::~AVDASharedState() { |
| if (!surface_texture_service_id_) |
| @@ -107,4 +114,14 @@ void AVDASharedState::RenderCodecBufferToSurfaceTexture( |
| release_time_ = base::TimeTicks::Now(); |
| } |
| +void AVDASharedState::UpdateTexImage() { |
| + surface_texture_->UpdateTexImage(); |
| + // Helpfully, this is already column major. |
| + surface_texture_->GetTransformMatrix(gl_matrix_); |
| +} |
| + |
| +void AVDASharedState::GetTransformMatrix(float matrix[16]) const { |
| + memcpy(matrix, gl_matrix_, sizeof(gl_matrix_)); |
| +} |
| + |
| } // namespace media |