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/common/shell_window_ids.h" | 9 #include "ash/common/shell_window_ids.h" |
10 #include "ash/display/mouse_cursor_event_filter.h" | 10 #include "ash/display/mouse_cursor_event_filter.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 void set_cursor_location_in_root(const gfx::Point& point) { | 111 void set_cursor_location_in_root(const gfx::Point& point) { |
112 cursor_location_in_root_ = point; | 112 cursor_location_in_root_ = point; |
113 } | 113 } |
114 | 114 |
115 private: | 115 private: |
116 // ui::LayerDelegate: | 116 // ui::LayerDelegate: |
117 void OnPaintLayer(const ui::PaintContext& context) override { | 117 void OnPaintLayer(const ui::PaintContext& context) override { |
118 const SkColor kSelectedAreaOverlayColor = 0x60000000; | 118 const SkColor kSelectedAreaOverlayColor = 0x60000000; |
119 // Screenshot area representation: transparent hole with half opaque gray | 119 // Screenshot area representation: transparent hole with half opaque gray |
120 // overlay. | 120 // overlay. |
121 gfx::Rect rect(region_); | |
122 ui::PaintRecorder recorder(context, layer()->size()); | 121 ui::PaintRecorder recorder(context, layer()->size()); |
123 | 122 |
124 recorder.canvas()->FillRect(gfx::Rect(layer()->size()), | 123 recorder.canvas()->FillRect(gfx::Rect(layer()->size()), |
125 kSelectedAreaOverlayColor); | 124 kSelectedAreaOverlayColor); |
126 | 125 |
127 DrawPseudoCursor(recorder.canvas()); | 126 DrawPseudoCursor(recorder.canvas()); |
128 | 127 |
129 if (!region_.IsEmpty()) | 128 if (!region_.IsEmpty()) |
130 recorder.canvas()->FillRect(region_, SK_ColorBLACK, | 129 recorder.canvas()->FillRect(region_, SK_ColorBLACK, |
131 SkXfermode::kClear_Mode); | 130 SkXfermode::kClear_Mode); |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 | 503 |
505 void ScreenshotController::OnDisplayMetricsChanged( | 504 void ScreenshotController::OnDisplayMetricsChanged( |
506 const display::Display& display, | 505 const display::Display& display, |
507 uint32_t changed_metrics) {} | 506 uint32_t changed_metrics) {} |
508 | 507 |
509 void ScreenshotController::OnWindowDestroying(aura::Window* window) { | 508 void ScreenshotController::OnWindowDestroying(aura::Window* window) { |
510 SetSelectedWindow(nullptr); | 509 SetSelectedWindow(nullptr); |
511 } | 510 } |
512 | 511 |
513 } // namespace ash | 512 } // namespace ash |
OLD | NEW |