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

Side by Side Diff: services/ui/ws/window_server.cc

Issue 2489003002: Convert mustash use surface references. (Closed)
Patch Set: Rebase + fixes. Created 4 years, 1 month 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/window_server.h" 5 #include "services/ui/ws/window_server.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
764 // If the window doesn't have a parent then we have nothing to propagate. 764 // If the window doesn't have a parent then we have nothing to propagate.
765 if (!window) 765 if (!window)
766 return; 766 return;
767 767
768 // Cache the last submitted surface ID in the window server. 768 // Cache the last submitted surface ID in the window server.
769 // DisplayCompositorFrameSink may submit a CompositorFrame without 769 // DisplayCompositorFrameSink may submit a CompositorFrame without
770 // creating a CompositorFrameSinkManager. 770 // creating a CompositorFrameSinkManager.
771 window->GetOrCreateCompositorFrameSinkManager()->SetLatestSurfaceInfo( 771 window->GetOrCreateCompositorFrameSinkManager()->SetLatestSurfaceInfo(
772 compositor_frame_sink_type, surface_id, frame_size); 772 compositor_frame_sink_type, surface_id, frame_size);
773 773
774 // FrameGenerator will add an appropriate reference for the new surface.
775 DCHECK(display_manager_->GetDisplayContaining(window));
776 display_manager_->GetDisplayContaining(window)
777 ->platform_display()
778 ->GetFrameGenerator()
779 ->AddSurfaceReference(surface_id, window);
780
774 // This is only used for testing to observe that a window has a 781 // This is only used for testing to observe that a window has a
775 // CompositorFrame. 782 // CompositorFrame.
776 if (!window_paint_callback_.is_null()) 783 if (!window_paint_callback_.is_null())
777 window_paint_callback_.Run(window); 784 window_paint_callback_.Run(window);
778 785
779 // We only care about propagating default surface IDs. 786 // We only care about propagating default surface IDs.
780 // TODO(fsamuel, sadrul): we should get rid of CompositorFrameSinkTypes. 787 // TODO(fsamuel, sadrul): we should get rid of CompositorFrameSinkTypes.
781 if (compositor_frame_sink_type != mojom::CompositorFrameSinkType::DEFAULT || 788 if (compositor_frame_sink_type != mojom::CompositorFrameSinkType::DEFAULT ||
782 !window->parent()) { 789 !window->parent()) {
783 return; 790 return;
(...skipping 12 matching lines...) Expand all
796 void WindowServer::OnUserIdAdded(const UserId& id) { 803 void WindowServer::OnUserIdAdded(const UserId& id) {
797 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); 804 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr);
798 } 805 }
799 806
800 void WindowServer::OnUserIdRemoved(const UserId& id) { 807 void WindowServer::OnUserIdRemoved(const UserId& id) {
801 activity_monitor_map_.erase(id); 808 activity_monitor_map_.erase(id);
802 } 809 }
803 810
804 } // namespace ws 811 } // namespace ws
805 } // namespace ui 812 } // namespace ui
OLDNEW
« services/ui/ws/frame_generator.cc ('K') | « services/ui/ws/test_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698