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

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

Issue 2861773004: Move border-*-width out of BorderValue and store on SurroundData in ComputedStyle instead (Closed)
Patch Set: shend@'s suggestions 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 58a261674f0b5133cd2eef50d88548f40e2a7c16..3435a73f90565acae588f13d11a423229a3c5c2e 100644
--- a/third_party/WebKit/Source/core/style/BorderValue.h
+++ b/third_party/WebKit/Source/core/style/BorderValue.h
@@ -26,24 +26,14 @@
#define BorderValue_h
#include "core/css/StyleColor.h"
+#include "core/style/BorderColorAndStyle.h"
#include "core/style/ComputedStyleConstants.h"
#include "platform/graphics/Color.h"
#include "platform/wtf/Allocator.h"
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();
meade_UTC10 2017/05/09 03:25:06 Do you actually need to remove this? I couldn't fi
nainar 2017/05/09 05:48:11 This was an artefact from an old change. Removed t
friend class ComputedStyle;
public:
@@ -55,6 +45,14 @@ class BorderValue {
SetWidth(3);
}
+ BorderValue(const BorderColorAndStyle& data, float width) {
+ SetColor(data.GetColor());
+ SetColorIsCurrentColor(ColorIsCurrentColor());
+ SetStyle(data.Style());
+ SetIsAuto(data.IsAuto());
+ SetWidth(width);
+ }
+
bool NonZero() const { return Width() && (style_ != kBorderStyleNone); }
bool IsTransparent() const {
@@ -102,6 +100,14 @@ class BorderValue {
EBorderStyle Style() const { return static_cast<EBorderStyle>(style_); }
void SetStyle(EBorderStyle style) { style_ = style; }
+ OutlineIsAuto IsAuto() const { return static_cast<OutlineIsAuto>(is_auto_); }
+ void SetIsAuto(OutlineIsAuto is_auto) { is_auto_ = is_auto; }
+
+ bool ColorIsCurrentColor() const { return color_is_current_color_; }
+ void SetColorIsCurrentColor(bool color_is_current_color) {
+ color_is_current_color_ = static_cast<unsigned>(color_is_current_color);
+ }
+
protected:
static unsigned WidthToFixedPoint(float width) {
DCHECK_GE(width, 0);
« no previous file with comments | « third_party/WebKit/Source/core/style/BorderData.h ('k') | third_party/WebKit/Source/core/style/CachedUAStyle.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698