OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 explicit LayoutScope(Document& document, RenderBlock* block) | 70 explicit LayoutScope(Document& document, RenderBlock* block) |
71 { | 71 { |
72 m_textAutosizer = document.fastTextAutosizer(); | 72 m_textAutosizer = document.fastTextAutosizer(); |
73 if (m_textAutosizer) { | 73 if (m_textAutosizer) { |
74 if (!m_textAutosizer->enabled()) { | 74 if (!m_textAutosizer->enabled()) { |
75 m_textAutosizer = 0; | 75 m_textAutosizer = 0; |
76 return; | 76 return; |
77 } | 77 } |
78 m_block = block; | 78 m_block = block; |
79 m_textAutosizer->beginLayout(m_block); | 79 m_textAutosizer->beginLayout(m_block); |
| 80 } else { |
| 81 m_block = 0; |
80 } | 82 } |
81 } | 83 } |
82 | 84 |
83 ~LayoutScope() | 85 ~LayoutScope() |
84 { | 86 { |
85 if (m_textAutosizer) | 87 if (m_textAutosizer) |
86 m_textAutosizer->endLayout(m_block); | 88 m_textAutosizer->endLayout(m_block); |
87 } | 89 } |
88 private: | 90 private: |
89 FastTextAutosizer* m_textAutosizer; | 91 FastTextAutosizer* m_textAutosizer; |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 // cluster root. Clusters whose roots share the same fingerprint use the | 214 // cluster root. Clusters whose roots share the same fingerprint use the |
213 // same multiplier. | 215 // same multiplier. |
214 SuperclusterMap m_superclusters; | 216 SuperclusterMap m_superclusters; |
215 ClusterStack m_clusterStack; | 217 ClusterStack m_clusterStack; |
216 FingerprintMapper m_fingerprintMapper; | 218 FingerprintMapper m_fingerprintMapper; |
217 }; | 219 }; |
218 | 220 |
219 } // namespace WebCore | 221 } // namespace WebCore |
220 | 222 |
221 #endif // FastTextAutosizer_h | 223 #endif // FastTextAutosizer_h |
OLD | NEW |