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 3 // found in the LICENSE file. 4 5 #ifndef BorderEdge_h 6 #define BorderEdge_h 7 8 #include "core/rendering/style/RenderStyleConstants.h" 9 #include "platform/graphics/Color.h" 10 11 namespace blink { 12 13 struct BorderEdge { 14 BorderEdge(int edgeWidth, const Color& edgeColor, EBorderStyle edgeStyle, bool edgeIsTransparent, bool edgeIsPresent = true); 15 BorderEdge(); 16 17 bool hasVisibleColorAndStyle() const; 18 bool shouldRender() const; 19 bool presentButInvisible() const; 20 bool obscuresBackgroundEdge(float scale) const; 21 bool obscuresBackground() const; 22 int usedWidth() const; 23 24 void getDoubleBorderStripeWidths(int& outerWidth, int& innerWidth) const; 25 26 bool sharesColorWith(const BorderEdge& other) const; 27 28 EBorderStyle borderStyle() const { return static_cast<EBorderStyle>(style); } 29 30 int width; 31 Color color; 32 bool isTransparent; 33 bool isPresent; 34 35 private: 36 unsigned style: 4; // EBorderStyle 37 }; 38 39 } // namespace blink 40 41 #endif // BorderEdge_h 42