OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 private: | 76 private: |
77 friend class FastTextAutosizer; | 77 friend class FastTextAutosizer; |
78 | 78 |
79 enum TraversalDirection { | 79 enum TraversalDirection { |
80 FirstToLast, | 80 FirstToLast, |
81 LastToFirst | 81 LastToFirst |
82 }; | 82 }; |
83 | 83 |
84 explicit TextAutosizer(Document*); | 84 explicit TextAutosizer(Document*); |
85 | 85 |
| 86 bool isApplicable() const; |
86 float clusterMultiplier(WritingMode, const TextAutosizingWindowInfo&, float
textWidth) const; | 87 float clusterMultiplier(WritingMode, const TextAutosizingWindowInfo&, float
textWidth) const; |
87 | 88 |
88 void processClusterInternal(TextAutosizingClusterInfo&, RenderBlock* contain
er, RenderObject* subtreeRoot, const TextAutosizingWindowInfo&, float multiplier
); | 89 void processClusterInternal(TextAutosizingClusterInfo&, RenderBlock* contain
er, RenderObject* subtreeRoot, const TextAutosizingWindowInfo&, float multiplier
); |
89 void processCluster(TextAutosizingClusterInfo&, RenderBlock* container, Rend
erObject* subtreeRoot, const TextAutosizingWindowInfo&); | 90 void processCluster(TextAutosizingClusterInfo&, RenderBlock* container, Rend
erObject* subtreeRoot, const TextAutosizingWindowInfo&); |
90 void processCompositeCluster(Vector<TextAutosizingClusterInfo>&, const TextA
utosizingWindowInfo&); | 91 void processCompositeCluster(Vector<TextAutosizingClusterInfo>&, const TextA
utosizingWindowInfo&); |
91 void processContainer(float multiplier, RenderBlock* container, TextAutosizi
ngClusterInfo&, RenderObject* subtreeRoot, const TextAutosizingWindowInfo&); | 92 void processContainer(float multiplier, RenderBlock* container, TextAutosizi
ngClusterInfo&, RenderObject* subtreeRoot, const TextAutosizingWindowInfo&); |
92 | 93 |
93 void setMultiplier(RenderObject*, float); | 94 void setMultiplier(RenderObject*, float); |
94 void setMultiplierForList(RenderObject* renderer, float multiplier); | 95 void setMultiplierForList(RenderObject* renderer, float multiplier); |
95 | 96 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 HashMap<unsigned, float> m_hashToMultiplier; | 137 HashMap<unsigned, float> m_hashToMultiplier; |
137 Vector<unsigned> m_hashesToAutosizeSecondPass; | 138 Vector<unsigned> m_hashesToAutosizeSecondPass; |
138 | 139 |
139 // Mapping from a cluster hash to the corresponding cluster infos which have
not been autosized yet. | 140 // Mapping from a cluster hash to the corresponding cluster infos which have
not been autosized yet. |
140 HashMap<unsigned, OwnPtr<Vector<TextAutosizingClusterInfo> > > m_nonAutosize
dClusters; | 141 HashMap<unsigned, OwnPtr<Vector<TextAutosizingClusterInfo> > > m_nonAutosize
dClusters; |
141 }; | 142 }; |
142 | 143 |
143 } // namespace WebCore | 144 } // namespace WebCore |
144 | 145 |
145 #endif // TextAutosizer_h | 146 #endif // TextAutosizer_h |
OLD | NEW |