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

Unified Diff: third_party/WebKit/Source/core/style/BorderValue.h

Issue 2913233003: Move fixed point constants from ComputedStyleConstants to BorderValue. (Closed)
Patch Set: Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/style/BorderValue.h
diff --git a/third_party/WebKit/Source/core/style/BorderValue.h b/third_party/WebKit/Source/core/style/BorderValue.h
index 22e756406db1e970f874c42f19c4c6656ea51ee3..cf7c1d2f5a0618fa00b9f3124b2aadb16a7cd0dd 100644
--- a/third_party/WebKit/Source/core/style/BorderValue.h
+++ b/third_party/WebKit/Source/core/style/BorderValue.h
@@ -32,6 +32,16 @@
namespace blink {
+// In order to conserve memory, the border width uses fixed point,
+// which can be bitpacked. This fixed point implementation is
+// essentially the same as in LayoutUnit. Six bits are used for the
+// fraction, which leaves 20 bits for the integer part, making 1048575
+// the largest number.
+
+static const int kBorderWidthFractionalBits = 6;
+static const int kBorderWidthDenominator = 1 << kBorderWidthFractionalBits;
+static const int kMaxForBorderWidth = ((1 << 26) - 1) / kBorderWidthDenominator;
+
class BorderValue {
DISALLOW_NEW();
friend class ComputedStyle;

Powered by Google App Engine
This is Rietveld 408576698