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

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

Issue 2651843002: FrameGenerator should receive SurfaceInfo and use it in frame generation (Closed)
Patch Set: c Created 3 years, 11 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/test_utils.cc ('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 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 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 return; 780 return;
781 781
782 // Cache the last submitted surface ID in the window server. 782 // Cache the last submitted surface ID in the window server.
783 // DisplayCompositorFrameSink may submit a CompositorFrame without 783 // DisplayCompositorFrameSink may submit a CompositorFrame without
784 // creating a CompositorFrameSinkManager. 784 // creating a CompositorFrameSinkManager.
785 window->GetOrCreateCompositorFrameSinkManager()->SetLatestSurfaceInfo( 785 window->GetOrCreateCompositorFrameSinkManager()->SetLatestSurfaceInfo(
786 surface_info); 786 surface_info);
787 787
788 // FrameGenerator will add an appropriate reference for the new surface. 788 // FrameGenerator will add an appropriate reference for the new surface.
789 DCHECK(display_manager_->GetDisplayContaining(window)); 789 DCHECK(display_manager_->GetDisplayContaining(window));
790 display_manager_->GetDisplayContaining(window) 790 auto display = display_manager_->GetDisplayContaining(window);
791 ->platform_display() 791 if (window == display->GetActiveRootWindow()) {
792 ->GetFrameGenerator() 792 display->platform_display()->GetFrameGenerator()->OnSurfaceCreated(
793 ->OnSurfaceCreated(surface_info.id(), window); 793 surface_info);
794 }
794 795
795 // This is only used for testing to observe that a window has a 796 // This is only used for testing to observe that a window has a
796 // CompositorFrame. 797 // CompositorFrame.
797 if (!window_paint_callback_.is_null()) 798 if (!window_paint_callback_.is_null())
798 window_paint_callback_.Run(window); 799 window_paint_callback_.Run(window);
799 800
800 if (!window->parent()) 801 if (!window->parent())
801 return; 802 return;
802 803
803 WindowTree* window_tree = GetTreeWithId(window->parent()->id().client_id); 804 WindowTree* window_tree = GetTreeWithId(window->parent()->id().client_id);
804 if (window_tree) 805 if (window_tree)
805 window_tree->ProcessWindowSurfaceChanged(window, surface_info); 806 window_tree->ProcessWindowSurfaceChanged(window, surface_info);
806 } 807 }
807 808
808 void WindowServer::OnActiveUserIdChanged(const UserId& previously_active_id, 809 void WindowServer::OnActiveUserIdChanged(const UserId& previously_active_id,
809 const UserId& active_id) { 810 const UserId& active_id) {
810 } 811 }
811 812
812 void WindowServer::OnUserIdAdded(const UserId& id) { 813 void WindowServer::OnUserIdAdded(const UserId& id) {
813 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); 814 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr);
814 } 815 }
815 816
816 void WindowServer::OnUserIdRemoved(const UserId& id) { 817 void WindowServer::OnUserIdRemoved(const UserId& id) {
817 activity_monitor_map_.erase(id); 818 activity_monitor_map_.erase(id);
818 } 819 }
819 820
820 } // namespace ws 821 } // namespace ws
821 } // namespace ui 822 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/test_utils.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698