services/ui: Set the gpu_channel_ to new added displays.
On minnie, the Display initializing is slow, so the display is ready after GpuService. So only notifying initialized displays when the GPU channel is established is not sufficient. We need also set the GPU channel to every display when it is ready. BUG=None Review-Url: https://codereview.chromium.org/2290363002 Cr-Commit-Position: refs/heads/master@{#415332}
This commit is contained in:
services/ui/ws
@ -139,7 +139,7 @@ void DisplayManager::OnDisplayAcceleratedWidgetAvailable(Display* display) {
|
||||
displays_.insert(display);
|
||||
pending_displays_.erase(display);
|
||||
if (is_first_display)
|
||||
window_server_->OnFirstDisplayReady();
|
||||
window_server_->OnDisplayReady(display, is_first_display);
|
||||
}
|
||||
|
||||
void DisplayManager::OnActiveUserIdChanged(const UserId& previously_active_id,
|
||||
|
@ -484,8 +484,11 @@ gfx::Rect WindowServer::GetCurrentMoveLoopRevertBounds() {
|
||||
return gfx::Rect();
|
||||
}
|
||||
|
||||
void WindowServer::OnFirstDisplayReady() {
|
||||
delegate_->OnFirstDisplayReady();
|
||||
void WindowServer::OnDisplayReady(Display* display, bool is_first) {
|
||||
if (gpu_channel_)
|
||||
display->platform_display()->OnGpuChannelEstablished(gpu_channel_);
|
||||
if (is_first)
|
||||
delegate_->OnFirstDisplayReady();
|
||||
}
|
||||
|
||||
void WindowServer::OnNoMoreDisplays() {
|
||||
@ -768,9 +771,10 @@ void WindowServer::OnTransientWindowRemoved(ServerWindow* window,
|
||||
|
||||
void WindowServer::OnGpuChannelEstablished(
|
||||
scoped_refptr<gpu::GpuChannelHost> gpu_channel) {
|
||||
gpu_channel_ = std::move(gpu_channel);
|
||||
const std::set<Display*>& displays = display_manager()->displays();
|
||||
for (auto* display : displays)
|
||||
display->platform_display()->OnGpuChannelEstablished(gpu_channel);
|
||||
display->platform_display()->OnGpuChannelEstablished(gpu_channel_);
|
||||
}
|
||||
|
||||
void WindowServer::OnActiveUserIdChanged(const UserId& previously_active_id,
|
||||
|
@ -220,7 +220,7 @@ class WindowServer : public ServerWindowDelegate,
|
||||
gfx::Rect GetCurrentMoveLoopRevertBounds();
|
||||
bool in_move_loop() const { return !!current_move_loop_; }
|
||||
|
||||
void OnFirstDisplayReady();
|
||||
void OnDisplayReady(Display* display, bool is_first);
|
||||
void OnNoMoreDisplays();
|
||||
WindowManagerState* GetWindowManagerStateForUser(const UserId& user_id);
|
||||
|
||||
@ -366,6 +366,7 @@ class WindowServer : public ServerWindowDelegate,
|
||||
uint32_t next_wm_change_id_;
|
||||
|
||||
std::unique_ptr<GpuServiceProxy> gpu_proxy_;
|
||||
scoped_refptr<gpu::GpuChannelHost> gpu_channel_;
|
||||
base::Callback<void(ServerWindow*)> window_paint_callback_;
|
||||
|
||||
UserActivityMonitorMap activity_monitor_map_;
|
||||
|
Reference in New Issue
Block a user