OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) | 6 * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com) |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 30 matching lines...) Expand all Loading... |
41 }; | 41 }; |
42 | 42 |
43 class CollapsedBorderValue { | 43 class CollapsedBorderValue { |
44 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 44 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
45 | 45 |
46 public: | 46 public: |
47 // Constructs a CollapsedBorderValue for non-existence border. | 47 // Constructs a CollapsedBorderValue for non-existence border. |
48 CollapsedBorderValue() | 48 CollapsedBorderValue() |
49 : color_(0), | 49 : color_(0), |
50 width_(0), | 50 width_(0), |
51 style_(kBorderStyleNone), | 51 style_(static_cast<unsigned>(EBorderStyle::kNone)), |
52 precedence_(kBorderPrecedenceOff) {} | 52 precedence_(kBorderPrecedenceOff) {} |
53 | 53 |
54 CollapsedBorderValue(const BorderValue& border, | 54 CollapsedBorderValue(const BorderValue& border, |
55 const Color& color, | 55 const Color& color, |
56 EBorderPrecedence precedence) | 56 EBorderPrecedence precedence) |
57 : color_(color), | 57 : color_(color), |
58 width_(border.Style() > kBorderStyleHidden ? border.Width() : 0), | 58 width_(border.Style() > EBorderStyle::kNone ? border.Width() : 0), |
59 style_(border.Style()), | 59 style_(static_cast<unsigned>(border.Style())), |
60 precedence_(precedence) { | 60 precedence_(precedence) { |
61 DCHECK(precedence != kBorderPrecedenceOff); | 61 DCHECK(precedence != kBorderPrecedenceOff); |
62 } | 62 } |
63 | 63 |
64 unsigned Width() const { return width_; } | 64 unsigned Width() const { return width_; } |
65 EBorderStyle Style() const { return static_cast<EBorderStyle>(style_); } | 65 EBorderStyle Style() const { return static_cast<EBorderStyle>(style_); } |
66 bool Exists() const { return precedence_ != kBorderPrecedenceOff; } | 66 bool Exists() const { return precedence_ != kBorderPrecedenceOff; } |
67 Color GetColor() const { return color_; } | 67 Color GetColor() const { return color_; } |
68 bool IsTransparent() const { return !color_.Alpha(); } | 68 bool IsTransparent() const { return !color_.Alpha(); } |
69 EBorderPrecedence Precedence() const { | 69 EBorderPrecedence Precedence() const { |
(...skipping 22 matching lines...) Expand all Loading... |
92 private: | 92 private: |
93 Color color_; | 93 Color color_; |
94 unsigned width_ : 25; | 94 unsigned width_ : 25; |
95 unsigned style_ : 4; // EBorderStyle | 95 unsigned style_ : 4; // EBorderStyle |
96 unsigned precedence_ : 3; // EBorderPrecedence | 96 unsigned precedence_ : 3; // EBorderPrecedence |
97 }; | 97 }; |
98 | 98 |
99 } // namespace blink | 99 } // namespace blink |
100 | 100 |
101 #endif // CollapsedBorderValue_h | 101 #endif // CollapsedBorderValue_h |
OLD | NEW |