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/magnifier/partial_magnification_controller.h" | 5 #include "ash/magnifier/partial_magnification_controller.h" |
6 | 6 |
7 #include "ash/common/system/chromeos/palette/palette_utils.h" | 7 #include "ash/common/system/chromeos/palette/palette_utils.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "third_party/skia/include/core/SkDrawLooper.h" | 9 #include "third_party/skia/include/core/SkDrawLooper.h" |
10 #include "ui/aura/window_event_dispatcher.h" | 10 #include "ui/aura/window_event_dispatcher.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 155 |
156 private: | 156 private: |
157 // ui::LayerDelegate: | 157 // ui::LayerDelegate: |
158 void OnPaintLayer(const ui::PaintContext& context) override { | 158 void OnPaintLayer(const ui::PaintContext& context) override { |
159 ui::PaintRecorder recorder(context, magnifier_window_bounds_.size()); | 159 ui::PaintRecorder recorder(context, magnifier_window_bounds_.size()); |
160 | 160 |
161 // Draw the shadow. | 161 // Draw the shadow. |
162 cc::PaintFlags shadow_flags; | 162 cc::PaintFlags shadow_flags; |
163 shadow_flags.setAntiAlias(true); | 163 shadow_flags.setAntiAlias(true); |
164 shadow_flags.setColor(SK_ColorTRANSPARENT); | 164 shadow_flags.setColor(SK_ColorTRANSPARENT); |
165 shadow_flags.setLooper( | 165 shadow_flags.setLooper(gfx::CreateShadowDrawLooper(magnifier_shadows_)); |
166 gfx::CreateShadowDrawLooperCorrectBlur(magnifier_shadows_)); | |
167 gfx::Rect shadow_bounds(magnifier_window_bounds_.size()); | 166 gfx::Rect shadow_bounds(magnifier_window_bounds_.size()); |
168 recorder.canvas()->DrawCircle( | 167 recorder.canvas()->DrawCircle( |
169 shadow_bounds.CenterPoint(), | 168 shadow_bounds.CenterPoint(), |
170 shadow_bounds.width() / 2 - kShadowThickness - kShadowOffset, | 169 shadow_bounds.width() / 2 - kShadowThickness - kShadowOffset, |
171 shadow_flags); | 170 shadow_flags); |
172 | 171 |
173 cc::PaintFlags border_flags; | 172 cc::PaintFlags border_flags; |
174 border_flags.setAntiAlias(true); | 173 border_flags.setAntiAlias(true); |
175 border_flags.setStyle(cc::PaintFlags::kStroke_Style); | 174 border_flags.setStyle(cc::PaintFlags::kStroke_Style); |
176 | 175 |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 | 372 |
374 void PartialMagnificationController::RemoveZoomWidgetObservers() { | 373 void PartialMagnificationController::RemoveZoomWidgetObservers() { |
375 DCHECK(host_widget_); | 374 DCHECK(host_widget_); |
376 host_widget_->RemoveObserver(this); | 375 host_widget_->RemoveObserver(this); |
377 aura::Window* root_window = host_widget_->GetNativeView()->GetRootWindow(); | 376 aura::Window* root_window = host_widget_->GetNativeView()->GetRootWindow(); |
378 DCHECK(root_window); | 377 DCHECK(root_window); |
379 root_window->RemoveObserver(this); | 378 root_window->RemoveObserver(this); |
380 } | 379 } |
381 | 380 |
382 } // namespace ash | 381 } // namespace ash |
OLD | NEW |