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

Unified Diff: ui/gfx/render_text.cc

Issue 10638015: RenderText: Only clip if necessary to workaround a Skia bug in the PDF path. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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/gfx/render_text.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text.cc
===================================================================
--- ui/gfx/render_text.cc (revision 143691)
+++ ui/gfx/render_text.cc (working copy)
@@ -606,11 +606,13 @@
void RenderText::Draw(Canvas* canvas) {
EnsureLayout();
- gfx::Rect clip_rect(display_rect());
- clip_rect.Inset(ShadowValue::GetMargin(text_shadows_));
+ if (clip_to_display_rect()) {
+ gfx::Rect clip_rect(display_rect());
+ clip_rect.Inset(ShadowValue::GetMargin(text_shadows_));
- canvas->Save();
- canvas->ClipRect(clip_rect);
+ canvas->Save();
+ canvas->ClipRect(clip_rect);
+ }
if (!text().empty())
DrawSelection(canvas);
@@ -619,7 +621,9 @@
if (!text().empty())
DrawVisualText(canvas);
- canvas->Restore();
+
+ if (clip_to_display_rect())
+ canvas->Restore();
}
Rect RenderText::GetCursorBounds(const SelectionModel& caret,
@@ -712,6 +716,7 @@
fade_head_(false),
fade_tail_(false),
background_is_transparent_(false),
+ clip_to_display_rect_(true),
cached_bounds_and_offset_valid_(false) {
}
« no previous file with comments | « ui/gfx/render_text.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698