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

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

Issue 15137009: Refactor shadow rendering logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 7 years, 7 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
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 18 matching lines...) Expand all
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" 32 #include "core/platform/graphics/ColorSpace.h"
33 #include "core/platform/graphics/Gradient.h" 33 #include "core/platform/graphics/Gradient.h"
34 #include "core/platform/graphics/GraphicsTypes.h" 34 #include "core/platform/graphics/GraphicsTypes.h"
35 #include "core/platform/graphics/Path.h" 35 #include "core/platform/graphics/Path.h"
36 #include "core/platform/graphics/Pattern.h" 36 #include "core/platform/graphics/Pattern.h"
37 37
38 #include "third_party/skia/include/core/SkColorPriv.h" 38 #include "third_party/skia/include/core/SkColorPriv.h"
39 #include "third_party/skia/include/core/SkDrawLooper.h"
39 #include "third_party/skia/include/effects/SkDashPathEffect.h" 40 #include "third_party/skia/include/effects/SkDashPathEffect.h"
40 41
41 #include "wtf/PassOwnPtr.h" 42 #include "wtf/PassOwnPtr.h"
42 43
43 namespace WebCore { 44 namespace WebCore {
44 45
45 // Encapsulates the state information we store for each pushed graphics state. 46 // Encapsulates the state information we store for each pushed graphics state.
46 // Only GraphicsContext can use this class. 47 // Only GraphicsContext can use this class.
47 class GraphicsContextState { 48 class GraphicsContextState {
48 public: 49 public:
(...skipping 14 matching lines...) Expand all
63 , m_strokeColorSpace(ColorSpaceDeviceRGB) 64 , m_strokeColorSpace(ColorSpaceDeviceRGB)
64 , m_dashRatio(3) 65 , m_dashRatio(3)
65 , m_miterLimit(4) 66 , m_miterLimit(4)
66 , m_lineCap(SkPaint::kDefault_Cap) 67 , m_lineCap(SkPaint::kDefault_Cap)
67 , m_lineJoin(SkPaint::kDefault_Join) 68 , m_lineJoin(SkPaint::kDefault_Join)
68 , m_dash(0) 69 , m_dash(0)
69 , m_fillColor(Color::black) 70 , m_fillColor(Color::black)
70 , m_fillColorPacked(0xFF000000) 71 , m_fillColorPacked(0xFF000000)
71 , m_fillColorSpace(ColorSpaceDeviceRGB) 72 , m_fillColorSpace(ColorSpaceDeviceRGB)
72 , m_fillRule(RULE_NONZERO) 73 , m_fillRule(RULE_NONZERO)
73 , m_shadowBlur(0) 74 , m_looper(0)
74 , m_shadowColorSpace(ColorSpaceDeviceRGB)
75 , m_textDrawingMode(TextModeFill) 75 , m_textDrawingMode(TextModeFill)
76 , m_alpha(1) 76 , m_alpha(1)
77 , m_xferMode(SkXfermode::kSrcOver_Mode) 77 , m_xferMode(SkXfermode::kSrcOver_Mode)
78 , m_looper(0)
79 , m_compositeOperator(CompositeSourceOver) 78 , m_compositeOperator(CompositeSourceOver)
80 , m_blendMode(BlendModeNormal) 79 , m_blendMode(BlendModeNormal)
81 , m_clip(SkRect::MakeEmpty()) 80 , m_clip(SkRect::MakeEmpty())
82 #if USE(LOW_QUALITY_IMAGE_INTERPOLATION) 81 #if USE(LOW_QUALITY_IMAGE_INTERPOLATION)
83 , m_interpolationQuality(InterpolationLow) 82 , m_interpolationQuality(InterpolationLow)
84 #else 83 #else
85 , m_interpolationQuality(InterpolationHigh) 84 , m_interpolationQuality(InterpolationHigh)
86 #endif 85 #endif
87 , m_shouldAntialias(true) 86 , m_shouldAntialias(true)
88 , m_shouldSmoothFonts(true) 87 , m_shouldSmoothFonts(true)
(...skipping 14 matching lines...) Expand all
103 , m_miterLimit(other.m_miterLimit) 102 , m_miterLimit(other.m_miterLimit)
104 , m_lineCap(other.m_lineCap) 103 , m_lineCap(other.m_lineCap)
105 , m_lineJoin(other.m_lineJoin) 104 , m_lineJoin(other.m_lineJoin)
106 , m_dash(other.m_dash) 105 , m_dash(other.m_dash)
107 , m_fillColor(other.m_fillColor) 106 , m_fillColor(other.m_fillColor)
108 , m_fillColorPacked(other.m_fillColorPacked) 107 , m_fillColorPacked(other.m_fillColorPacked)
109 , m_fillColorSpace(other.m_fillColorSpace) 108 , m_fillColorSpace(other.m_fillColorSpace)
110 , m_fillRule(other.m_fillRule) 109 , m_fillRule(other.m_fillRule)
111 , m_fillGradient(other.m_fillGradient) 110 , m_fillGradient(other.m_fillGradient)
112 , m_fillPattern(other.m_fillPattern) 111 , m_fillPattern(other.m_fillPattern)
113 , m_shadowBlur(other.m_shadowBlur) 112 , m_looper(other.m_looper)
114 , m_shadowColor(other.m_shadowColor)
115 , m_shadowOffset(other.m_shadowOffset)
116 , m_shadowColorSpace(other.m_shadowColorSpace)
117 , m_textDrawingMode(other.m_textDrawingMode) 113 , m_textDrawingMode(other.m_textDrawingMode)
118 , m_alpha(other.m_alpha) 114 , m_alpha(other.m_alpha)
119 , m_xferMode(other.m_xferMode) 115 , m_xferMode(other.m_xferMode)
120 , m_looper(other.m_looper)
121 , m_compositeOperator(other.m_compositeOperator) 116 , m_compositeOperator(other.m_compositeOperator)
122 , m_blendMode(other.m_blendMode) 117 , m_blendMode(other.m_blendMode)
123 , m_imageBufferClip(other.m_imageBufferClip) 118 , m_imageBufferClip(other.m_imageBufferClip)
124 , m_clip(other.m_clip) 119 , m_clip(other.m_clip)
125 , m_interpolationQuality(other.m_interpolationQuality) 120 , m_interpolationQuality(other.m_interpolationQuality)
126 , m_shouldAntialias(other.m_shouldAntialias) 121 , m_shouldAntialias(other.m_shouldAntialias)
127 , m_shouldSmoothFonts(other.m_shouldSmoothFonts) 122 , m_shouldSmoothFonts(other.m_shouldSmoothFonts)
128 , m_shouldSubpixelQuantizeFonts(other.m_shouldSubpixelQuantizeFonts) 123 , m_shouldSubpixelQuantizeFonts(other.m_shouldSubpixelQuantizeFonts)
129 , m_shadowsIgnoreTransforms(other.m_shadowsIgnoreTransforms) 124 , m_shadowsIgnoreTransforms(other.m_shadowsIgnoreTransforms)
130 { 125 {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 SkDashPathEffect* m_dash; 167 SkDashPathEffect* m_dash;
173 168
174 // Fill. 169 // Fill.
175 Color m_fillColor; 170 Color m_fillColor;
176 SkColor m_fillColorPacked; 171 SkColor m_fillColorPacked;
177 ColorSpace m_fillColorSpace; 172 ColorSpace m_fillColorSpace;
178 WindRule m_fillRule; 173 WindRule m_fillRule;
179 RefPtr<Gradient> m_fillGradient; 174 RefPtr<Gradient> m_fillGradient;
180 RefPtr<Pattern> m_fillPattern; 175 RefPtr<Pattern> m_fillPattern;
181 176
182 // Shadow. 177 // Shadow. (This will need tweaking if we use draw loopers for other things. )
183 float m_shadowBlur; 178 SkDrawLooper* m_looper;
184 Color m_shadowColor;
185 FloatSize m_shadowOffset;
186 ColorSpace m_shadowColorSpace;
187 179
188 // Text. (See TextModeFill & friends.) 180 // Text. (See TextModeFill & friends.)
189 TextDrawingModeFlags m_textDrawingMode; 181 TextDrawingModeFlags m_textDrawingMode;
190 182
191 // Common shader state. 183 // Common shader state.
192 float m_alpha; 184 float m_alpha;
193 SkXfermode::Mode m_xferMode; 185 SkXfermode::Mode m_xferMode;
194 SkDrawLooper* m_looper;
195 186
196 // Compositing control, for the CSS and Canvas compositing spec. 187 // Compositing control, for the CSS and Canvas compositing spec.
197 CompositeOperator m_compositeOperator; 188 CompositeOperator m_compositeOperator;
198 BlendMode m_blendMode; 189 BlendMode m_blendMode;
199 190
200 // If non-empty, the current State is clipped to this image. 191 // If non-empty, the current State is clipped to this image.
201 SkBitmap m_imageBufferClip; 192 SkBitmap m_imageBufferClip;
202 193
203 // If m_imageBufferClip is non-empty, this is the region the image is clippe d to. 194 // If m_imageBufferClip is non-empty, this is the region the image is clippe d to.
204 SkRect m_clip; 195 SkRect m_clip;
205 196
206 // Image interpolation control. 197 // Image interpolation control.
207 InterpolationQuality m_interpolationQuality; 198 InterpolationQuality m_interpolationQuality;
208 199
209 bool m_shouldAntialias : 1; 200 bool m_shouldAntialias : 1;
210 bool m_shouldSmoothFonts : 1; 201 bool m_shouldSmoothFonts : 1;
211 bool m_shouldSubpixelQuantizeFonts : 1; 202 bool m_shouldSubpixelQuantizeFonts : 1;
212 bool m_shadowsIgnoreTransforms : 1; 203 bool m_shadowsIgnoreTransforms : 1;
213 }; 204 };
214 205
215 } // namespace WebCore 206 } // namespace WebCore
216 207
217 #endif // GraphicsContextState_h 208 #endif // GraphicsContextState_h
218 209
OLDNEW
« no previous file with comments | « Source/core/platform/graphics/GraphicsContext.cpp ('k') | Source/core/rendering/EllipsisBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698