diff options
author | asvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-02 15:33:36 +0000 |
---|---|---|
committer | asvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-02 15:33:36 +0000 |
commit | 3bf21e1dcd73903dfae5c4d9a7c8f2e55ed238d5 (patch) | |
tree | a94a8f6dd838343f95fe828d1e212ba14b594a42 /ui/gfx/render_text.h | |
parent | 50b1e9993b22101eef851fc4dfc84574a92079a2 (diff) | |
download | chromium_src-3bf21e1dcd73903dfae5c4d9a7c8f2e55ed238d5.zip chromium_src-3bf21e1dcd73903dfae5c4d9a7c8f2e55ed238d5.tar.gz chromium_src-3bf21e1dcd73903dfae5c4d9a7c8f2e55ed238d5.tar.bz2 |
Fix ugly non-ClearType text rendering in tab strip.
Draw the text to a layer and restore it faded by drawing a rect in
kDstIn_Mode mode.
Workaround for:
http://code.google.com/p/skia/issues/detail?id=590
BUG=122743, 105550
TEST=Turn off ClearType in Windows setting. Open Chrome
to a tab where its title doesn't fit in the tab and must
get faded. Observe that the title text looks okay.
Review URL: http://codereview.chromium.org/10266017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134922 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/render_text.h')
-rw-r--r-- | ui/gfx/render_text.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ui/gfx/render_text.h b/ui/gfx/render_text.h index 8077828..79758cc 100644 --- a/ui/gfx/render_text.h +++ b/ui/gfx/render_text.h @@ -45,7 +45,7 @@ class SkiaTextRenderer { void SetTextSize(int size); void SetFontFamilyWithStyle(const std::string& family, int font_style); void SetForegroundColor(SkColor foreground); - void SetShader(SkShader* shader); + void SetShader(SkShader* shader, const Rect& bounds); void DrawSelection(const std::vector<Rect>& selection, SkColor color); void DrawPosText(const SkPoint* pos, const uint16* glyphs, @@ -54,7 +54,10 @@ class SkiaTextRenderer { private: SkCanvas* canvas_skia_; + bool started_drawing_; SkPaint paint_; + SkRect bounds_; + SkRefPtr<SkShader> deferred_fade_shader_; DISALLOW_COPY_AND_ASSIGN(SkiaTextRenderer); }; |