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

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

Issue 669123002: Fixed Shadow blur for transparent objects (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added missing virtual layout test to TestExpectations Created 6 years, 2 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 "platform/graphics/DrawLooperBuilder.h" 32 #include "platform/graphics/DrawLooperBuilder.h"
33 #include "platform/graphics/Gradient.h" 33 #include "platform/graphics/Gradient.h"
34 #include "platform/graphics/GraphicsTypes.h" 34 #include "platform/graphics/GraphicsTypes.h"
35 #include "platform/graphics/Path.h" 35 #include "platform/graphics/Path.h"
36 #include "platform/graphics/Pattern.h" 36 #include "platform/graphics/Pattern.h"
37 #include "platform/graphics/StrokeData.h" 37 #include "platform/graphics/StrokeData.h"
38 #include "third_party/skia/include/core/SkColorFilter.h" 38 #include "third_party/skia/include/core/SkColorFilter.h"
39 #include "third_party/skia/include/core/SkImageFilter.h"
39 #include "third_party/skia/include/core/SkPaint.h" 40 #include "third_party/skia/include/core/SkPaint.h"
40 #include "wtf/PassOwnPtr.h" 41 #include "wtf/PassOwnPtr.h"
41 #include "wtf/RefPtr.h" 42 #include "wtf/RefPtr.h"
42 43
43 namespace blink { 44 namespace blink {
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 PLATFORM_EXPORT GraphicsContextState final { 48 class PLATFORM_EXPORT GraphicsContextState final {
48 public: 49 public:
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 104
104 // Path fill rule 105 // Path fill rule
105 WindRule fillRule() const { return m_fillRule; } 106 WindRule fillRule() const { return m_fillRule; }
106 void setFillRule(WindRule rule) { m_fillRule = rule; } 107 void setFillRule(WindRule rule) { m_fillRule = rule; }
107 108
108 // Shadow. (This will need tweaking if we use draw loopers for other things. ) 109 // Shadow. (This will need tweaking if we use draw loopers for other things. )
109 SkDrawLooper* drawLooper() const { return m_looper.get(); } 110 SkDrawLooper* drawLooper() const { return m_looper.get(); }
110 void setDrawLooper(PassRefPtr<SkDrawLooper>); 111 void setDrawLooper(PassRefPtr<SkDrawLooper>);
111 void clearDrawLooper(); 112 void clearDrawLooper();
112 113
114 SkImageFilter* dropShadowImageFilter() const { return m_dropShadowImageFilte r.get(); }
115 void setDropShadowImageFilter(PassRefPtr<SkImageFilter>);
116 void clearDropShadowImageFilter();
117
113 // Text. (See TextModeFill & friends.) 118 // Text. (See TextModeFill & friends.)
114 TextDrawingModeFlags textDrawingMode() const { return m_textDrawingMode; } 119 TextDrawingModeFlags textDrawingMode() const { return m_textDrawingMode; }
115 void setTextDrawingMode(TextDrawingModeFlags mode) { m_textDrawingMode = mod e; } 120 void setTextDrawingMode(TextDrawingModeFlags mode) { m_textDrawingMode = mod e; }
116 121
117 // Common shader state. 122 // Common shader state.
118 int alpha() const { return m_alpha; } 123 int alpha() const { return m_alpha; }
119 void setAlphaAsFloat(float); 124 void setAlphaAsFloat(float);
120 125
121 SkColorFilter* colorFilter() const { return m_colorFilter.get(); } 126 SkColorFilter* colorFilter() const { return m_colorFilter.get(); }
122 void setColorFilter(PassRefPtr<SkColorFilter>); 127 void setColorFilter(PassRefPtr<SkColorFilter>);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 Color m_strokeColor; 163 Color m_strokeColor;
159 RefPtr<Gradient> m_strokeGradient; 164 RefPtr<Gradient> m_strokeGradient;
160 RefPtr<Pattern> m_strokePattern; 165 RefPtr<Pattern> m_strokePattern;
161 166
162 Color m_fillColor; 167 Color m_fillColor;
163 WindRule m_fillRule; 168 WindRule m_fillRule;
164 RefPtr<Gradient> m_fillGradient; 169 RefPtr<Gradient> m_fillGradient;
165 RefPtr<Pattern> m_fillPattern; 170 RefPtr<Pattern> m_fillPattern;
166 171
167 RefPtr<SkDrawLooper> m_looper; 172 RefPtr<SkDrawLooper> m_looper;
173 RefPtr<SkImageFilter> m_dropShadowImageFilter;
168 174
169 TextDrawingModeFlags m_textDrawingMode; 175 TextDrawingModeFlags m_textDrawingMode;
170 176
171 int m_alpha; 177 int m_alpha;
172 RefPtr<SkColorFilter> m_colorFilter; 178 RefPtr<SkColorFilter> m_colorFilter;
173 179
174 CompositeOperator m_compositeOperator; 180 CompositeOperator m_compositeOperator;
175 WebBlendMode m_blendMode; 181 WebBlendMode m_blendMode;
176 182
177 InterpolationQuality m_interpolationQuality; 183 InterpolationQuality m_interpolationQuality;
178 184
179 uint16_t m_saveCount; 185 uint16_t m_saveCount;
180 186
181 bool m_shouldAntialias : 1; 187 bool m_shouldAntialias : 1;
182 bool m_shouldClampToSourceRect : 1; 188 bool m_shouldClampToSourceRect : 1;
183 }; 189 };
184 190
185 } // namespace blink 191 } // namespace blink
186 192
187 #endif // GraphicsContextState_h 193 #endif // GraphicsContextState_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698