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

Side by Side Diff: services/ui/ws/server_window_surface.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 | « services/ui/ws/server_window_surface.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "services/ui/ws/server_window_surface.h" 5 #include "services/ui/ws/server_window_surface.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "cc/output/compositor_frame.h" 8 #include "cc/output/compositor_frame.h"
9 #include "cc/quads/shared_quad_state.h" 9 #include "cc/quads/shared_quad_state.h"
10 #include "cc/quads/surface_draw_quad.h" 10 #include "cc/quads/surface_draw_quad.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 // this we schedule destruction via the delegate. The delegate will call 58 // this we schedule destruction via the delegate. The delegate will call
59 // us back when we're not waiting on a frame to be drawn (which may be 59 // us back when we're not waiting on a frame to be drawn (which may be
60 // synchronously). 60 // synchronously).
61 if (!surface_id_.is_null()) { 61 if (!surface_id_.is_null()) {
62 surfaces_scheduled_for_destruction_.insert(surface_id_); 62 surfaces_scheduled_for_destruction_.insert(surface_id_);
63 window()->delegate()->ScheduleSurfaceDestruction(window()); 63 window()->delegate()->ScheduleSurfaceDestruction(window());
64 } 64 }
65 surface_id_ = surface_id_allocator_.GenerateId(); 65 surface_id_ = surface_id_allocator_.GenerateId();
66 surface_factory_.Create(surface_id_); 66 surface_factory_.Create(surface_id_);
67 } 67 }
68 may_contain_video_ = frame.metadata.may_contain_video;
68 surface_factory_.SubmitCompositorFrame(surface_id_, std::move(frame), 69 surface_factory_.SubmitCompositorFrame(surface_id_, std::move(frame),
69 callback); 70 callback);
70 last_submitted_frame_size_ = frame_size; 71 last_submitted_frame_size_ = frame_size;
71 window()->delegate()->OnScheduleWindowPaint(window()); 72 window()->delegate()->OnScheduleWindowPaint(window());
72 } 73 }
73 74
74 void ServerWindowSurface::DestroySurfacesScheduledForDestruction() { 75 void ServerWindowSurface::DestroySurfacesScheduledForDestruction() {
75 std::set<cc::SurfaceId> surfaces; 76 std::set<cc::SurfaceId> surfaces;
76 surfaces.swap(surfaces_scheduled_for_destruction_); 77 surfaces.swap(surfaces_scheduled_for_destruction_);
77 for (auto& id : surfaces) 78 for (auto& id : surfaces)
(...skipping 11 matching lines...) Expand all
89 client_->ReturnResources(mojo::Array<cc::ReturnedResource>::From(resources)); 90 client_->ReturnResources(mojo::Array<cc::ReturnedResource>::From(resources));
90 } 91 }
91 92
92 void ServerWindowSurface::SetBeginFrameSource( 93 void ServerWindowSurface::SetBeginFrameSource(
93 cc::BeginFrameSource* begin_frame_source) { 94 cc::BeginFrameSource* begin_frame_source) {
94 // TODO(tansell): Implement this. 95 // TODO(tansell): Implement this.
95 } 96 }
96 97
97 } // namespace ws 98 } // namespace ws
98 } // namespace ui 99 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/server_window_surface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698