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

Side by Side Diff: cc/layers/video_layer_impl.cc

Issue 2140783002: services/ui: Detect when a video is playing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tot merge Created 4 years, 4 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
« no previous file with comments | « cc/layers/video_layer.cc ('k') | cc/output/compositor_frame_metadata.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 "cc/layers/video_layer_impl.h" 5 #include "cc/layers/video_layer_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 } 44 }
45 45
46 VideoLayerImpl::VideoLayerImpl( 46 VideoLayerImpl::VideoLayerImpl(
47 LayerTreeImpl* tree_impl, 47 LayerTreeImpl* tree_impl,
48 int id, 48 int id,
49 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl, 49 scoped_refptr<VideoFrameProviderClientImpl> provider_client_impl,
50 media::VideoRotation video_rotation) 50 media::VideoRotation video_rotation)
51 : LayerImpl(tree_impl, id), 51 : LayerImpl(tree_impl, id),
52 provider_client_impl_(std::move(provider_client_impl)), 52 provider_client_impl_(std::move(provider_client_impl)),
53 frame_(nullptr), 53 frame_(nullptr),
54 video_rotation_(video_rotation) {} 54 video_rotation_(video_rotation) {
55 set_may_contain_video(true);
56 }
55 57
56 VideoLayerImpl::~VideoLayerImpl() { 58 VideoLayerImpl::~VideoLayerImpl() {
57 if (!provider_client_impl_->Stopped()) { 59 if (!provider_client_impl_->Stopped()) {
58 // In impl side painting, we may have a pending and active layer 60 // In impl side painting, we may have a pending and active layer
59 // associated with the video provider at the same time. Both have a ref 61 // associated with the video provider at the same time. Both have a ref
60 // on the VideoFrameProviderClientImpl, but we stop when the first 62 // on the VideoFrameProviderClientImpl, but we stop when the first
61 // LayerImpl (the one on the pending tree) is destroyed since we know 63 // LayerImpl (the one on the pending tree) is destroyed since we know
62 // the main thread is blocked for this commit. 64 // the main thread is blocked for this commit.
63 DCHECK(layer_tree_impl()->task_runner_provider()->IsImplThread()); 65 DCHECK(layer_tree_impl()->task_runner_provider()->IsImplThread());
64 DCHECK(layer_tree_impl()->task_runner_provider()->IsMainThreadBlocked()); 66 DCHECK(layer_tree_impl()->task_runner_provider()->IsMainThreadBlocked());
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 void VideoLayerImpl::SetNeedsRedraw() { 399 void VideoLayerImpl::SetNeedsRedraw() {
398 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds()))); 400 SetUpdateRect(gfx::UnionRects(update_rect(), gfx::Rect(bounds())));
399 layer_tree_impl()->SetNeedsRedraw(); 401 layer_tree_impl()->SetNeedsRedraw();
400 } 402 }
401 403
402 const char* VideoLayerImpl::LayerTypeAsString() const { 404 const char* VideoLayerImpl::LayerTypeAsString() const {
403 return "cc::VideoLayerImpl"; 405 return "cc::VideoLayerImpl";
404 } 406 }
405 407
406 } // namespace cc 408 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/video_layer.cc ('k') | cc/output/compositor_frame_metadata.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698