| OLD | NEW |
| 1 // Copyright (C) 2013 Google Inc. All rights reserved. | 1 // Copyright (C) 2013 Google Inc. All rights reserved. |
| 2 // | 2 // |
| 3 // Redistribution and use in source and binary forms, with or without | 3 // Redistribution and use in source and binary forms, with or without |
| 4 // modification, are permitted provided that the following conditions are | 4 // modification, are permitted provided that the following conditions are |
| 5 // met: | 5 // met: |
| 6 // | 6 // |
| 7 // * Redistributions of source code must retain the above copyright | 7 // * Redistributions of source code must retain the above copyright |
| 8 // notice, this list of conditions and the following disclaimer. | 8 // notice, this list of conditions and the following disclaimer. |
| 9 // * Redistributions in binary form must reproduce the above | 9 // * Redistributions in binary form must reproduce the above |
| 10 // copyright notice, this list of conditions and the following disclaimer | 10 // copyright notice, this list of conditions and the following disclaimer |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 22 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 23 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 23 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 24 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 24 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 25 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 25 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 26 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 26 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 27 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 27 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | 28 |
| 29 #ifndef GraphicsContextState_h | 29 #ifndef GraphicsContextState_h |
| 30 #define GraphicsContextState_h | 30 #define GraphicsContextState_h |
| 31 | 31 |
| 32 #include "core/platform/graphics/ColorSpace.h" | |
| 33 #include "core/platform/graphics/Gradient.h" | 32 #include "core/platform/graphics/Gradient.h" |
| 34 #include "core/platform/graphics/GraphicsTypes.h" | 33 #include "core/platform/graphics/GraphicsTypes.h" |
| 35 #include "core/platform/graphics/Path.h" | 34 #include "core/platform/graphics/Path.h" |
| 36 #include "core/platform/graphics/Pattern.h" | 35 #include "core/platform/graphics/Pattern.h" |
| 37 | 36 |
| 38 #include "third_party/skia/include/core/SkColorPriv.h" | 37 #include "third_party/skia/include/core/SkColorPriv.h" |
| 39 #include "third_party/skia/include/core/SkDrawLooper.h" | 38 #include "third_party/skia/include/core/SkDrawLooper.h" |
| 40 #include "third_party/skia/include/effects/SkDashPathEffect.h" | 39 #include "third_party/skia/include/effects/SkDashPathEffect.h" |
| 41 | 40 |
| 42 #include "wtf/PassOwnPtr.h" | 41 #include "wtf/PassOwnPtr.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 53 SkSafeUnref(m_dash); | 52 SkSafeUnref(m_dash); |
| 54 } | 53 } |
| 55 | 54 |
| 56 private: | 55 private: |
| 57 friend class GraphicsContext; | 56 friend class GraphicsContext; |
| 58 | 57 |
| 59 GraphicsContextState() | 58 GraphicsContextState() |
| 60 : m_strokeStyle(SolidStroke) | 59 : m_strokeStyle(SolidStroke) |
| 61 , m_strokeThickness(0) | 60 , m_strokeThickness(0) |
| 62 , m_strokeColor(Color::black) | 61 , m_strokeColor(Color::black) |
| 63 , m_strokeColorSpace(ColorSpaceDeviceRGB) | |
| 64 , m_miterLimit(4) | 62 , m_miterLimit(4) |
| 65 , m_lineCap(SkPaint::kDefault_Cap) | 63 , m_lineCap(SkPaint::kDefault_Cap) |
| 66 , m_lineJoin(SkPaint::kDefault_Join) | 64 , m_lineJoin(SkPaint::kDefault_Join) |
| 67 , m_dash(0) | 65 , m_dash(0) |
| 68 , m_fillColor(Color::black) | 66 , m_fillColor(Color::black) |
| 69 , m_fillColorSpace(ColorSpaceDeviceRGB) | |
| 70 , m_fillRule(RULE_NONZERO) | 67 , m_fillRule(RULE_NONZERO) |
| 71 , m_looper(0) | 68 , m_looper(0) |
| 72 , m_textDrawingMode(TextModeFill) | 69 , m_textDrawingMode(TextModeFill) |
| 73 , m_alpha(1) | 70 , m_alpha(1) |
| 74 , m_xferMode(SkXfermode::kSrcOver_Mode) | 71 , m_xferMode(SkXfermode::kSrcOver_Mode) |
| 75 , m_compositeOperator(CompositeSourceOver) | 72 , m_compositeOperator(CompositeSourceOver) |
| 76 , m_blendMode(BlendModeNormal) | 73 , m_blendMode(BlendModeNormal) |
| 77 , m_clip(SkRect::MakeEmpty()) | 74 , m_clip(SkRect::MakeEmpty()) |
| 78 #if USE(LOW_QUALITY_IMAGE_INTERPOLATION) | 75 #if USE(LOW_QUALITY_IMAGE_INTERPOLATION) |
| 79 , m_interpolationQuality(InterpolationLow) | 76 , m_interpolationQuality(InterpolationLow) |
| 80 #else | 77 #else |
| 81 , m_interpolationQuality(InterpolationHigh) | 78 , m_interpolationQuality(InterpolationHigh) |
| 82 #endif | 79 #endif |
| 83 , m_shouldAntialias(true) | 80 , m_shouldAntialias(true) |
| 84 , m_shouldSmoothFonts(true) | 81 , m_shouldSmoothFonts(true) |
| 85 , m_shadowsIgnoreTransforms(false) | 82 , m_shadowsIgnoreTransforms(false) |
| 86 { | 83 { |
| 87 } | 84 } |
| 88 | 85 |
| 89 GraphicsContextState(const GraphicsContextState& other) | 86 GraphicsContextState(const GraphicsContextState& other) |
| 90 : m_strokeStyle(other.m_strokeStyle) | 87 : m_strokeStyle(other.m_strokeStyle) |
| 91 , m_strokeThickness(other.m_strokeThickness) | 88 , m_strokeThickness(other.m_strokeThickness) |
| 92 , m_strokeColor(other.m_strokeColor) | 89 , m_strokeColor(other.m_strokeColor) |
| 93 , m_strokeColorSpace(other.m_strokeColorSpace) | |
| 94 , m_strokeGradient(other.m_strokeGradient) | 90 , m_strokeGradient(other.m_strokeGradient) |
| 95 , m_strokePattern(other.m_strokePattern) | 91 , m_strokePattern(other.m_strokePattern) |
| 96 , m_miterLimit(other.m_miterLimit) | 92 , m_miterLimit(other.m_miterLimit) |
| 97 , m_lineCap(other.m_lineCap) | 93 , m_lineCap(other.m_lineCap) |
| 98 , m_lineJoin(other.m_lineJoin) | 94 , m_lineJoin(other.m_lineJoin) |
| 99 , m_dash(other.m_dash) | 95 , m_dash(other.m_dash) |
| 100 , m_fillColor(other.m_fillColor) | 96 , m_fillColor(other.m_fillColor) |
| 101 , m_fillColorSpace(other.m_fillColorSpace) | |
| 102 , m_fillRule(other.m_fillRule) | 97 , m_fillRule(other.m_fillRule) |
| 103 , m_fillGradient(other.m_fillGradient) | 98 , m_fillGradient(other.m_fillGradient) |
| 104 , m_fillPattern(other.m_fillPattern) | 99 , m_fillPattern(other.m_fillPattern) |
| 105 , m_looper(other.m_looper) | 100 , m_looper(other.m_looper) |
| 106 , m_textDrawingMode(other.m_textDrawingMode) | 101 , m_textDrawingMode(other.m_textDrawingMode) |
| 107 , m_alpha(other.m_alpha) | 102 , m_alpha(other.m_alpha) |
| 108 , m_xferMode(other.m_xferMode) | 103 , m_xferMode(other.m_xferMode) |
| 109 , m_compositeOperator(other.m_compositeOperator) | 104 , m_compositeOperator(other.m_compositeOperator) |
| 110 , m_blendMode(other.m_blendMode) | 105 , m_blendMode(other.m_blendMode) |
| 111 , m_imageBufferClip(other.m_imageBufferClip) | 106 , m_imageBufferClip(other.m_imageBufferClip) |
| (...skipping 29 matching lines...) Expand all Loading... |
| 141 // Returns a new State with all of this object's inherited properties copied
. | 136 // Returns a new State with all of this object's inherited properties copied
. |
| 142 PassOwnPtr<GraphicsContextState> clone() { return adoptPtr(new GraphicsConte
xtState(*this)); } | 137 PassOwnPtr<GraphicsContextState> clone() { return adoptPtr(new GraphicsConte
xtState(*this)); } |
| 143 | 138 |
| 144 // Not supported. No implementations. | 139 // Not supported. No implementations. |
| 145 void operator=(const GraphicsContextState&); | 140 void operator=(const GraphicsContextState&); |
| 146 | 141 |
| 147 // Stroke. | 142 // Stroke. |
| 148 StrokeStyle m_strokeStyle; | 143 StrokeStyle m_strokeStyle; |
| 149 float m_strokeThickness; | 144 float m_strokeThickness; |
| 150 Color m_strokeColor; | 145 Color m_strokeColor; |
| 151 ColorSpace m_strokeColorSpace; | |
| 152 RefPtr<Gradient> m_strokeGradient; | 146 RefPtr<Gradient> m_strokeGradient; |
| 153 RefPtr<Pattern> m_strokePattern; | 147 RefPtr<Pattern> m_strokePattern; |
| 154 float m_miterLimit; | 148 float m_miterLimit; |
| 155 SkPaint::Cap m_lineCap; | 149 SkPaint::Cap m_lineCap; |
| 156 SkPaint::Join m_lineJoin; | 150 SkPaint::Join m_lineJoin; |
| 157 SkDashPathEffect* m_dash; | 151 SkDashPathEffect* m_dash; |
| 158 | 152 |
| 159 // Fill. | 153 // Fill. |
| 160 Color m_fillColor; | 154 Color m_fillColor; |
| 161 ColorSpace m_fillColorSpace; | |
| 162 WindRule m_fillRule; | 155 WindRule m_fillRule; |
| 163 RefPtr<Gradient> m_fillGradient; | 156 RefPtr<Gradient> m_fillGradient; |
| 164 RefPtr<Pattern> m_fillPattern; | 157 RefPtr<Pattern> m_fillPattern; |
| 165 | 158 |
| 166 // Shadow. (This will need tweaking if we use draw loopers for other things.
) | 159 // Shadow. (This will need tweaking if we use draw loopers for other things.
) |
| 167 SkDrawLooper* m_looper; | 160 SkDrawLooper* m_looper; |
| 168 | 161 |
| 169 // Text. (See TextModeFill & friends.) | 162 // Text. (See TextModeFill & friends.) |
| 170 TextDrawingModeFlags m_textDrawingMode; | 163 TextDrawingModeFlags m_textDrawingMode; |
| 171 | 164 |
| (...skipping 16 matching lines...) Expand all Loading... |
| 188 | 181 |
| 189 bool m_shouldAntialias : 1; | 182 bool m_shouldAntialias : 1; |
| 190 bool m_shouldSmoothFonts : 1; | 183 bool m_shouldSmoothFonts : 1; |
| 191 bool m_shadowsIgnoreTransforms : 1; | 184 bool m_shadowsIgnoreTransforms : 1; |
| 192 }; | 185 }; |
| 193 | 186 |
| 194 } // namespace WebCore | 187 } // namespace WebCore |
| 195 | 188 |
| 196 #endif // GraphicsContextState_h | 189 #endif // GraphicsContextState_h |
| 197 | 190 |
| OLD | NEW |