| OLD | NEW |
| 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 "ash/utility/screenshot_controller.h" | 5 #include "ash/utility/screenshot_controller.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "ash/display/mouse_cursor_event_filter.h" | 9 #include "ash/display/mouse_cursor_event_filter.h" |
| 10 #include "ash/public/cpp/shell_window_ids.h" | 10 #include "ash/public/cpp/shell_window_ids.h" |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 | 153 |
| 154 gfx::Point pseudo_cursor_point = cursor_location_in_root_; | 154 gfx::Point pseudo_cursor_point = cursor_location_in_root_; |
| 155 | 155 |
| 156 // The cursor is above/before region. | 156 // The cursor is above/before region. |
| 157 if (pseudo_cursor_point.x() == region_.x()) | 157 if (pseudo_cursor_point.x() == region_.x()) |
| 158 pseudo_cursor_point.Offset(-1, 0); | 158 pseudo_cursor_point.Offset(-1, 0); |
| 159 | 159 |
| 160 if (pseudo_cursor_point.y() == region_.y()) | 160 if (pseudo_cursor_point.y() == region_.y()) |
| 161 pseudo_cursor_point.Offset(0, -1); | 161 pseudo_cursor_point.Offset(0, -1); |
| 162 | 162 |
| 163 cc::PaintFlags paint; | 163 cc::PaintFlags flags; |
| 164 paint.setAntiAlias(false); | 164 flags.setAntiAlias(false); |
| 165 paint.setStrokeWidth(1); | 165 flags.setStrokeWidth(1); |
| 166 paint.setColor(SK_ColorWHITE); | 166 flags.setColor(SK_ColorWHITE); |
| 167 paint.setBlendMode(SkBlendMode::kSrc); | 167 flags.setBlendMode(SkBlendMode::kSrc); |
| 168 gfx::Vector2d width(kCursorSize / 2, 0); | 168 gfx::Vector2d width(kCursorSize / 2, 0); |
| 169 gfx::Vector2d height(0, kCursorSize / 2); | 169 gfx::Vector2d height(0, kCursorSize / 2); |
| 170 gfx::Vector2d white_x_offset(1, -1); | 170 gfx::Vector2d white_x_offset(1, -1); |
| 171 gfx::Vector2d white_y_offset(1, -1); | 171 gfx::Vector2d white_y_offset(1, -1); |
| 172 // Horizontal | 172 // Horizontal |
| 173 canvas->DrawLine(pseudo_cursor_point - width + white_x_offset, | 173 canvas->DrawLine(pseudo_cursor_point - width + white_x_offset, |
| 174 pseudo_cursor_point + width + white_x_offset, paint); | 174 pseudo_cursor_point + width + white_x_offset, flags); |
| 175 paint.setStrokeWidth(1); | 175 flags.setStrokeWidth(1); |
| 176 // Vertical | 176 // Vertical |
| 177 canvas->DrawLine(pseudo_cursor_point - height + white_y_offset, | 177 canvas->DrawLine(pseudo_cursor_point - height + white_y_offset, |
| 178 pseudo_cursor_point + height + white_y_offset, paint); | 178 pseudo_cursor_point + height + white_y_offset, flags); |
| 179 | 179 |
| 180 paint.setColor(SK_ColorBLACK); | 180 flags.setColor(SK_ColorBLACK); |
| 181 // Horizontal | 181 // Horizontal |
| 182 canvas->DrawLine(pseudo_cursor_point - width, pseudo_cursor_point + width, | 182 canvas->DrawLine(pseudo_cursor_point - width, pseudo_cursor_point + width, |
| 183 paint); | 183 flags); |
| 184 // Vertical | 184 // Vertical |
| 185 canvas->DrawLine(pseudo_cursor_point - height, pseudo_cursor_point + height, | 185 canvas->DrawLine(pseudo_cursor_point - height, pseudo_cursor_point + height, |
| 186 paint); | 186 flags); |
| 187 } | 187 } |
| 188 | 188 |
| 189 bool draw_inactive_overlay_; | 189 bool draw_inactive_overlay_; |
| 190 | 190 |
| 191 gfx::Rect region_; | 191 gfx::Rect region_; |
| 192 | 192 |
| 193 gfx::Point cursor_location_in_root_; | 193 gfx::Point cursor_location_in_root_; |
| 194 | 194 |
| 195 DISALLOW_COPY_AND_ASSIGN(ScreenshotLayer); | 195 DISALLOW_COPY_AND_ASSIGN(ScreenshotLayer); |
| 196 }; | 196 }; |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 545 | 545 |
| 546 void ScreenshotController::OnDisplayMetricsChanged( | 546 void ScreenshotController::OnDisplayMetricsChanged( |
| 547 const display::Display& display, | 547 const display::Display& display, |
| 548 uint32_t changed_metrics) {} | 548 uint32_t changed_metrics) {} |
| 549 | 549 |
| 550 void ScreenshotController::OnWindowDestroying(aura::Window* window) { | 550 void ScreenshotController::OnWindowDestroying(aura::Window* window) { |
| 551 SetSelectedWindow(nullptr); | 551 SetSelectedWindow(nullptr); |
| 552 } | 552 } |
| 553 | 553 |
| 554 } // namespace ash | 554 } // namespace ash |
| OLD | NEW |