OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "SkWidgetViews.h" | 8 #include "SkWidgetViews.h" |
9 #include "SkTextBox.h" | 9 #include "SkTextBox.h" |
10 | 10 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 } | 118 } |
119 | 119 |
120 void SkStaticTextView::getPaint(SkPaint* paint) const | 120 void SkStaticTextView::getPaint(SkPaint* paint) const |
121 { | 121 { |
122 if (paint) | 122 if (paint) |
123 *paint = fPaint; | 123 *paint = fPaint; |
124 } | 124 } |
125 | 125 |
126 void SkStaticTextView::setPaint(const SkPaint& paint) | 126 void SkStaticTextView::setPaint(const SkPaint& paint) |
127 { | 127 { |
128 if (fPaint != paint) | 128 fPaint = paint; |
129 { | 129 this->computeSize(); |
130 fPaint = paint; | 130 this->inval(NULL); |
131 this->computeSize(); | |
132 this->inval(NULL); | |
133 } | |
134 } | 131 } |
135 | 132 |
136 void SkStaticTextView::onDraw(SkCanvas* canvas) | 133 void SkStaticTextView::onDraw(SkCanvas* canvas) |
137 { | 134 { |
138 this->INHERITED::onDraw(canvas); | 135 this->INHERITED::onDraw(canvas); |
139 | 136 |
140 if (fText.isEmpty()) | 137 if (fText.isEmpty()) |
141 return; | 138 return; |
142 | 139 |
143 SkTextBox box; | 140 SkTextBox box; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 (node = dom.getFirstChild(node, "screenplay")) != NULL) | 179 (node = dom.getFirstChild(node, "screenplay")) != NULL) |
183 { | 180 { |
184 // FIXME: Including inflate_paint causes Windows build to fail -- it complains | 181 // FIXME: Including inflate_paint causes Windows build to fail -- it complains |
185 // that SKListView::SkListView is undefined. | 182 // that SKListView::SkListView is undefined. |
186 #if 0 | 183 #if 0 |
187 inflate_paint(dom, node, &fPaint); | 184 inflate_paint(dom, node, &fPaint); |
188 #endif | 185 #endif |
189 } | 186 } |
190 } | 187 } |
191 } | 188 } |
OLD | NEW |