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

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

Issue 1101823002: CC Animations: Make LayerAnimationController creation optional (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Plumb LayerSettings parameter for cc::Layer construction. Created 5 years, 7 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 762 matching lines...) Expand 10 before | Expand all | Expand 10 after
773 773
774 pipeline_metadata_ = metadata; 774 pipeline_metadata_ = metadata;
775 775
776 UMA_HISTOGRAM_ENUMERATION("Media.VideoRotation", metadata.video_rotation, 776 UMA_HISTOGRAM_ENUMERATION("Media.VideoRotation", metadata.video_rotation,
777 VIDEO_ROTATION_MAX + 1); 777 VIDEO_ROTATION_MAX + 1);
778 SetReadyState(WebMediaPlayer::ReadyStateHaveMetadata); 778 SetReadyState(WebMediaPlayer::ReadyStateHaveMetadata);
779 779
780 if (hasVideo()) { 780 if (hasVideo()) {
781 DCHECK(!video_weblayer_); 781 DCHECK(!video_weblayer_);
782 scoped_refptr<cc::VideoLayer> layer = 782 scoped_refptr<cc::VideoLayer> layer =
783 cc::VideoLayer::Create(compositor_, pipeline_metadata_.video_rotation); 783 cc::VideoLayer::Create(cc_blink::WebLayerImpl::LayerSettings(),
784 compositor_, pipeline_metadata_.video_rotation);
784 785
785 if (pipeline_metadata_.video_rotation == VIDEO_ROTATION_90 || 786 if (pipeline_metadata_.video_rotation == VIDEO_ROTATION_90 ||
786 pipeline_metadata_.video_rotation == VIDEO_ROTATION_270) { 787 pipeline_metadata_.video_rotation == VIDEO_ROTATION_270) {
787 gfx::Size size = pipeline_metadata_.natural_size; 788 gfx::Size size = pipeline_metadata_.natural_size;
788 pipeline_metadata_.natural_size = gfx::Size(size.height(), size.width()); 789 pipeline_metadata_.natural_size = gfx::Size(size.height(), size.width());
789 } 790 }
790 791
791 video_weblayer_.reset(new cc_blink::WebLayerImpl(layer)); 792 video_weblayer_.reset(new cc_blink::WebLayerImpl(layer));
792 video_weblayer_->setOpaque(opaque_); 793 video_weblayer_->setOpaque(opaque_);
793 client_->setWebLayer(video_weblayer_.get()); 794 client_->setWebLayer(video_weblayer_.get());
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1013 1014
1014 // pause() may be called after playback has ended and the HTMLMediaElement 1015 // pause() may be called after playback has ended and the HTMLMediaElement
1015 // requires that currentTime() == duration() after ending. We want to ensure 1016 // requires that currentTime() == duration() after ending. We want to ensure
1016 // |paused_time_| matches currentTime() in this case or a future seek() may 1017 // |paused_time_| matches currentTime() in this case or a future seek() may
1017 // incorrectly discard what it thinks is a seek to the existing time. 1018 // incorrectly discard what it thinks is a seek to the existing time.
1018 paused_time_ = 1019 paused_time_ =
1019 ended_ ? pipeline_.GetMediaDuration() : pipeline_.GetMediaTime(); 1020 ended_ ? pipeline_.GetMediaDuration() : pipeline_.GetMediaTime();
1020 } 1021 }
1021 1022
1022 } // namespace media 1023 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698