Index: services/ui/ws/window_server.cc |
diff --git a/services/ui/ws/window_server.cc b/services/ui/ws/window_server.cc |
index 9b1302cdce6cdd0a3d33749e790e5088694477e7..e3da19d96ba8648de7e6b528c02776089600df95 100644 |
--- a/services/ui/ws/window_server.cc |
+++ b/services/ui/ws/window_server.cc |
@@ -214,13 +214,6 @@ ServerWindow* WindowServer::GetWindow(const WindowId& id) { |
return tree ? tree->GetWindow(id) : nullptr; |
} |
-void WindowServer::SchedulePaint(ServerWindow* window, |
- const gfx::Rect& bounds) { |
- Display* display = display_manager_->GetDisplayContaining(window); |
- if (display) |
- display->SchedulePaint(window, bounds); |
-} |
- |
void WindowServer::OnTreeMessagedClient(ClientSpecificId id) { |
if (current_operation_) |
current_operation_->MarkTreeAsMessaged(id); |
@@ -296,15 +289,10 @@ bool WindowServer::IsActiveUserInHighContrastMode() const { |
} |
void WindowServer::SetHighContrastMode(const UserId& user, bool enabled) { |
+ // TODO(fsamuel): This doesn't really seem like it's a window server concept? |
if (IsUserInHighContrastMode(user) == enabled) |
return; |
high_contrast_mode_[user] = enabled; |
- if (user_id_tracker_.active_id() != user) |
- return; |
- for (Display* display : display_manager_->displays()) { |
- display->SchedulePaint(display->root_window(), |
- gfx::Rect(display->root_window()->bounds().size())); |
- } |
} |
uint32_t WindowServer::GenerateWindowManagerChangeId( |
@@ -612,18 +600,8 @@ bool WindowServer::IsUserInHighContrastMode(const UserId& user) const { |
return (iter == high_contrast_mode_.end()) ? false : iter->second; |
} |
-void WindowServer::OnScheduleWindowPaint(ServerWindow* window) { |
- if (in_destructor_) |
- return; |
- |
- SchedulePaint(window, gfx::Rect(window->bounds().size())); |
- if (!window_paint_callback_.is_null()) |
- window_paint_callback_.Run(window); |
-} |
- |
-const ServerWindow* WindowServer::GetRootWindow( |
- const ServerWindow* window) const { |
- const Display* display = display_manager_->GetDisplayContaining(window); |
+ServerWindow* WindowServer::GetRootWindow(const ServerWindow* window) { |
+ Display* display = display_manager_->GetDisplayContaining(window); |
return display ? display->root_window() : nullptr; |
} |
@@ -654,12 +632,6 @@ void WindowServer::OnWindowHierarchyChanged(ServerWindow* window, |
ProcessWindowHierarchyChanged(window, new_parent, old_parent); |
- // TODO(beng): optimize. |
- if (old_parent) |
- SchedulePaint(old_parent, gfx::Rect(old_parent->bounds().size())); |
- if (new_parent) |
- SchedulePaint(new_parent, gfx::Rect(new_parent->bounds().size())); |
- |
UpdateNativeCursorFromMouseLocation(window); |
} |
@@ -673,9 +645,6 @@ void WindowServer::OnWindowBoundsChanged(ServerWindow* window, |
if (!window->parent()) |
return; |
- SchedulePaint(window->parent(), old_bounds); |
- SchedulePaint(window->parent(), new_bounds); |
- |
UpdateNativeCursorFromMouseLocation(window); |
} |
@@ -696,8 +665,6 @@ void WindowServer::OnWindowReordered(ServerWindow* window, |
ServerWindow* relative, |
mojom::OrderDirection direction) { |
ProcessWindowReorder(window, relative, direction); |
- if (!in_destructor_) |
- SchedulePaint(window, gfx::Rect(window->bounds().size())); |
UpdateNativeCursorFromMouseLocation(window); |
} |
@@ -705,14 +672,6 @@ void WindowServer::OnWillChangeWindowVisibility(ServerWindow* window) { |
if (in_destructor_) |
return; |
- // Need to repaint if the window was drawn (which means it's in the process of |
- // hiding) or the window is transitioning to drawn. |
- if (window->parent() && |
- (window->IsDrawn() || |
- (!window->visible() && window->parent()->IsDrawn()))) { |
- SchedulePaint(window->parent(), window->bounds()); |
- } |
- |
for (auto& pair : tree_map_) { |
pair.second->ProcessWillChangeWindowVisibility( |
window, IsOperationSource(pair.first)); |
@@ -822,6 +781,11 @@ void WindowServer::OnSurfaceCreated(const cc::SurfaceId& surface_id, |
window->GetOrCreateCompositorFrameSinkManager()->SetLatestSurfaceInfo( |
compositor_frame_sink_type, surface_id, frame_size); |
+ // This is only used for testing to observe that a window has a |
+ // CompositorFrame. |
+ if (!window_paint_callback_.is_null()) |
+ window_paint_callback_.Run(window); |
+ |
// We only care about propagating default surface IDs. |
// TODO(fsamuel, sadrul): we should get rid of CompositorFrameSinkTypes. |
if (compositor_frame_sink_type != mojom::CompositorFrameSinkType::DEFAULT || |
@@ -837,13 +801,6 @@ void WindowServer::OnSurfaceCreated(const cc::SurfaceId& surface_id, |
void WindowServer::OnActiveUserIdChanged(const UserId& previously_active_id, |
const UserId& active_id) { |
- if (IsUserInHighContrastMode(previously_active_id) == |
- IsUserInHighContrastMode(active_id)) |
- return; |
- for (Display* display : display_manager_->displays()) { |
- display->SchedulePaint(display->root_window(), |
- gfx::Rect(display->root_window()->bounds().size())); |
- } |
} |
void WindowServer::OnUserIdAdded(const UserId& id) { |