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

Side by Side Diff: ash/wm/gestures/long_press_affordance_handler.cc

Issue 11087093: Migrate ui::Transform to gfx::Transform (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Should pass trybots this time Created 8 years, 2 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 | « ash/system/web_notification/web_notification_view.cc ('k') | ash/wm/image_grid.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/wm/gestures/long_press_affordance_handler.h" 5 #include "ash/wm/gestures/long_press_affordance_handler.h"
6 6
7 #include "ash/display/display_controller.h" 7 #include "ash/display/display_controller.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/root_window_controller.h" 9 #include "ash/root_window_controller.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 virtual gfx::Size GetPreferredSize() OVERRIDE { 193 virtual gfx::Size GetPreferredSize() OVERRIDE {
194 return gfx::Size(2 * (kAffordanceOuterRadius + kAffordanceGlowWidth), 194 return gfx::Size(2 * (kAffordanceOuterRadius + kAffordanceGlowWidth),
195 2 * (kAffordanceOuterRadius + kAffordanceGlowWidth)); 195 2 * (kAffordanceOuterRadius + kAffordanceGlowWidth));
196 } 196 }
197 197
198 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { 198 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {
199 gfx::Point center(GetPreferredSize().width() / 2, 199 gfx::Point center(GetPreferredSize().width() / 2,
200 GetPreferredSize().height() / 2); 200 GetPreferredSize().height() / 2);
201 canvas->Save(); 201 canvas->Save();
202 202
203 ui::Transform scale; 203 gfx::Transform scale;
204 scale.SetScale(current_scale_, current_scale_); 204 scale.SetScale(current_scale_, current_scale_);
205 // We want to scale from the center. 205 // We want to scale from the center.
206 canvas->Translate(gfx::Point(center.x(), center.y())); 206 canvas->Translate(gfx::Point(center.x(), center.y()));
207 canvas->Transform(scale); 207 canvas->Transform(scale);
208 canvas->Translate(gfx::Point(-center.x(), -center.y())); 208 canvas->Translate(gfx::Point(-center.x(), -center.y()));
209 209
210 // Paint affordance glow 210 // Paint affordance glow
211 int start_radius = kAffordanceInnerRadius - kAffordanceGlowWidth; 211 int start_radius = kAffordanceInnerRadius - kAffordanceGlowWidth;
212 int end_radius = kAffordanceOuterRadius + kAffordanceGlowWidth; 212 int end_radius = kAffordanceOuterRadius + kAffordanceGlowWidth;
213 const int num_colors = 3; 213 const int num_colors = 3;
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 default: 369 default:
370 view_.reset(); 370 view_.reset();
371 tap_down_touch_id_ = -1; 371 tap_down_touch_id_ = -1;
372 tap_down_display_id_ = 0; 372 tap_down_display_id_ = 0;
373 break; 373 break;
374 } 374 }
375 } 375 }
376 376
377 } // namespace internal 377 } // namespace internal
378 } // namespace ash 378 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/web_notification/web_notification_view.cc ('k') | ash/wm/image_grid.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698