OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BorderEdge_h | 5 #ifndef BorderEdge_h |
6 #define BorderEdge_h | 6 #define BorderEdge_h |
7 | 7 |
8 #include "core/style/ComputedStyleConstants.h" | 8 #include "core/style/ComputedStyleConstants.h" |
9 #include "platform/graphics/Color.h" | 9 #include "platform/graphics/Color.h" |
10 #include "wtf/Allocator.h" | 10 #include "wtf/Allocator.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 struct BorderEdge { | 14 struct BorderEdge { |
15 STACK_ALLOCATED(); | 15 STACK_ALLOCATED(); |
16 | 16 |
17 public: | 17 public: |
18 BorderEdge(int edgeWidth, | 18 BorderEdge(float edgeWidth, |
19 const Color& edgeColor, | 19 const Color& edgeColor, |
20 EBorderStyle edgeStyle, | 20 EBorderStyle edgeStyle, |
21 bool edgeIsPresent = true); | 21 bool edgeIsPresent = true); |
22 BorderEdge(); | 22 BorderEdge(); |
23 | 23 |
24 bool hasVisibleColorAndStyle() const; | 24 bool hasVisibleColorAndStyle() const; |
25 bool shouldRender() const; | 25 bool shouldRender() const; |
26 bool presentButInvisible() const; | 26 bool presentButInvisible() const; |
27 bool obscuresBackgroundEdge() const; | 27 bool obscuresBackgroundEdge() const; |
28 bool obscuresBackground() const; | 28 bool obscuresBackground() const; |
29 int usedWidth() const; | 29 float usedWidth() const; |
30 | 30 |
31 bool sharesColorWith(const BorderEdge& other) const; | 31 bool sharesColorWith(const BorderEdge& other) const; |
32 | 32 |
33 EBorderStyle borderStyle() const { return static_cast<EBorderStyle>(style); } | 33 EBorderStyle borderStyle() const { return static_cast<EBorderStyle>(style); } |
34 | 34 |
35 enum DoubleBorderStripe { DoubleBorderStripeOuter, DoubleBorderStripeInner }; | 35 enum DoubleBorderStripe { DoubleBorderStripeOuter, DoubleBorderStripeInner }; |
36 | 36 |
37 int getDoubleBorderStripeWidth(DoubleBorderStripe) const; | 37 float getDoubleBorderStripeWidth(DoubleBorderStripe) const; |
38 | 38 |
39 int width; | 39 float width() const { return m_width; } |
| 40 |
40 Color color; | 41 Color color; |
41 bool isPresent; | 42 bool isPresent; |
42 | 43 |
43 private: | 44 private: |
44 unsigned style : 4; // EBorderStyle | 45 unsigned style : 4; // EBorderStyle |
| 46 float m_width; |
45 }; | 47 }; |
46 | 48 |
47 } // namespace blink | 49 } // namespace blink |
48 | 50 |
49 #endif // BorderEdge_h | 51 #endif // BorderEdge_h |
OLD | NEW |