Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(345)

Unified Diff: media/gpu/avda_shared_state.cc

Issue 2351293003: Relocate SurfaceTexture usage from AVDA GLImage into shared state. (Closed)
Patch Set: Unflip default matrix. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/gpu/avda_shared_state.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « media/gpu/avda_shared_state.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698