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

Side by Side Diff: media/blink/webmediaplayer_impl.cc

Issue 1783613004: CC Animation: Erase cc::LayerSettings everywhere. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@eraseandroid
Patch Set: Rebase. Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "media/blink/webmediaplayer_impl.h" 5 #include "media/blink/webmediaplayer_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <limits> 9 #include <limits>
10 #include <string> 10 #include <string>
(...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after
927 DVLOG(1) << __FUNCTION__; 927 DVLOG(1) << __FUNCTION__;
928 928
929 pipeline_metadata_ = metadata; 929 pipeline_metadata_ = metadata;
930 930
931 UMA_HISTOGRAM_ENUMERATION("Media.VideoRotation", metadata.video_rotation, 931 UMA_HISTOGRAM_ENUMERATION("Media.VideoRotation", metadata.video_rotation,
932 VIDEO_ROTATION_MAX + 1); 932 VIDEO_ROTATION_MAX + 1);
933 SetReadyState(WebMediaPlayer::ReadyStateHaveMetadata); 933 SetReadyState(WebMediaPlayer::ReadyStateHaveMetadata);
934 934
935 if (hasVideo()) { 935 if (hasVideo()) {
936 DCHECK(!video_weblayer_); 936 DCHECK(!video_weblayer_);
937 scoped_refptr<cc::VideoLayer> layer = cc::VideoLayer::Create( 937 scoped_refptr<cc::VideoLayer> layer =
938 cc::LayerSettings(), compositor_, pipeline_metadata_.video_rotation); 938 cc::VideoLayer::Create(compositor_, pipeline_metadata_.video_rotation);
939 939
940 if (pipeline_metadata_.video_rotation == VIDEO_ROTATION_90 || 940 if (pipeline_metadata_.video_rotation == VIDEO_ROTATION_90 ||
941 pipeline_metadata_.video_rotation == VIDEO_ROTATION_270) { 941 pipeline_metadata_.video_rotation == VIDEO_ROTATION_270) {
942 gfx::Size size = pipeline_metadata_.natural_size; 942 gfx::Size size = pipeline_metadata_.natural_size;
943 pipeline_metadata_.natural_size = gfx::Size(size.height(), size.width()); 943 pipeline_metadata_.natural_size = gfx::Size(size.height(), size.width());
944 } 944 }
945 945
946 video_weblayer_.reset(new cc_blink::WebLayerImpl(layer)); 946 video_weblayer_.reset(new cc_blink::WebLayerImpl(layer));
947 video_weblayer_->layer()->SetContentsOpaque(opaque_); 947 video_weblayer_->layer()->SetContentsOpaque(opaque_);
948 video_weblayer_->SetContentsOpaqueIsFixed(true); 948 video_weblayer_->SetContentsOpaqueIsFixed(true);
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
1459 bool WebMediaPlayerImpl::IsAutomaticResumeAllowed() { 1459 bool WebMediaPlayerImpl::IsAutomaticResumeAllowed() {
1460 #if defined(OS_ANDROID) 1460 #if defined(OS_ANDROID)
1461 return !hasVideo() || (delegate_ && !delegate_->IsHidden()); 1461 return !hasVideo() || (delegate_ && !delegate_->IsHidden());
1462 #else 1462 #else
1463 // On non-Android platforms Resume() is always allowed. 1463 // On non-Android platforms Resume() is always allowed.
1464 return true; 1464 return true;
1465 #endif 1465 #endif
1466 } 1466 }
1467 1467
1468 } // namespace media 1468 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698