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

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 opacity check 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 // Shadow. (This will need tweaking if we use image filters for other things .)
Stephen White 2014/10/23 01:45:47 This comment doesn't really convey much. I'd remov
sugoi1 2014/10/23 17:43:17 Done.
115 SkImageFilter* imageFilter() const { return m_imageFilter.get(); }
116 void setImageFilter(PassRefPtr<SkImageFilter>);
117 void clearImageFilter();
118
113 // Text. (See TextModeFill & friends.) 119 // Text. (See TextModeFill & friends.)
114 TextDrawingModeFlags textDrawingMode() const { return m_textDrawingMode; } 120 TextDrawingModeFlags textDrawingMode() const { return m_textDrawingMode; }
115 void setTextDrawingMode(TextDrawingModeFlags mode) { m_textDrawingMode = mod e; } 121 void setTextDrawingMode(TextDrawingModeFlags mode) { m_textDrawingMode = mod e; }
116 122
117 // Common shader state. 123 // Common shader state.
118 int alpha() const { return m_alpha; } 124 int alpha() const { return m_alpha; }
119 void setAlphaAsFloat(float); 125 void setAlphaAsFloat(float);
120 126
121 SkColorFilter* colorFilter() const { return m_colorFilter.get(); } 127 SkColorFilter* colorFilter() const { return m_colorFilter.get(); }
122 void setColorFilter(PassRefPtr<SkColorFilter>); 128 void setColorFilter(PassRefPtr<SkColorFilter>);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 Color m_strokeColor; 164 Color m_strokeColor;
159 RefPtr<Gradient> m_strokeGradient; 165 RefPtr<Gradient> m_strokeGradient;
160 RefPtr<Pattern> m_strokePattern; 166 RefPtr<Pattern> m_strokePattern;
161 167
162 Color m_fillColor; 168 Color m_fillColor;
163 WindRule m_fillRule; 169 WindRule m_fillRule;
164 RefPtr<Gradient> m_fillGradient; 170 RefPtr<Gradient> m_fillGradient;
165 RefPtr<Pattern> m_fillPattern; 171 RefPtr<Pattern> m_fillPattern;
166 172
167 RefPtr<SkDrawLooper> m_looper; 173 RefPtr<SkDrawLooper> m_looper;
174 RefPtr<SkImageFilter> m_imageFilter;
168 175
169 TextDrawingModeFlags m_textDrawingMode; 176 TextDrawingModeFlags m_textDrawingMode;
170 177
171 int m_alpha; 178 int m_alpha;
172 RefPtr<SkColorFilter> m_colorFilter; 179 RefPtr<SkColorFilter> m_colorFilter;
173 180
174 CompositeOperator m_compositeOperator; 181 CompositeOperator m_compositeOperator;
175 WebBlendMode m_blendMode; 182 WebBlendMode m_blendMode;
176 183
177 InterpolationQuality m_interpolationQuality; 184 InterpolationQuality m_interpolationQuality;
178 185
179 uint16_t m_saveCount; 186 uint16_t m_saveCount;
180 187
181 bool m_shouldAntialias : 1; 188 bool m_shouldAntialias : 1;
182 bool m_shouldClampToSourceRect : 1; 189 bool m_shouldClampToSourceRect : 1;
183 }; 190 };
184 191
185 } // namespace blink 192 } // namespace blink
186 193
187 #endif // GraphicsContextState_h 194 #endif // GraphicsContextState_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698