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

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

Issue 2711043002: Remove latest_submitted_surface_info (Closed)
Patch Set: Remove latest_submitted_surface_info Created 3 years, 9 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 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 756 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 } 767 }
768 768
769 void WindowServer::OnSurfaceCreated(const cc::SurfaceInfo& surface_info) { 769 void WindowServer::OnSurfaceCreated(const cc::SurfaceInfo& surface_info) {
770 WindowId window_id( 770 WindowId window_id(
771 WindowIdFromTransportId(surface_info.id().frame_sink_id().client_id())); 771 WindowIdFromTransportId(surface_info.id().frame_sink_id().client_id()));
772 ServerWindow* window = GetWindow(window_id); 772 ServerWindow* window = GetWindow(window_id);
773 // If the window doesn't have a parent then we have nothing to propagate. 773 // If the window doesn't have a parent then we have nothing to propagate.
774 if (!window) 774 if (!window)
775 return; 775 return;
776 776
777 // Cache the last submitted surface ID in the window server.
778 // DisplayCompositorFrameSink may submit a CompositorFrame without
779 // creating a CompositorFrameSinkManager.
780 window->GetOrCreateCompositorFrameSinkManager()->SetLatestSurfaceInfo(
781 surface_info);
782
783 // FrameGenerator will add an appropriate reference for the new surface. 777 // FrameGenerator will add an appropriate reference for the new surface.
784 DCHECK(display_manager_->GetDisplayContaining(window)); 778 DCHECK(display_manager_->GetDisplayContaining(window));
785 auto* display = display_manager_->GetDisplayContaining(window); 779 auto* display = display_manager_->GetDisplayContaining(window);
786 if (window == display->GetActiveRootWindow()) { 780 if (window == display->GetActiveRootWindow()) {
787 display->platform_display()->GetFrameGenerator()->OnSurfaceCreated( 781 display->platform_display()->GetFrameGenerator()->OnSurfaceCreated(
788 surface_info); 782 surface_info);
789 } 783 }
790 784
791 // This is only used for testing to observe that a window has a 785 // This is only used for testing to observe that a window has a
792 // CompositorFrame. 786 // CompositorFrame.
(...skipping 15 matching lines...) Expand all
808 void WindowServer::OnUserIdAdded(const UserId& id) { 802 void WindowServer::OnUserIdAdded(const UserId& id) {
809 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); 803 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr);
810 } 804 }
811 805
812 void WindowServer::OnUserIdRemoved(const UserId& id) { 806 void WindowServer::OnUserIdRemoved(const UserId& id) {
813 activity_monitor_map_.erase(id); 807 activity_monitor_map_.erase(id);
814 } 808 }
815 809
816 } // namespace ws 810 } // namespace ws
817 } // namespace ui 811 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/server_window_compositor_frame_sink_manager.cc ('k') | services/ui/ws/window_server_test_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698