Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1064)

Side by Side Diff: services/keyboard_native/view_observer_delegate.cc

Issue 1149293002: Add the ability for keys to be drawn as an image. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Addressed nits Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « services/keyboard_native/res/Emoticon.png.sha1 ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « services/keyboard_native/res/Emoticon.png.sha1 ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698