| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/wm/drag_window_controller.h" | 5 #include "ash/wm/drag_window_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/public/cpp/shell_window_ids.h" | 9 #include "ash/public/cpp/shell_window_ids.h" |
| 10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
| 11 #include "ash/wm/window_util.h" | 11 #include "ash/wm/window_util.h" |
| 12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
| 13 #include "ui/aura/client/aura_constants.h" | 13 #include "ui/aura/client/aura_constants.h" |
| 14 #include "ui/aura/client/screen_position_client.h" | 14 #include "ui/aura/client/screen_position_client.h" |
| 15 #include "ui/aura/window.h" | 15 #include "ui/aura/window.h" |
| 16 #include "ui/aura/window_delegate.h" | 16 #include "ui/aura/window_delegate.h" |
| 17 #include "ui/aura/window_event_dispatcher.h" | 17 #include "ui/aura/window_event_dispatcher.h" |
| 18 #include "ui/aura/window_tree_host.h" |
| 18 #include "ui/base/hit_test.h" | 19 #include "ui/base/hit_test.h" |
| 20 #include "ui/compositor/compositor.h" |
| 19 #include "ui/compositor/layer.h" | 21 #include "ui/compositor/layer.h" |
| 20 #include "ui/compositor/layer_tree_owner.h" | 22 #include "ui/compositor/layer_tree_owner.h" |
| 21 #include "ui/compositor/paint_context.h" | 23 #include "ui/compositor/paint_context.h" |
| 22 #include "ui/compositor/scoped_layer_animation_settings.h" | 24 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 23 #include "ui/display/display.h" | 25 #include "ui/display/display.h" |
| 24 #include "ui/views/view.h" | 26 #include "ui/views/view.h" |
| 25 #include "ui/views/widget/widget.h" | 27 #include "ui/views/widget/widget.h" |
| 26 #include "ui/wm/core/coordinate_conversion.h" | 28 #include "ui/wm/core/coordinate_conversion.h" |
| 27 #include "ui/wm/core/shadow_types.h" | 29 #include "ui/wm/core/shadow_types.h" |
| 28 #include "ui/wm/core/window_util.h" | 30 #include "ui/wm/core/window_util.h" |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 if (details->layer_owner_) { | 227 if (details->layer_owner_) { |
| 226 if (index == 0) | 228 if (index == 0) |
| 227 return details->layer_owner_.get(); | 229 return details->layer_owner_.get(); |
| 228 index--; | 230 index--; |
| 229 } | 231 } |
| 230 } | 232 } |
| 231 return nullptr; | 233 return nullptr; |
| 232 } | 234 } |
| 233 | 235 |
| 234 void DragWindowController::RequestLayerPaintForTest() { | 236 void DragWindowController::RequestLayerPaintForTest() { |
| 235 ui::PaintContext context(nullptr, 1.0f, gfx::Rect()); | 237 ui::PaintContext context(nullptr, 1.0f, gfx::Rect(), |
| 238 window_->GetHost()->compositor()->is_pixel_canvas()); |
| 236 for (auto& details : drag_windows_) { | 239 for (auto& details : drag_windows_) { |
| 237 std::vector<ui::Layer*> layers; | 240 std::vector<ui::Layer*> layers; |
| 238 layers.push_back(details->drag_window_->layer()); | 241 layers.push_back(details->drag_window_->layer()); |
| 239 while (layers.size()) { | 242 while (layers.size()) { |
| 240 ui::Layer* layer = layers.back(); | 243 ui::Layer* layer = layers.back(); |
| 241 layers.pop_back(); | 244 layers.pop_back(); |
| 242 if (layer->delegate()) | 245 if (layer->delegate()) |
| 243 layer->delegate()->OnPaintLayer(context); | 246 layer->delegate()->OnPaintLayer(context); |
| 244 for (auto* child : layer->children()) | 247 for (auto* child : layer->children()) |
| 245 layers.push_back(child); | 248 layers.push_back(child); |
| 246 } | 249 } |
| 247 } | 250 } |
| 248 } | 251 } |
| 249 | 252 |
| 250 } // namespace ash | 253 } // namespace ash |
| OLD | NEW |