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

Unified Diff: ui/views/controls/label.cc

Issue 343513002: Refactor views::Label and gfx::RenderText shadow functions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove forbidden static FontList. Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/controls/label.h ('k') | ui/views/examples/label_example.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/label.cc
diff --git a/ui/views/controls/label.cc b/ui/views/controls/label.cc
index e1e1bcfe1c2d2b5309c2e7daafe9dd9865b965b1..6aed59f34610b11f2f6c218dc5f6ff0bc5e4352a 100644
--- a/ui/views/controls/label.cc
+++ b/ui/views/controls/label.cc
@@ -19,7 +19,6 @@
#include "ui/gfx/canvas.h"
#include "ui/gfx/color_utils.h"
#include "ui/gfx/insets.h"
-#include "ui/gfx/shadow_value.h"
#include "ui/gfx/text_elider.h"
#include "ui/gfx/text_utils.h"
#include "ui/gfx/utf16_indexing.h"
@@ -105,20 +104,6 @@ void Label::SetBackgroundColor(SkColor color) {
RecalculateColors();
}
-void Label::SetShadowColors(SkColor enabled_color, SkColor disabled_color) {
- enabled_shadow_color_ = enabled_color;
- disabled_shadow_color_ = disabled_color;
- has_shadow_ = true;
-}
-
-void Label::SetShadowOffset(int x, int y) {
- shadow_offset_.SetPoint(x, y);
-}
-
-void Label::ClearEmbellishing() {
- has_shadow_ = false;
-}
-
void Label::SetHorizontalAlignment(gfx::HorizontalAlignment alignment) {
// If the UI layout is right-to-left, flip the alignment direction.
if (base::i18n::IsRTL() &&
@@ -334,13 +319,8 @@ void Label::PaintText(gfx::Canvas* canvas,
if (elide_behavior_ == gfx::FADE_TAIL) {
canvas->DrawFadedString(text, font_list_, color, text_bounds, flags);
} else {
- gfx::ShadowValues shadows;
- if (has_shadow_) {
- shadows.push_back(gfx::ShadowValue(shadow_offset_, shadow_blur_,
- enabled() ? enabled_shadow_color_ : disabled_shadow_color_));
- }
canvas->DrawStringRectWithShadows(text, font_list_, color, text_bounds,
- line_height_, flags, shadows);
+ line_height_, flags, shadows_);
if (SkColorGetA(halo_color_) != SK_AlphaTRANSPARENT) {
canvas->DrawStringRectWithHalo(text, font_list_, color, halo_color_,
@@ -413,11 +393,6 @@ void Label::Init(const base::string16& text, const gfx::FontList& font_list) {
elide_behavior_ = gfx::ELIDE_TAIL;
collapse_when_hidden_ = false;
directionality_mode_ = gfx::DIRECTIONALITY_FROM_UI;
- enabled_shadow_color_ = 0;
- disabled_shadow_color_ = 0;
- shadow_offset_.SetPoint(1, 1);
- has_shadow_ = false;
- shadow_blur_ = 0;
halo_color_ = SK_ColorTRANSPARENT;
cached_heights_.resize(kCachedSizeLimit);
ResetCachedSize();
« no previous file with comments | « ui/views/controls/label.h ('k') | ui/views/examples/label_example.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698