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

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

Issue 200023002: Making LayoutUnit conversions to Float type explicit (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase to trunk Created 6 years, 9 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 | « Source/core/rendering/RenderLayer.cpp ('k') | Source/core/rendering/RenderMultiColumnSet.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) 2012 Apple Inc. All rights reserved. 2 * Copyright (C) 2012 Apple 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 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 ContentRun(LayoutUnit breakOffset) 154 ContentRun(LayoutUnit breakOffset)
155 : m_breakOffset(breakOffset) 155 : m_breakOffset(breakOffset)
156 , m_assumedImplicitBreaks(0) { } 156 , m_assumedImplicitBreaks(0) { }
157 157
158 unsigned assumedImplicitBreaks() const { return m_assumedImplicitBreaks; } 158 unsigned assumedImplicitBreaks() const { return m_assumedImplicitBreaks; }
159 void assumeAnotherImplicitBreak() { m_assumedImplicitBreaks++; } 159 void assumeAnotherImplicitBreak() { m_assumedImplicitBreaks++; }
160 LayoutUnit breakOffset() const { return m_breakOffset; } 160 LayoutUnit breakOffset() const { return m_breakOffset; }
161 161
162 // Return the column height that this content run would require, conside ring the implicit 162 // Return the column height that this content run would require, conside ring the implicit
163 // breaks assumed so far. 163 // breaks assumed so far.
164 LayoutUnit columnLogicalHeight(LayoutUnit startOffset) const { return ce ilf(float(m_breakOffset - startOffset) / float(m_assumedImplicitBreaks + 1)); } 164 LayoutUnit columnLogicalHeight(LayoutUnit startOffset) const { return ce ilf((m_breakOffset - startOffset).toFloat() / float(m_assumedImplicitBreaks + 1) ); }
165 165
166 private: 166 private:
167 LayoutUnit m_breakOffset; // Flow thread offset where this run ends. 167 LayoutUnit m_breakOffset; // Flow thread offset where this run ends.
168 unsigned m_assumedImplicitBreaks; // Number of implicit breaks in this r un assumed so far. 168 unsigned m_assumedImplicitBreaks; // Number of implicit breaks in this r un assumed so far.
169 }; 169 };
170 Vector<ContentRun, 1> m_contentRuns; 170 Vector<ContentRun, 1> m_contentRuns;
171 }; 171 };
172 172
173 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderMultiColumnSet, isRenderMultiColumnSet()); 173 DEFINE_RENDER_OBJECT_TYPE_CASTS(RenderMultiColumnSet, isRenderMultiColumnSet());
174 174
175 } // namespace WebCore 175 } // namespace WebCore
176 176
177 #endif // RenderMultiColumnSet_h 177 #endif // RenderMultiColumnSet_h
178 178
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayer.cpp ('k') | Source/core/rendering/RenderMultiColumnSet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698