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

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
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 765 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 surface_info); 782 surface_info);
783 783
784 // FrameGenerator will add an appropriate reference for the new surface. 784 // FrameGenerator will add an appropriate reference for the new surface.
785 DCHECK(display_manager_->GetDisplayContaining(window)); 785 DCHECK(display_manager_->GetDisplayContaining(window));
786 display_manager_->GetDisplayContaining(window) 786 auto display = display_manager_->GetDisplayContaining(window);
787 ->platform_display() 787 if (window == display->GetActiveRootWindow()) {
788 ->GetFrameGenerator() 788 display->platform_display()->GetFrameGenerator()->OnSurfaceCreated(
789 ->OnSurfaceCreated(surface_info.id(), window); 789 surface_info);
790 }
790 791
791 // This is only used for testing to observe that a window has a 792 // This is only used for testing to observe that a window has a
792 // CompositorFrame. 793 // CompositorFrame.
793 if (!window_paint_callback_.is_null()) 794 if (!window_paint_callback_.is_null())
794 window_paint_callback_.Run(window); 795 window_paint_callback_.Run(window);
795 796
796 if (!window->parent()) 797 if (!window->parent())
797 return; 798 return;
798 799
799 WindowTree* window_tree = GetTreeWithId(window->parent()->id().client_id); 800 WindowTree* window_tree = GetTreeWithId(window->parent()->id().client_id);
800 if (window_tree) 801 if (window_tree)
801 window_tree->ProcessWindowSurfaceChanged(window, surface_info); 802 window_tree->ProcessWindowSurfaceChanged(window, surface_info);
802 } 803 }
803 804
804 void WindowServer::OnActiveUserIdChanged(const UserId& previously_active_id, 805 void WindowServer::OnActiveUserIdChanged(const UserId& previously_active_id,
805 const UserId& active_id) { 806 const UserId& active_id) {
806 } 807 }
807 808
808 void WindowServer::OnUserIdAdded(const UserId& id) { 809 void WindowServer::OnUserIdAdded(const UserId& id) {
809 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); 810 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr);
810 } 811 }
811 812
812 void WindowServer::OnUserIdRemoved(const UserId& id) { 813 void WindowServer::OnUserIdRemoved(const UserId& id) {
813 activity_monitor_map_.erase(id); 814 activity_monitor_map_.erase(id);
814 } 815 }
815 816
816 } // namespace ws 817 } // namespace ws
817 } // namespace ui 818 } // namespace ui
OLDNEW
« services/ui/ws/frame_generator.cc ('K') | « services/ui/ws/frame_generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698