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

Side by Side Diff: Source/core/rendering/style/CollapsedBorderValue.h

Issue 20061003: Move isValid/isCurrentColor from Color to StyleColor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 16 matching lines...) Expand all
27 27
28 #include "core/rendering/style/BorderValue.h" 28 #include "core/rendering/style/BorderValue.h"
29 29
30 namespace WebCore { 30 namespace WebCore {
31 31
32 class CollapsedBorderValue { 32 class CollapsedBorderValue {
33 public: 33 public:
34 CollapsedBorderValue() 34 CollapsedBorderValue()
35 : m_color(0) 35 : m_color(0)
36 , m_colorIsValid(false) 36 , m_colorIsValid(false)
37 , m_currentColor(false)
37 , m_width(0) 38 , m_width(0)
38 , m_style(BNONE) 39 , m_style(BNONE)
39 , m_precedence(BOFF) 40 , m_precedence(BOFF)
40 , m_transparent(false) 41 , m_transparent(false)
41 { 42 {
42 } 43 }
43 44
44 CollapsedBorderValue(const BorderValue& border, const Color& color, EBorderP recedence precedence) 45 CollapsedBorderValue(const BorderValue& border, const StyleColor& color, EBo rderPrecedence precedence)
45 : m_color(color.rgb()) 46 : m_color(color.color())
46 , m_colorIsValid(color.isValid()) 47 , m_colorIsValid(color.isValid())
48 , m_currentColor(color.isCurrentColor())
47 , m_width(border.nonZero() ? border.width() : 0) 49 , m_width(border.nonZero() ? border.width() : 0)
48 , m_style(border.style()) 50 , m_style(border.style())
49 , m_precedence(precedence) 51 , m_precedence(precedence)
50 , m_transparent(border.isTransparent()) 52 , m_transparent(border.isTransparent())
51 { 53 {
52 } 54 }
53 55
54 unsigned width() const { return m_style > BHIDDEN ? m_width : 0; } 56 unsigned width() const { return m_style > BHIDDEN ? m_width : 0; }
55 EBorderStyle style() const { return static_cast<EBorderStyle>(m_style); } 57 EBorderStyle style() const { return static_cast<EBorderStyle>(m_style); }
56 bool exists() const { return m_precedence != BOFF; } 58 bool exists() const { return m_precedence != BOFF; }
57 Color color() const { return Color(m_color, m_colorIsValid); } 59 StyleColor color() const { return StyleColor(m_color, m_colorIsValid, m_curr entColor); }
58 bool isTransparent() const { return m_transparent; } 60 bool isTransparent() const { return m_transparent; }
59 EBorderPrecedence precedence() const { return static_cast<EBorderPrecedence> (m_precedence); } 61 EBorderPrecedence precedence() const { return static_cast<EBorderPrecedence> (m_precedence); }
60 62
61 bool isSameIgnoringColor(const CollapsedBorderValue& o) const 63 bool isSameIgnoringColor(const CollapsedBorderValue& o) const
62 { 64 {
63 return width() == o.width() && style() == o.style() && precedence() == o .precedence(); 65 return width() == o.width() && style() == o.style() && precedence() == o .precedence();
64 } 66 }
65 67
66 private: 68 private:
67 RGBA32 m_color; 69 Color m_color;
68 unsigned m_colorIsValid : 1; 70 unsigned m_colorIsValid : 1;
69 unsigned m_width : 23; 71 unsigned m_currentColor : 1;
72 unsigned m_width : 22;
70 unsigned m_style : 4; // EBorderStyle 73 unsigned m_style : 4; // EBorderStyle
71 unsigned m_precedence : 3; // EBorderPrecedence 74 unsigned m_precedence : 3; // EBorderPrecedence
72 unsigned m_transparent : 1; 75 unsigned m_transparent : 1;
73 }; 76 };
74 77
75 } // namespace WebCore 78 } // namespace WebCore
76 79
77 #endif // CollapsedBorderValue_h 80 #endif // CollapsedBorderValue_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698