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

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

Issue 204463008: Remove all calls to WebMediaPlayerClient::needsWebLayerForVideo() as compositing is always enabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 9 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
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 ee32628622a225bf2bd4cba423f2c0e6782215bc..3ded40afb68a4c2f633380f98474cf544dad4444 100644
--- a/content/renderer/media/android/webmediaplayer_android.cc
+++ b/content/renderer/media/android/webmediaplayer_android.cc
@@ -663,7 +663,14 @@ void WebMediaPlayerAndroid::OnVideoSizeChanged(int width, int height) {
natural_size_.width = width;
natural_size_.height = height;
ReallocateVideoFrame();
- CreateWebLayerIfNeeded();
+
+ // Lazily allocate compositing layer.
+ if (!video_weblayer_) {
+ video_weblayer_.reset(
+ new webkit::WebLayerImpl(cc::VideoLayer::Create(this)));
+ client_->setWebLayer(video_weblayer_.get());
+ }
+
// TODO(qinmin): This is a hack. We need the media element to stop showing the
// poster image by forcing it to call setDisplayMode(video). Should move the
// logic into HTMLMediaElement.cpp.
@@ -989,13 +996,6 @@ void WebMediaPlayerAndroid::ReallocateVideoFrame() {
}
}
-void WebMediaPlayerAndroid::CreateWebLayerIfNeeded() {
- if (!hasVideo() || video_weblayer_ || !client_->needsWebLayerForVideo())
- return;
- video_weblayer_.reset(new webkit::WebLayerImpl(cc::VideoLayer::Create(this)));
- client_->setWebLayer(video_weblayer_.get());
-}
-
void WebMediaPlayerAndroid::SetVideoFrameProviderClient(
cc::VideoFrameProvider::Client* client) {
// This is called from both the main renderer thread and the compositor
« no previous file with comments | « content/renderer/media/android/webmediaplayer_android.h ('k') | content/renderer/media/webmediaplayer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698