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

Side by Side Diff: Source/core/style/AppliedTextDecoration.h

Issue 1308633005: Make classes and structures in core/style, core/plugins and core/streams fast-allocated. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « Source/core/streams/ReadableStreamImpl.h ('k') | Source/core/style/BasicShapes.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 AppliedTextDecoration_h 5 #ifndef AppliedTextDecoration_h
6 #define AppliedTextDecoration_h 6 #define AppliedTextDecoration_h
7 7
8 #include "core/css/StyleColor.h" 8 #include "core/css/StyleColor.h"
9 #include "core/style/ComputedStyleConstants.h" 9 #include "core/style/ComputedStyleConstants.h"
10 #include "wtf/Allocator.h"
10 11
11 namespace blink { 12 namespace blink {
12 13
13 class AppliedTextDecoration { 14 class AppliedTextDecoration {
15 ALLOW_ONLY_INLINE_ALLOCATION();
14 public: 16 public:
15 AppliedTextDecoration(TextDecoration, TextDecorationStyle, StyleColor); 17 AppliedTextDecoration(TextDecoration, TextDecorationStyle, StyleColor);
16 explicit AppliedTextDecoration(TextDecoration); 18 explicit AppliedTextDecoration(TextDecoration);
17 19
18 TextDecoration line() const { return static_cast<TextDecoration>(m_line); } 20 TextDecoration line() const { return static_cast<TextDecoration>(m_line); }
19 TextDecorationStyle style() const { return static_cast<TextDecorationStyle>( m_style); } 21 TextDecorationStyle style() const { return static_cast<TextDecorationStyle>( m_style); }
20 22
21 bool isSimpleUnderline() const { return m_line == TextDecorationUnderline && m_style == TextDecorationStyleSolid && m_color.isCurrentColor(); } 23 bool isSimpleUnderline() const { return m_line == TextDecorationUnderline && m_style == TextDecorationStyleSolid && m_color.isCurrentColor(); }
22 bool operator==(const AppliedTextDecoration&) const; 24 bool operator==(const AppliedTextDecoration&) const;
23 bool operator!=(const AppliedTextDecoration& o) const { return !(*this == o) ; } 25 bool operator!=(const AppliedTextDecoration& o) const { return !(*this == o) ; }
24 26
25 private: 27 private:
26 unsigned m_line : TextDecorationBits; 28 unsigned m_line : TextDecorationBits;
27 unsigned m_style : 3; // TextDecorationStyle 29 unsigned m_style : 3; // TextDecorationStyle
28 StyleColor m_color; 30 StyleColor m_color;
29 }; 31 };
30 32
31 } // namespace blink 33 } // namespace blink
32 34
33 #endif // AppliedTextDecoration_h 35 #endif // AppliedTextDecoration_h
OLDNEW
« no previous file with comments | « Source/core/streams/ReadableStreamImpl.h ('k') | Source/core/style/BasicShapes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698