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

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

Issue 2290363002: services/ui: Set the gpu_channel_ to new added displays. (Closed)
Patch Set: Created 4 years, 3 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/window_server.h ('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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 return current_move_loop_->initiator; 477 return current_move_loop_->initiator;
478 return nullptr; 478 return nullptr;
479 } 479 }
480 480
481 gfx::Rect WindowServer::GetCurrentMoveLoopRevertBounds() { 481 gfx::Rect WindowServer::GetCurrentMoveLoopRevertBounds() {
482 if (current_move_loop_) 482 if (current_move_loop_)
483 return current_move_loop_->revert_bounds; 483 return current_move_loop_->revert_bounds;
484 return gfx::Rect(); 484 return gfx::Rect();
485 } 485 }
486 486
487 void WindowServer::OnFirstDisplayReady() { 487 void WindowServer::OnDisplayReady(Display* display, bool is_first) {
488 delegate_->OnFirstDisplayReady(); 488 if (gpu_channel_)
489 display->platform_display()->OnGpuChannelEstablished(gpu_channel_);
490 if (is_first)
491 delegate_->OnFirstDisplayReady();
489 } 492 }
490 493
491 void WindowServer::OnNoMoreDisplays() { 494 void WindowServer::OnNoMoreDisplays() {
492 delegate_->OnNoMoreDisplays(); 495 delegate_->OnNoMoreDisplays();
493 } 496 }
494 497
495 WindowManagerState* WindowServer::GetWindowManagerStateForUser( 498 WindowManagerState* WindowServer::GetWindowManagerStateForUser(
496 const UserId& user_id) { 499 const UserId& user_id) {
497 return window_manager_window_tree_factory_set_.GetWindowManagerStateForUser( 500 return window_manager_window_tree_factory_set_.GetWindowManagerStateForUser(
498 user_id); 501 user_id);
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
761 if (current_operation_type() == OperationType::DELETE_WINDOW) 764 if (current_operation_type() == OperationType::DELETE_WINDOW)
762 return; 765 return;
763 for (auto& pair : tree_map_) { 766 for (auto& pair : tree_map_) {
764 pair.second->ProcessTransientWindowRemoved(window, transient_child, 767 pair.second->ProcessTransientWindowRemoved(window, transient_child,
765 IsOperationSource(pair.first)); 768 IsOperationSource(pair.first));
766 } 769 }
767 } 770 }
768 771
769 void WindowServer::OnGpuChannelEstablished( 772 void WindowServer::OnGpuChannelEstablished(
770 scoped_refptr<gpu::GpuChannelHost> gpu_channel) { 773 scoped_refptr<gpu::GpuChannelHost> gpu_channel) {
774 gpu_channel_ = std::move(gpu_channel);
771 const std::set<Display*>& displays = display_manager()->displays(); 775 const std::set<Display*>& displays = display_manager()->displays();
772 for (auto* display : displays) 776 for (auto* display : displays)
773 display->platform_display()->OnGpuChannelEstablished(gpu_channel); 777 display->platform_display()->OnGpuChannelEstablished(gpu_channel_);
774 } 778 }
775 779
776 void WindowServer::OnActiveUserIdChanged(const UserId& previously_active_id, 780 void WindowServer::OnActiveUserIdChanged(const UserId& previously_active_id,
777 const UserId& active_id) { 781 const UserId& active_id) {
778 if (IsUserInHighContrastMode(previously_active_id) == 782 if (IsUserInHighContrastMode(previously_active_id) ==
779 IsUserInHighContrastMode(active_id)) 783 IsUserInHighContrastMode(active_id))
780 return; 784 return;
781 for (Display* display : display_manager_->displays()) { 785 for (Display* display : display_manager_->displays()) {
782 display->SchedulePaint(display->root_window(), 786 display->SchedulePaint(display->root_window(),
783 gfx::Rect(display->root_window()->bounds().size())); 787 gfx::Rect(display->root_window()->bounds().size()));
784 } 788 }
785 } 789 }
786 790
787 void WindowServer::OnUserIdAdded(const UserId& id) { 791 void WindowServer::OnUserIdAdded(const UserId& id) {
788 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr); 792 activity_monitor_map_[id] = base::MakeUnique<UserActivityMonitor>(nullptr);
789 clipboard_map_[id] = base::MakeUnique<clipboard::ClipboardImpl>(); 793 clipboard_map_[id] = base::MakeUnique<clipboard::ClipboardImpl>();
790 } 794 }
791 795
792 void WindowServer::OnUserIdRemoved(const UserId& id) { 796 void WindowServer::OnUserIdRemoved(const UserId& id) {
793 activity_monitor_map_.erase(id); 797 activity_monitor_map_.erase(id);
794 clipboard_map_.erase(id); 798 clipboard_map_.erase(id);
795 } 799 }
796 800
797 } // namespace ws 801 } // namespace ws
798 } // namespace ui 802 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/window_server.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698