| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <math.h> | 5 #include <math.h> |
| 6 | 6 |
| 7 #include "services/keyboard_native/view_observer_delegate.h" | 7 #include "services/keyboard_native/view_observer_delegate.h" |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/sys_info.h" | 10 #include "base/sys_info.h" |
| 11 #include "mojo/public/cpp/application/application_impl.h" | 11 #include "mojo/public/cpp/application/application_impl.h" |
| 12 #include "mojo/skia/ganesh_surface.h" | 12 #include "mojo/skia/ganesh_surface.h" |
| 13 #include "services/keyboard_native/clip_animation.h" | 13 #include "services/keyboard_native/clip_animation.h" |
| 14 #include "services/keyboard_native/keyboard_service_impl.h" | 14 #include "services/keyboard_native/keyboard_service_impl.h" |
| 15 #include "skia/ext/refptr.h" | 15 #include "skia/ext/refptr.h" |
| 16 #include "third_party/skia/include/core/SkCanvas.h" | 16 #include "third_party/skia/include/core/SkCanvas.h" |
| 17 #include "third_party/skia/include/core/SkTypeface.h" | 17 #include "third_party/skia/include/core/SkTypeface.h" |
| 18 #include "ui/gfx/geometry/rect_f.h" |
| 18 | 19 |
| 19 namespace keyboard { | 20 namespace keyboard { |
| 20 | 21 |
| 21 static const base::TimeDelta kAnimationDurationMs = | 22 static const base::TimeDelta kAnimationDurationMs = |
| 22 base::TimeDelta::FromMilliseconds(1000); | 23 base::TimeDelta::FromMilliseconds(1000); |
| 23 | 24 |
| 24 mojo::Size ToSize(const mojo::Rect& rect) { | 25 mojo::Size ToSize(const mojo::Rect& rect) { |
| 25 mojo::Size size; | 26 mojo::Size size; |
| 26 size.width = rect.width; | 27 size.width = rect.width; |
| 27 size.height = rect.height; | 28 size.height = rect.height; |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 | 269 |
| 269 void ViewObserverDelegate::OnViewDestroyed(mojo::View* view) { | 270 void ViewObserverDelegate::OnViewDestroyed(mojo::View* view) { |
| 270 if (view_ == view) { | 271 if (view_ == view) { |
| 271 view_->RemoveObserver(this); | 272 view_->RemoveObserver(this); |
| 272 view_ = nullptr; | 273 view_ = nullptr; |
| 273 gl_context_->Destroy(); | 274 gl_context_->Destroy(); |
| 274 } | 275 } |
| 275 } | 276 } |
| 276 | 277 |
| 277 } // namespace keyboard | 278 } // namespace keyboard |
| OLD | NEW |