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 3679178aa734665867750888714ab653f7a2d055..4271f23978e182db4ad4e77509226611c621e82d 100644 |
--- a/content/renderer/media/android/webmediaplayer_android.cc |
+++ b/content/renderer/media/android/webmediaplayer_android.cc |
@@ -662,7 +662,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_) { |
scherkus (not reviewing)
2014/03/20 17:17:45
we don't need to check hasVideo() as it would alwa
|
+ video_weblayer_.reset( |
+ new webkit::WebLayerImpl(cc::VideoLayer::Create(this))); |
+ client_->setWebLayer(video_weblayer_); |
+ } |
+ |
// 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. |
@@ -955,13 +962,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 |