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

Unified Diff: content/renderer/media/android/webmediaplayer_android.cc

Issue 1417853006: gpu: introduce glSetStreamTextureSizeCHROMIUM(GLuint texture, GLint stream_id, GLsizei width, GLsiz… Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix android_webview.test failure Created 5 years, 1 month 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
Index: content/renderer/media/android/webmediaplayer_android.cc
diff --git a/content/renderer/media/android/webmediaplayer_android.cc b/content/renderer/media/android/webmediaplayer_android.cc
index e7325150d116abb22f293c4c9aac011d85d1ca56..2a14d7ed52c98f43b915d39e5513ecbfe3b747f1 100644
--- a/content/renderer/media/android/webmediaplayer_android.cc
+++ b/content/renderer/media/android/webmediaplayer_android.cc
@@ -919,9 +919,7 @@ void WebMediaPlayerAndroid::OnVideoSizeChanged(int width, int height) {
// For hidden video element (with style "display:none"), ensure the texture
// size is set.
if (!is_remote_ && cached_stream_texture_size_ != natural_size_) {
- stream_texture_factory_->SetStreamTextureSize(
- stream_id_, gfx::Size(natural_size_.width, natural_size_.height));
- cached_stream_texture_size_ = natural_size_;
+ UpdateStreamTextureSize();
}
// Lazily allocate compositing layer.
@@ -933,6 +931,19 @@ void WebMediaPlayerAndroid::OnVideoSizeChanged(int width, int height) {
}
}
+void WebMediaPlayerAndroid::UpdateStreamTextureSize() {
+ if (!stream_id_)
+ return;
+
+ DCHECK(cached_stream_texture_size_ != natural_size_);
+ cached_stream_texture_size_ = natural_size_;
+
+ GLES2Interface* gl = stream_texture_factory_->ContextGL();
+ DCHECK(texture_id_);
+ gl->SetStreamTextureSizeCHROMIUM(texture_id_, stream_id_, natural_size_.width,
+ natural_size_.height);
+}
+
void WebMediaPlayerAndroid::OnTimeUpdate(base::TimeDelta current_timestamp,
base::TimeTicks current_time_ticks) {
DCHECK(main_thread_checker_.CalledOnValidThread());
@@ -1394,9 +1405,7 @@ void WebMediaPlayerAndroid::EstablishSurfaceTexturePeer() {
// Set the deferred size because the size was changed in remote mode.
if (!is_remote_ && cached_stream_texture_size_ != natural_size_) {
- stream_texture_factory_->SetStreamTextureSize(
- stream_id_, gfx::Size(natural_size_.width, natural_size_.height));
- cached_stream_texture_size_ = natural_size_;
+ UpdateStreamTextureSize();
}
needs_establish_peer_ = false;

Powered by Google App Engine
This is Rietveld 408576698