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

Side by Side Diff: Source/core/platform/graphics/GraphicsContextState.h

Issue 23643003: ImageBuffer-less SVG masking and clipping. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Removed Linux rebaselines. Created 7 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 | Annotate | Revision Log
OLDNEW
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 friend class GraphicsContext; 49 friend class GraphicsContext;
50 50
51 GraphicsContextState() 51 GraphicsContextState()
52 : m_fillColor(Color::black) 52 : m_fillColor(Color::black)
53 , m_fillRule(RULE_NONZERO) 53 , m_fillRule(RULE_NONZERO)
54 , m_textDrawingMode(TextModeFill) 54 , m_textDrawingMode(TextModeFill)
55 , m_alpha(1) 55 , m_alpha(1)
56 , m_xferMode(SkXfermode::kSrcOver_Mode) 56 , m_xferMode(SkXfermode::kSrcOver_Mode)
57 , m_compositeOperator(CompositeSourceOver) 57 , m_compositeOperator(CompositeSourceOver)
58 , m_blendMode(BlendModeNormal) 58 , m_blendMode(BlendModeNormal)
59 , m_clip(SkRect::MakeEmpty())
60 #if USE(LOW_QUALITY_IMAGE_INTERPOLATION) 59 #if USE(LOW_QUALITY_IMAGE_INTERPOLATION)
61 , m_interpolationQuality(InterpolationLow) 60 , m_interpolationQuality(InterpolationLow)
62 #else 61 #else
63 , m_interpolationQuality(InterpolationHigh) 62 , m_interpolationQuality(InterpolationHigh)
64 #endif 63 #endif
65 , m_shouldAntialias(true) 64 , m_shouldAntialias(true)
66 , m_shouldSmoothFonts(true) 65 , m_shouldSmoothFonts(true)
67 { 66 {
68 } 67 }
69 68
70 GraphicsContextState(const GraphicsContextState& other) 69 GraphicsContextState(const GraphicsContextState& other)
71 : m_strokeData(other.m_strokeData) 70 : m_strokeData(other.m_strokeData)
72 , m_fillColor(other.m_fillColor) 71 , m_fillColor(other.m_fillColor)
73 , m_fillRule(other.m_fillRule) 72 , m_fillRule(other.m_fillRule)
74 , m_fillGradient(other.m_fillGradient) 73 , m_fillGradient(other.m_fillGradient)
75 , m_fillPattern(other.m_fillPattern) 74 , m_fillPattern(other.m_fillPattern)
76 , m_looper(other.m_looper) 75 , m_looper(other.m_looper)
77 , m_textDrawingMode(other.m_textDrawingMode) 76 , m_textDrawingMode(other.m_textDrawingMode)
78 , m_alpha(other.m_alpha) 77 , m_alpha(other.m_alpha)
79 , m_xferMode(other.m_xferMode) 78 , m_xferMode(other.m_xferMode)
80 , m_compositeOperator(other.m_compositeOperator) 79 , m_compositeOperator(other.m_compositeOperator)
81 , m_blendMode(other.m_blendMode) 80 , m_blendMode(other.m_blendMode)
82 , m_clip(other.m_clip)
83 , m_interpolationQuality(other.m_interpolationQuality) 81 , m_interpolationQuality(other.m_interpolationQuality)
84 , m_shouldAntialias(other.m_shouldAntialias) 82 , m_shouldAntialias(other.m_shouldAntialias)
85 , m_shouldSmoothFonts(other.m_shouldSmoothFonts) 83 , m_shouldSmoothFonts(other.m_shouldSmoothFonts)
86 { 84 {
87 } 85 }
88 86
89 // Helper function for applying the state's alpha value to the given input 87 // Helper function for applying the state's alpha value to the given input
90 // color to produce a new output color. 88 // color to produce a new output color.
91 SkColor applyAlpha(SkColor c) const 89 SkColor applyAlpha(SkColor c) const
92 { 90 {
(...skipping 29 matching lines...) Expand all
122 TextDrawingModeFlags m_textDrawingMode; 120 TextDrawingModeFlags m_textDrawingMode;
123 121
124 // Common shader state. 122 // Common shader state.
125 float m_alpha; 123 float m_alpha;
126 SkXfermode::Mode m_xferMode; 124 SkXfermode::Mode m_xferMode;
127 125
128 // Compositing control, for the CSS and Canvas compositing spec. 126 // Compositing control, for the CSS and Canvas compositing spec.
129 CompositeOperator m_compositeOperator; 127 CompositeOperator m_compositeOperator;
130 BlendMode m_blendMode; 128 BlendMode m_blendMode;
131 129
132 // If non-empty, the current State is clipped to this image.
133 SkBitmap m_imageBufferClip;
134
135 // If m_imageBufferClip is non-empty, this is the region the image is clippe d to.
136 SkRect m_clip;
137
138 // Image interpolation control. 130 // Image interpolation control.
139 InterpolationQuality m_interpolationQuality; 131 InterpolationQuality m_interpolationQuality;
140 132
141 bool m_shouldAntialias : 1; 133 bool m_shouldAntialias : 1;
142 bool m_shouldSmoothFonts : 1; 134 bool m_shouldSmoothFonts : 1;
143 }; 135 };
144 136
145 } // namespace WebCore 137 } // namespace WebCore
146 138
147 #endif // GraphicsContextState_h 139 #endif // GraphicsContextState_h
148 140
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698