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

Side by Side Diff: ash/launcher/launcher_button.cc

Issue 10823358: image: Specify the resize-method when resizing ImageSkia. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: deep-copy Created 8 years, 4 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 | Annotate | Revision Log
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/launcher/launcher_button.h" 5 #include "ash/launcher/launcher_button.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "ash/launcher/launcher_button_host.h" 10 #include "ash/launcher/launcher_button_host.h"
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 if (width > pref) { 267 if (width > pref) {
268 width = pref; 268 width = pref;
269 height = static_cast<int>(width / aspect_ratio); 269 height = static_cast<int>(width / aspect_ratio);
270 } 270 }
271 271
272 if (width == image.width() && height == image.height()) { 272 if (width == image.width() && height == image.height()) {
273 SetShadowedImage(image); 273 SetShadowedImage(image);
274 return; 274 return;
275 } 275 }
276 276
277 SetShadowedImage(gfx::ImageSkiaOperations::CreateResizedImage( 277 SetShadowedImage(gfx::ImageSkiaOperations::CreateResizedImage(image,
278 image, gfx::Size(width, height))); 278 skia::ImageOperations::RESIZE_BEST, gfx::Size(width, height)));
279 } 279 }
280 280
281 void LauncherButton::AddState(State state) { 281 void LauncherButton::AddState(State state) {
282 if (!(state_ & state)) { 282 if (!(state_ & state)) {
283 if (ShouldHop(state) || !ShouldHop(state_)) { 283 if (ShouldHop(state) || !ShouldHop(state_)) {
284 ui::ScopedLayerAnimationSettings scoped_setter( 284 ui::ScopedLayerAnimationSettings scoped_setter(
285 icon_view_->layer()->GetAnimator()); 285 icon_view_->layer()->GetAnimator());
286 scoped_setter.SetTransitionDuration( 286 scoped_setter.SetTransitionDuration(
287 base::TimeDelta::FromMilliseconds(kHopUpMS)); 287 base::TimeDelta::FromMilliseconds(kHopUpMS));
288 state_ |= state; 288 state_ |= state;
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 bar_->SetVerticalAlignment(views::ImageView::CENTER); 504 bar_->SetVerticalAlignment(views::ImageView::CENTER);
505 break; 505 break;
506 } 506 }
507 507
508 Layout(); 508 Layout();
509 SchedulePaint(); 509 SchedulePaint();
510 } 510 }
511 511
512 } // namespace internal 512 } // namespace internal
513 } // namespace ash 513 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/system/user/tray_user.cc » ('j') | chrome/browser/chromeos/login/wallpaper_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698