OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_GFX_RENDER_TEXT_H_ | 5 #ifndef UI_GFX_RENDER_TEXT_H_ |
6 #define UI_GFX_RENDER_TEXT_H_ | 6 #define UI_GFX_RENDER_TEXT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <cstring> | 10 #include <cstring> |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 SkColor selection_background_unfocused_color() const { | 161 SkColor selection_background_unfocused_color() const { |
162 return selection_background_unfocused_color_; | 162 return selection_background_unfocused_color_; |
163 } | 163 } |
164 void set_selection_background_unfocused_color(SkColor color) { | 164 void set_selection_background_unfocused_color(SkColor color) { |
165 selection_background_unfocused_color_ = color; | 165 selection_background_unfocused_color_ = color; |
166 } | 166 } |
167 | 167 |
168 bool focused() const { return focused_; } | 168 bool focused() const { return focused_; } |
169 void set_focused(bool focused) { focused_ = focused; } | 169 void set_focused(bool focused) { focused_ = focused; } |
170 | 170 |
| 171 bool clip_to_display_rect() const { return clip_to_display_rect_; } |
| 172 void set_clip_to_display_rect(bool clip) { clip_to_display_rect_ = clip; } |
| 173 |
171 const StyleRange& default_style() const { return default_style_; } | 174 const StyleRange& default_style() const { return default_style_; } |
172 void set_default_style(const StyleRange& style) { default_style_ = style; } | 175 void set_default_style(const StyleRange& style) { default_style_ = style; } |
173 | 176 |
174 // In an obscured (password) field, all text is drawn as asterisks or bullets. | 177 // In an obscured (password) field, all text is drawn as asterisks or bullets. |
175 bool is_obscured() const { return obscured_; } | 178 bool is_obscured() const { return obscured_; } |
176 void SetObscured(bool obscured); | 179 void SetObscured(bool obscured); |
177 | 180 |
178 const Rect& display_rect() const { return display_rect_; } | 181 const Rect& display_rect() const { return display_rect_; } |
179 void SetDisplayRect(const Rect& r); | 182 void SetDisplayRect(const Rect& r); |
180 | 183 |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
473 // Fade text head and/or tail, if text doesn't fit into |display_rect_|. | 476 // Fade text head and/or tail, if text doesn't fit into |display_rect_|. |
474 bool fade_head_; | 477 bool fade_head_; |
475 bool fade_tail_; | 478 bool fade_tail_; |
476 | 479 |
477 // Is the background transparent (either partially or fully)? | 480 // Is the background transparent (either partially or fully)? |
478 bool background_is_transparent_; | 481 bool background_is_transparent_; |
479 | 482 |
480 // The local display area for rendering the text. | 483 // The local display area for rendering the text. |
481 Rect display_rect_; | 484 Rect display_rect_; |
482 | 485 |
| 486 // Flag to work around a Skia bug with the PDF path (http://crbug.com/133548) |
| 487 // that results in incorrect clipping when drawing to the document margins. |
| 488 // This field allows disabling clipping to work around the issue. |
| 489 // TODO(asvitkine): Remove this when the underlying Skia bug is fixed. |
| 490 bool clip_to_display_rect_; |
| 491 |
483 // The offset for the text to be drawn, relative to the display area. | 492 // The offset for the text to be drawn, relative to the display area. |
484 // Get this point with GetUpdatedDisplayOffset (or risk using a stale value). | 493 // Get this point with GetUpdatedDisplayOffset (or risk using a stale value). |
485 Point display_offset_; | 494 Point display_offset_; |
486 | 495 |
487 // The cached bounds and offset are invalidated by changes to the cursor, | 496 // The cached bounds and offset are invalidated by changes to the cursor, |
488 // selection, font, and other operations that adjust the visible text bounds. | 497 // selection, font, and other operations that adjust the visible text bounds. |
489 bool cached_bounds_and_offset_valid_; | 498 bool cached_bounds_and_offset_valid_; |
490 | 499 |
491 // Text shadows to be drawn. | 500 // Text shadows to be drawn. |
492 ShadowValues text_shadows_; | 501 ShadowValues text_shadows_; |
493 | 502 |
494 DISALLOW_COPY_AND_ASSIGN(RenderText); | 503 DISALLOW_COPY_AND_ASSIGN(RenderText); |
495 }; | 504 }; |
496 | 505 |
497 } // namespace gfx | 506 } // namespace gfx |
498 | 507 |
499 #endif // UI_GFX_RENDER_TEXT_H_ | 508 #endif // UI_GFX_RENDER_TEXT_H_ |
OLD | NEW |