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

Side by Side Diff: ui/views/controls/glow_hover_controller.cc

Issue 10701063: Cleanup gfx::Canvas now that 10562027 has landed (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « ui/gfx/image/image.cc ('k') | ui/views/controls/menu/native_menu_win.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 "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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 SkPaint paint; 91 SkPaint paint;
92 paint.setStyle(SkPaint::kFill_Style); 92 paint.setStyle(SkPaint::kFill_Style);
93 paint.setAntiAlias(true); 93 paint.setAntiAlias(true);
94 paint.setShader(shader); 94 paint.setShader(shader);
95 shader->unref(); 95 shader->unref();
96 hover_canvas.DrawRect(gfx::Rect(location_.x() - radius, 96 hover_canvas.DrawRect(gfx::Rect(location_.x() - radius,
97 location_.y() - radius, 97 location_.y() - radius,
98 radius * 2, radius * 2), paint); 98 radius * 2, radius * 2), paint);
99 } 99 }
100 gfx::ImageSkia result = gfx::ImageSkiaOperations::CreateMaskedImage( 100 gfx::ImageSkia result = gfx::ImageSkiaOperations::CreateMaskedImage(
101 gfx::ImageSkia(hover_canvas.ExtractImageSkiaRep()), mask_image); 101 gfx::ImageSkia(hover_canvas.ExtractImageRep()), mask_image);
102 canvas->DrawImageInt(result, (view_->width() - mask_image.width()) / 2, 102 canvas->DrawImageInt(result, (view_->width() - mask_image.width()) / 2,
103 (view_->height() - mask_image.height()) / 2); 103 (view_->height() - mask_image.height()) / 2);
104 } 104 }
105 105
106 void GlowHoverController::AnimationEnded(const ui::Animation* animation) { 106 void GlowHoverController::AnimationEnded(const ui::Animation* animation) {
107 view_->SchedulePaint(); 107 view_->SchedulePaint();
108 } 108 }
109 109
110 void GlowHoverController::AnimationProgressed(const ui::Animation* animation) { 110 void GlowHoverController::AnimationProgressed(const ui::Animation* animation) {
111 view_->SchedulePaint(); 111 view_->SchedulePaint();
112 } 112 }
113 113
114 } // namespace views 114 } // namespace views
OLDNEW
« no previous file with comments | « ui/gfx/image/image.cc ('k') | ui/views/controls/menu/native_menu_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698