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

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

Issue 122943003: Make calls to AtomicString(const String&) explicit in rendering/ (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Take feedback into consideration 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
« no previous file with comments | « no previous file | Source/core/rendering/HitTestResult.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 if (inlineObj->isRenderBlock() && m_clusterForBlock.contains(toRenderBlo ck(inlineObj))) 169 if (inlineObj->isRenderBlock() && m_clusterForBlock.contains(toRenderBlo ck(inlineObj)))
170 continue; 170 continue;
171 171
172 applyMultiplier(inlineObj, cluster->m_multiplier); 172 applyMultiplier(inlineObj, cluster->m_multiplier);
173 } 173 }
174 } 174 }
175 175
176 AtomicString FastTextAutosizer::fingerprint(const RenderBlock* block) 176 AtomicString FastTextAutosizer::fingerprint(const RenderBlock* block)
177 { 177 {
178 // FIXME(crbug.com/322340): Implement a better fingerprinting algorithm. 178 // FIXME(crbug.com/322340): Implement a better fingerprinting algorithm.
179 return String::number((unsigned long long) block); 179 return AtomicString::number((unsigned long long) block);
180 } 180 }
181 181
182 void FastTextAutosizer::recalcClusterIfNeeded(FastTextAutosizer::Cluster* cluste r) 182 void FastTextAutosizer::recalcClusterIfNeeded(FastTextAutosizer::Cluster* cluste r)
183 { 183 {
184 ASSERT(m_windowWidth > 0); 184 ASSERT(m_windowWidth > 0);
185 if (!cluster->needsClusterRecalc()) 185 if (!cluster->needsClusterRecalc())
186 return; 186 return;
187 187
188 WTF::HashSet<RenderBlock*>& blocks = cluster->m_blocks; 188 WTF::HashSet<RenderBlock*>& blocks = cluster->m_blocks;
189 189
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 222
223 // Cluster root layout width, in CSS pixels. 223 // Cluster root layout width, in CSS pixels.
224 float rootWidth = toRenderBlock(cluster->m_clusterRoot)->contentLogicalWidth (); 224 float rootWidth = toRenderBlock(cluster->m_clusterRoot)->contentLogicalWidth ();
225 225
226 // FIXME: incorporate font scale factor. 226 // FIXME: incorporate font scale factor.
227 float multiplier = min(rootWidth, layoutWidth) / m_windowWidth; 227 float multiplier = min(rootWidth, layoutWidth) / m_windowWidth;
228 cluster->m_multiplier = max(multiplier, 1.0f); 228 cluster->m_multiplier = max(multiplier, 1.0f);
229 } 229 }
230 230
231 } // namespace WebCore 231 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/rendering/HitTestResult.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698