Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: Source/core/rendering/FastTextAutosizer.h

Issue 138143004: [FastTextAutosizer] Refactor FTA::inflate() to be internal to FTA (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 public: 55 public:
56 static PassOwnPtr<FastTextAutosizer> create(Document* document) 56 static PassOwnPtr<FastTextAutosizer> create(Document* document)
57 { 57 {
58 return adoptPtr(new FastTextAutosizer(document)); 58 return adoptPtr(new FastTextAutosizer(document));
59 } 59 }
60 60
61 void record(RenderBlock*); 61 void record(RenderBlock*);
62 void destroy(RenderBlock*); 62 void destroy(RenderBlock*);
63 63
64 void beginLayout(RenderBlock*); 64 void beginLayout(RenderBlock*);
65 void inflate(RenderBlock*);
66 void endLayout(RenderBlock*); 65 void endLayout(RenderBlock*);
67 66
68 private: 67 private:
69 struct Cluster { 68 struct Cluster {
70 explicit Cluster(RenderBlock* root, float multiplier) 69 explicit Cluster(RenderBlock* root, float multiplier)
71 : m_root(root) 70 : m_root(root)
72 , m_multiplier(multiplier) 71 , m_multiplier(multiplier)
73 { 72 {
74 } 73 }
75 RenderBlock* m_root; 74 RenderBlock* m_root;
(...skipping 15 matching lines...) Expand all
91 private: 90 private:
92 typedef WTF::HashMap<RenderBlock*, AtomicString> FingerprintMap; 91 typedef WTF::HashMap<RenderBlock*, AtomicString> FingerprintMap;
93 typedef WTF::HashMap<AtomicString, OwnPtr<BlockSet> > ReverseFingerprint Map; 92 typedef WTF::HashMap<AtomicString, OwnPtr<BlockSet> > ReverseFingerprint Map;
94 93
95 FingerprintMap m_fingerprints; 94 FingerprintMap m_fingerprints;
96 ReverseFingerprintMap m_blocksForFingerprint; 95 ReverseFingerprintMap m_blocksForFingerprint;
97 }; 96 };
98 97
99 explicit FastTextAutosizer(Document*); 98 explicit FastTextAutosizer(Document*);
100 99
100 void inflate(RenderBlock*);
101 bool enabled(); 101 bool enabled();
102 void prepareRenderViewInfo(RenderView*); 102 void prepareRenderViewInfo(RenderView*);
103 bool shouldBeClusterRoot(RenderBlock*); 103 bool shouldBeClusterRoot(RenderBlock*);
104 bool clusterWantsAutosizing(RenderBlock*); 104 bool clusterWantsAutosizing(RenderBlock*);
105 AtomicString computeFingerprint(RenderBlock*); 105 AtomicString computeFingerprint(RenderBlock*);
106 Cluster* getOrCreateCluster(RenderBlock*); 106 Cluster* getOrCreateCluster(RenderBlock*);
107 Cluster* createCluster(RenderBlock*); 107 Cluster* createCluster(RenderBlock*);
108 Cluster* addSupercluster(AtomicString, RenderBlock*); 108 Cluster* addSupercluster(AtomicString, RenderBlock*);
109 RenderBlock* deepestCommonAncestor(BlockSet&); 109 RenderBlock* deepestCommonAncestor(BlockSet&);
110 float computeMultiplier(RenderBlock*); 110 float computeMultiplier(RenderBlock*);
(...skipping 11 matching lines...) Expand all
122 // cluster root. Clusters whose roots share the same fingerprint use the 122 // cluster root. Clusters whose roots share the same fingerprint use the
123 // same multiplier. 123 // same multiplier.
124 ClusterMap m_clusters; 124 ClusterMap m_clusters;
125 ClusterStack m_clusterStack; 125 ClusterStack m_clusterStack;
126 FingerprintMapper m_fingerprintMapper; 126 FingerprintMapper m_fingerprintMapper;
127 }; 127 };
128 128
129 } // namespace WebCore 129 } // namespace WebCore
130 130
131 #endif // FastTextAutosizer_h 131 #endif // FastTextAutosizer_h
OLDNEW
« no previous file with comments | « no previous file | Source/core/rendering/FastTextAutosizer.cpp » ('j') | Source/core/rendering/FastTextAutosizer.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698