| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |