Chromium Code Reviews| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 { | 58 { |
| 59 return adoptPtr(new FastTextAutosizer(document)); | 59 return adoptPtr(new FastTextAutosizer(document)); |
| 60 } | 60 } |
| 61 | 61 |
| 62 void record(const RenderBlock*); | 62 void record(const RenderBlock*); |
| 63 void destroy(const RenderBlock*); | 63 void destroy(const RenderBlock*); |
| 64 | 64 |
| 65 void beginLayout(RenderBlock*); | 65 void beginLayout(RenderBlock*); |
| 66 void endLayout(RenderBlock*); | 66 void endLayout(RenderBlock*); |
| 67 | 67 |
| 68 void inflateListItem(RenderBlock*, RenderObject*); | |
|
pdr.
2014/01/25 03:50:23
This should probably be: inflateListItem(RenderLis
skobes
2014/01/28 03:10:30
Even if we don't need anything from those classes,
pdr.
2014/01/28 04:50:46
Yes, type safety > compile time :)
There's no nee
skobes
2014/01/29 00:13:29
Done.
| |
| 69 | |
| 68 private: | 70 private: |
| 69 struct Cluster { | 71 struct Cluster { |
| 70 explicit Cluster(const RenderBlock* root, bool autosize, Cluster* parent ) | 72 explicit Cluster(const RenderBlock* root, bool autosize, Cluster* parent ) |
| 71 : m_root(root) | 73 : m_root(root) |
| 72 , m_parent(parent) | 74 , m_parent(parent) |
| 73 , m_autosize(autosize) | 75 , m_autosize(autosize) |
| 74 , m_multiplier(0) | 76 , m_multiplier(0) |
| 75 , m_textLength(-1) | 77 , m_textLength(-1) |
| 76 { | 78 { |
| 77 } | 79 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 109 private: | 111 private: |
| 110 typedef HashMap<const RenderBlock*, AtomicString> FingerprintMap; | 112 typedef HashMap<const RenderBlock*, AtomicString> FingerprintMap; |
| 111 typedef HashMap<AtomicString, OwnPtr<BlockSet> > ReverseFingerprintMap; | 113 typedef HashMap<AtomicString, OwnPtr<BlockSet> > ReverseFingerprintMap; |
| 112 | 114 |
| 113 FingerprintMap m_fingerprints; | 115 FingerprintMap m_fingerprints; |
| 114 ReverseFingerprintMap m_blocksForFingerprint; | 116 ReverseFingerprintMap m_blocksForFingerprint; |
| 115 }; | 117 }; |
| 116 | 118 |
| 117 explicit FastTextAutosizer(const Document*); | 119 explicit FastTextAutosizer(const Document*); |
| 118 | 120 |
| 121 float activeMultiplier(); | |
| 119 void inflate(RenderBlock*); | 122 void inflate(RenderBlock*); |
| 120 bool enabled(); | 123 bool enabled(); |
| 121 void prepareRenderViewInfo(RenderView*); | 124 void prepareRenderViewInfo(RenderView*); |
| 122 bool isFingerprintingCandidate(const RenderBlock*); | 125 bool isFingerprintingCandidate(const RenderBlock*); |
| 123 bool clusterHasEnoughTextToAutosize(Cluster*); | 126 bool clusterHasEnoughTextToAutosize(Cluster*); |
| 124 float textLength(Cluster*); | 127 float textLength(Cluster*); |
| 125 AtomicString computeFingerprint(const RenderBlock*); | 128 AtomicString computeFingerprint(const RenderBlock*); |
| 126 Cluster* maybeGetOrCreateCluster(const RenderBlock*); | 129 Cluster* maybeGetOrCreateCluster(const RenderBlock*); |
| 127 Cluster* addSupercluster(AtomicString, const RenderBlock*); | 130 Cluster* addSupercluster(AtomicString, const RenderBlock*); |
| 128 const RenderBlock* deepestCommonAncestor(BlockSet&); | 131 const RenderBlock* deepestCommonAncestor(BlockSet&); |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 150 // cluster root. Clusters whose roots share the same fingerprint use the | 153 // cluster root. Clusters whose roots share the same fingerprint use the |
| 151 // same multiplier. | 154 // same multiplier. |
| 152 ClusterMap m_clusters; | 155 ClusterMap m_clusters; |
| 153 ClusterStack m_clusterStack; | 156 ClusterStack m_clusterStack; |
| 154 FingerprintMapper m_fingerprintMapper; | 157 FingerprintMapper m_fingerprintMapper; |
| 155 }; | 158 }; |
| 156 | 159 |
| 157 } // namespace WebCore | 160 } // namespace WebCore |
| 158 | 161 |
| 159 #endif // FastTextAutosizer_h | 162 #endif // FastTextAutosizer_h |
| OLD | NEW |