2 * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 #ifndef GraphicsContextPrivate_h
27 #define GraphicsContextPrivate_h
29 #include "TransformationMatrix.h"
31 #include "GraphicsContext.h"
36 // FIXME: This is a place-holder until we decide to add
37 // real color space support to WebCore. At that time, ColorSpace will be a
38 // class and instances will be held off of Colors. There will be
39 // special singleton Gradient and Pattern color spaces to mark when
40 // a fill or stroke is using a gradient or pattern instead of a solid color.
41 // https://bugs.webkit.org/show_bug.cgi?id=20558
48 struct GraphicsContextState
{
49 GraphicsContextState()
50 : textDrawingMode(cTextFill
)
51 , strokeStyle(SolidStroke
)
56 , strokeColorSpace(SolidColorSpace
)
57 , strokeColor(Color::black
)
58 , fillRule(RULE_NONZERO
)
59 , fillColorSpace(SolidColorSpace
)
60 , fillColor(Color::black
)
61 , shouldAntialias(true)
62 , paintingDisabled(false)
64 , shadowsIgnoreTransforms(false)
65 , emojiDrawingEnabled(true)
71 StrokeStyle strokeStyle
;
72 float strokeThickness
;
76 TransformationMatrix pathTransform
;
78 ColorSpace strokeColorSpace
;
80 RefPtr
<Gradient
> strokeGradient
;
81 RefPtr
<Pattern
> strokePattern
;
84 GradientSpreadMethod spreadMethod
;
85 ColorSpace fillColorSpace
;
87 RefPtr
<Gradient
> fillGradient
;
88 RefPtr
<Pattern
> fillPattern
;
92 bool paintingDisabled
;
98 bool shadowsIgnoreTransforms
;
100 bool emojiDrawingEnabled
;
103 class GraphicsContextPrivate
{
105 GraphicsContextPrivate()
106 : m_focusRingWidth(0)
107 , m_focusRingOffset(0)
108 , m_updatingControlTints(false)
112 GraphicsContextState state
;
113 Vector
<GraphicsContextState
> stack
;
114 Vector
<IntRect
> m_focusRingRects
;
115 int m_focusRingWidth
;
116 int m_focusRingOffset
;
117 bool m_updatingControlTints
;
120 } // namespace WebCore
122 #endif // GraphicsContextPrivate_h