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

Unified Diff: ui/gfx/canvas.h

Issue 312233003: Add fade eliding for Views Labels; related cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refine alignment check; minor additional cleanup. 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/base/cocoa/menu_controller.mm ('k') | ui/gfx/canvas_skia.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/canvas.h
diff --git a/ui/gfx/canvas.h b/ui/gfx/canvas.h
index 05c84236ece424545ecc564b2281b16fbbdda968..f3d9486f9a6224cbb804aa2288ef56cecdbd5f46 100644
--- a/ui/gfx/canvas.h
+++ b/ui/gfx/canvas.h
@@ -15,6 +15,7 @@
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/shadow_value.h"
+#include "ui/gfx/text_constants.h"
namespace gfx {
@@ -39,11 +40,6 @@ class Transform;
// of kSrcOver_Mode.
class GFX_EXPORT Canvas {
public:
- enum TruncateFadeMode {
- TruncateFadeTail,
- TruncateFadeHead,
- };
-
// Specifies the alignment for text rendered with the DrawStringRect method.
enum {
TEXT_ALIGN_LEFT = 1 << 0,
@@ -418,20 +414,12 @@ class GFX_EXPORT Canvas {
// Apply transformation on the canvas.
void Transform(const Transform& transform);
- // Draws the given string with the beginning or the end using a fade gradient.
- void DrawFadeTruncatingStringRect(
- const base::string16& text,
- TruncateFadeMode truncate_mode,
- const FontList& font_list,
- SkColor color,
- const Rect& display_rect);
- void DrawFadeTruncatingStringRectWithFlags(
- const base::string16& text,
- TruncateFadeMode truncate_mode,
- const FontList& font_list,
- SkColor color,
- const Rect& display_rect,
- int flags);
+ // Draws the given string with a fade gradient at the end.
+ void DrawFadedString(const base::string16& text,
+ const FontList& font_list,
+ SkColor color,
+ const Rect& display_rect,
+ int flags);
skia::PlatformCanvas* platform_canvas() const { return owned_canvas_.get(); }
SkCanvas* sk_canvas() const { return canvas_; }
« no previous file with comments | « ui/base/cocoa/menu_controller.mm ('k') | ui/gfx/canvas_skia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698