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; |