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

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

Issue 2489003002: Convert mustash use surface references. (Closed)
Patch Set: 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 763 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 // If the window doesn't have a parent then we have nothing to propagate. 774 // If the window doesn't have a parent then we have nothing to propagate.
775 if (!window) 775 if (!window)
776 return; 776 return;
777 777
778 // Cache the last submitted surface ID in the window server. 778 // Cache the last submitted surface ID in the window server.
779 // DisplayCompositorFrameSink may submit a CompositorFrame without 779 // DisplayCompositorFrameSink may submit a CompositorFrame without
780 // creating a CompositorFrameSinkManager. 780 // creating a CompositorFrameSinkManager.
781 window->GetOrCreateCompositorFrameSinkManager()->SetLatestSurfaceInfo( 781 window->GetOrCreateCompositorFrameSinkManager()->SetLatestSurfaceInfo(
782 compositor_frame_sink_type, surface_id, frame_size); 782 compositor_frame_sink_type, surface_id, frame_size);
783 783
784 // FrameGenerator will add an appropriate reference for the new surface.
785 DCHECK(display_manager_->GetDisplayContaining(window));
786 display_manager_->GetDisplayContaining(window)
787 ->platform_display()
788 ->GetFrameGenerator()
789 ->AddSurfaceReference(surface_id, window);
790
784 // This is only used for testing to observe that a window has a 791 // This is only used for testing to observe that a window has a
785 // CompositorFrame. 792 // CompositorFrame.
786 if (!window_paint_callback_.is_null()) 793 if (!window_paint_callback_.is_null())
787 window_paint_callback_.Run(window); 794 window_paint_callback_.Run(window);
788 795
789 // We only care about propagating default surface IDs. 796 // We only care about propagating default surface IDs.
790 // TODO(fsamuel, sadrul): we should get rid of CompositorFrameSinkTypes. 797 // TODO(fsamuel, sadrul): we should get rid of CompositorFrameSinkTypes.
791 if (compositor_frame_sink_type != mojom::CompositorFrameSinkType::DEFAULT || 798 if (compositor_frame_sink_type != mojom::CompositorFrameSinkType::DEFAULT ||
792 !window->parent()) { 799 !window->parent()) {
793 return; 800 return;
(...skipping 12 matching lines...) Expand all
806 void WindowServer::OnUserIdAdded(const UserId& id) { 813 void WindowServer::OnUserIdAdded(const UserId& id) {
807 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); 814 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr);
808 } 815 }
809 816
810 void WindowServer::OnUserIdRemoved(const UserId& id) { 817 void WindowServer::OnUserIdRemoved(const UserId& id) {
811 activity_monitor_map_.erase(id); 818 activity_monitor_map_.erase(id);
812 } 819 }
813 820
814 } // namespace ws 821 } // namespace ws
815 } // namespace ui 822 } // 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