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: trunk/src/ui/views/controls/glow_hover_controller.cc

Issue 24262008: Revert 224473 "Remove dependency on ui::ScaleFactor from ui/gfx" (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 3 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 "ui/views/controls/glow_hover_controller.h" 5 #include "ui/views/controls/glow_hover_controller.h"
6 6
7 #include "third_party/skia/include/effects/SkGradientShader.h" 7 #include "third_party/skia/include/effects/SkGradientShader.h"
8 #include "ui/gfx/canvas.h" 8 #include "ui/gfx/canvas.h"
9 #include "ui/gfx/image/image_skia.h" 9 #include "ui/gfx/image/image_skia.h"
10 #include "ui/gfx/image/image_skia_operations.h" 10 #include "ui/gfx/image/image_skia_operations.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 return animation_.IsShowing() || animation_.is_animating(); 76 return animation_.IsShowing() || animation_.is_animating();
77 } 77 }
78 78
79 void GlowHoverController::Draw(gfx::Canvas* canvas, 79 void GlowHoverController::Draw(gfx::Canvas* canvas,
80 const gfx::ImageSkia& mask_image) const { 80 const gfx::ImageSkia& mask_image) const {
81 if (!ShouldDraw()) 81 if (!ShouldDraw())
82 return; 82 return;
83 83
84 // Draw a radial gradient to hover_canvas. 84 // Draw a radial gradient to hover_canvas.
85 gfx::Canvas hover_canvas(gfx::Size(mask_image.width(), mask_image.height()), 85 gfx::Canvas hover_canvas(gfx::Size(mask_image.width(), mask_image.height()),
86 canvas->image_scale(), 86 canvas->scale_factor(),
87 false); 87 false);
88 88
89 // Draw a radial gradient to hover_canvas. 89 // Draw a radial gradient to hover_canvas.
90 int radius = view_->width() / 3; 90 int radius = view_->width() / 3;
91 91
92 SkPoint center_point; 92 SkPoint center_point;
93 center_point.iset(location_.x(), location_.y()); 93 center_point.iset(location_.x(), location_.y());
94 SkColor colors[2]; 94 SkColor colors[2];
95 int hover_alpha = 95 int hover_alpha =
96 static_cast<int>(255 * opacity_scale_ * animation_.GetCurrentValue()); 96 static_cast<int>(255 * opacity_scale_ * animation_.GetCurrentValue());
(...skipping 22 matching lines...) Expand all
119 119
120 void GlowHoverController::AnimationEnded(const gfx::Animation* animation) { 120 void GlowHoverController::AnimationEnded(const gfx::Animation* animation) {
121 view_->SchedulePaint(); 121 view_->SchedulePaint();
122 } 122 }
123 123
124 void GlowHoverController::AnimationProgressed(const gfx::Animation* animation) { 124 void GlowHoverController::AnimationProgressed(const gfx::Animation* animation) {
125 view_->SchedulePaint(); 125 view_->SchedulePaint();
126 } 126 }
127 127
128 } // namespace views 128 } // namespace views
OLDNEW
« no previous file with comments | « trunk/src/ui/views/controls/button/image_button.h ('k') | trunk/src/ui/views/controls/menu/menu_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698