Index: ui/views/controls/label.h |
diff --git a/ui/views/controls/label.h b/ui/views/controls/label.h |
index f3b6b634d29cf9d8e567e3271dfd9e0aa89da1ce..b707f436fdcb34ac9a7e54857c95354516c0b4a6 100644 |
--- a/ui/views/controls/label.h |
+++ b/ui/views/controls/label.h |
@@ -149,6 +149,14 @@ class VIEWS_EXPORT Label : public View { |
void OnNativeThemeChanged(const ui::NativeTheme* theme) override; |
private: |
+ struct DrawStringParams { |
+ base::string16 text; |
+ gfx::Rect bounds; |
+ int flags; |
+ |
+ DrawStringParams() : flags(0) {} |
+ }; |
+ |
// These tests call CalculateDrawStringParams in order to verify the |
// calculations done for drawing text. |
FRIEND_TEST_ALL_PREFIXES(LabelTest, DrawSingleLineString); |
@@ -174,16 +182,14 @@ class VIEWS_EXPORT Label : public View { |
gfx::Rect GetAvailableRect() const; |
// Returns parameters to be used for the DrawString call. |
- void CalculateDrawStringParams(base::string16* paint_text, |
- gfx::Rect* text_bounds, |
- int* flags) const; |
+ const DrawStringParams* CalculateDrawStringParams() const; |
// Updates any colors that have not been explicitly set from the theme. |
void UpdateColorsFromTheme(const ui::NativeTheme* theme); |
- // Resets |cached_heights_| and |cached_heights_cursor_| and mark |
- // |text_size_valid_| as false. |
- void ResetCachedSize(); |
+ // Resets |cached_heights_|, |cached_heights_cursor_|, |cached_paint_params_| |
msw
2015/01/07 20:35:56
Do you mean |cached_draw_params_|?
ckocagil
2015/01/07 22:55:08
Yes, done. (leftovers from a rename...)
|
+ // and mark |text_size_valid_| as false. |
+ void ResetLayoutCache(); |
bool ShouldShowDefaultTooltip() const; |
@@ -221,6 +227,9 @@ class VIEWS_EXPORT Label : public View { |
mutable std::vector<gfx::Size> cached_heights_; |
mutable int cached_heights_cursor_; |
+ // The cached results of CalculateDrawStringParams(). |
+ mutable scoped_ptr<const DrawStringParams> cached_draw_params_; |
+ |
// TODO(vadimt): Remove is_first_paint_text_ before crbug.com/431326 is |
// closed. |
bool is_first_paint_text_; |