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

Unified Diff: ui/gfx/render_text.cc

Issue 522103002: RenderText: Always invalidate layout on style changes and never on color changes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 | « no previous file | 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
diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc
index 19bb69b8bf0681f9b48a3e0792202777363a5aaa..429bc5f83f5aefba4768c5b37e2346baf0d923cc 100644
--- a/ui/gfx/render_text.cc
+++ b/ui/gfx/render_text.cc
@@ -672,52 +672,24 @@ void RenderText::SetCompositionRange(const Range& composition_range) {
void RenderText::SetColor(SkColor value) {
colors_.SetValue(value);
-
-#if defined(OS_WIN)
- // TODO(msw): Windows applies colors and decorations in the layout process.
- cached_bounds_and_offset_valid_ = false;
- ResetLayout();
-#endif
}
void RenderText::ApplyColor(SkColor value, const Range& range) {
colors_.ApplyValue(value, range);
-
-#if defined(OS_WIN)
ckocagil 2014/08/30 01:26:15 This one shouldn't be needed after http://crrev.co
msw 2014/09/02 18:02:21 Acknowledged.
- // TODO(msw): Windows applies colors and decorations in the layout process.
- cached_bounds_and_offset_valid_ = false;
- ResetLayout();
-#endif
}
void RenderText::SetStyle(TextStyle style, bool value) {
styles_[style].SetValue(value);
- // Only invalidate the layout on font changes; not for colors or decorations.
- bool invalidate = (style == BOLD) || (style == ITALIC);
-#if defined(OS_WIN)
- // TODO(msw): Windows applies colors and decorations in the layout process.
- invalidate = true;
-#endif
- if (invalidate) {
- cached_bounds_and_offset_valid_ = false;
- ResetLayout();
- }
+ cached_bounds_and_offset_valid_ = false;
+ ResetLayout();
}
void RenderText::ApplyStyle(TextStyle style, bool value, const Range& range) {
styles_[style].ApplyValue(value, range);
- // Only invalidate the layout on font changes; not for colors or decorations.
- bool invalidate = (style == BOLD) || (style == ITALIC);
-#if defined(OS_WIN)
ckocagil 2014/08/30 01:26:15 HarfBuzz always needs invalidation on style change
msw 2014/09/02 18:02:21 Acknowledged.
- // TODO(msw): Windows applies colors and decorations in the layout process.
- invalidate = true;
-#endif
- if (invalidate) {
- cached_bounds_and_offset_valid_ = false;
- ResetLayout();
- }
+ cached_bounds_and_offset_valid_ = false;
+ ResetLayout();
}
bool RenderText::GetStyle(TextStyle style) const {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698