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

Side by Side Diff: views/controls/button/text_button.cc

Issue 146131: Update Skia transfer modes to match changes in Skia as of r239 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | views/controls/menu/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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 "views/controls/button/text_button.h" 5 #include "views/controls/button/text_button.h"
6 6
7 #include "app/gfx/canvas.h" 7 #include "app/gfx/canvas.h"
8 #include "app/l10n_util.h" 8 #include "app/l10n_util.h"
9 #include "app/throb_animation.h" 9 #include "app/throb_animation.h"
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 void TextButton::Paint(gfx::Canvas* canvas, bool for_drag) { 202 void TextButton::Paint(gfx::Canvas* canvas, bool for_drag) {
203 if (!for_drag) { 203 if (!for_drag) {
204 PaintBackground(canvas); 204 PaintBackground(canvas);
205 205
206 if (hover_animation_->IsAnimating()) { 206 if (hover_animation_->IsAnimating()) {
207 // Draw the hover bitmap into an offscreen buffer, then blend it 207 // Draw the hover bitmap into an offscreen buffer, then blend it
208 // back into the current canvas. 208 // back into the current canvas.
209 canvas->saveLayerAlpha(NULL, 209 canvas->saveLayerAlpha(NULL,
210 static_cast<int>(hover_animation_->GetCurrentValue() * 255), 210 static_cast<int>(hover_animation_->GetCurrentValue() * 255),
211 SkCanvas::kARGB_NoClipLayer_SaveFlag); 211 SkCanvas::kARGB_NoClipLayer_SaveFlag);
212 canvas->drawARGB(0, 255, 255, 255, SkPorterDuff::kClear_Mode); 212 canvas->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode);
213 PaintBorder(canvas); 213 PaintBorder(canvas);
214 canvas->restore(); 214 canvas->restore();
215 } else if (state_ == BS_HOT || state_ == BS_PUSHED) { 215 } else if (state_ == BS_HOT || state_ == BS_PUSHED) {
216 PaintBorder(canvas); 216 PaintBorder(canvas);
217 } 217 }
218 218
219 PaintFocusBorder(canvas); 219 PaintFocusBorder(canvas);
220 } 220 }
221 221
222 gfx::Insets insets = GetInsets(); 222 gfx::Insets insets = GetInsets();
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 337
338 bool TextButton::OnMousePressed(const MouseEvent& e) { 338 bool TextButton::OnMousePressed(const MouseEvent& e) {
339 return true; 339 return true;
340 } 340 }
341 341
342 void TextButton::Paint(gfx::Canvas* canvas) { 342 void TextButton::Paint(gfx::Canvas* canvas) {
343 Paint(canvas, false); 343 Paint(canvas, false);
344 } 344 }
345 345
346 } // namespace views 346 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | views/controls/menu/menu_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698