Chromium Code Reviews

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

Issue 358893002: Use newImageSnapshot() to get an image from a Canvas (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Bitmap caching for Shaders/Patterns from StaticBitmapImage/SkImage Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
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 63 matching lines...)
74 void setStrokeStyle(StrokeStyle); 74 void setStrokeStyle(StrokeStyle);
75 75
76 void setStrokeThickness(float); 76 void setStrokeThickness(float);
77 77
78 SkColor effectiveStrokeColor() const { return applyAlpha(m_strokeData.color( ).rgb()); } 78 SkColor effectiveStrokeColor() const { return applyAlpha(m_strokeData.color( ).rgb()); }
79 void setStrokeColor(const Color&); 79 void setStrokeColor(const Color&);
80 80
81 void setStrokeGradient(const PassRefPtr<Gradient>); 81 void setStrokeGradient(const PassRefPtr<Gradient>);
82 void clearStrokeGradient(); 82 void clearStrokeGradient();
83 83
84 void setStrokePattern(const PassRefPtr<Pattern>); 84 void setStrokePattern(const PassRefPtr<Pattern>, SkShader::ShaderLocation pr eferredLocation);
85 void clearStrokePattern(); 85 void clearStrokePattern();
86 86
87 void setLineCap(LineCap); 87 void setLineCap(LineCap);
88 88
89 void setLineJoin(LineJoin); 89 void setLineJoin(LineJoin);
90 90
91 void setMiterLimit(float); 91 void setMiterLimit(float);
92 92
93 void setLineDash(const DashArray&, float); 93 void setLineDash(const DashArray&, float);
94 94
95 // Fill data 95 // Fill data
96 Color fillColor() const { return m_fillColor; } 96 Color fillColor() const { return m_fillColor; }
97 SkColor effectiveFillColor() const { return applyAlpha(m_fillColor.rgb()); } 97 SkColor effectiveFillColor() const { return applyAlpha(m_fillColor.rgb()); }
98 void setFillColor(const Color&); 98 void setFillColor(const Color&);
99 99
100 Gradient* fillGradient() const { return m_fillGradient.get(); } 100 Gradient* fillGradient() const { return m_fillGradient.get(); }
101 void setFillGradient(const PassRefPtr<Gradient>); 101 void setFillGradient(const PassRefPtr<Gradient>);
102 void clearFillGradient(); 102 void clearFillGradient();
103 103
104 Pattern* fillPattern() const { return m_fillPattern.get(); } 104 Pattern* fillPattern() const { return m_fillPattern.get(); }
105 void setFillPattern(const PassRefPtr<Pattern>); 105 void setFillPattern(const PassRefPtr<Pattern>, SkShader::ShaderLocation pref erredLocation);
106 void clearFillPattern(); 106 void clearFillPattern();
107 107
108 // Path fill rule 108 // Path fill rule
109 WindRule fillRule() const { return m_fillRule; } 109 WindRule fillRule() const { return m_fillRule; }
110 void setFillRule(WindRule rule) { m_fillRule = rule; } 110 void setFillRule(WindRule rule) { m_fillRule = rule; }
111 111
112 // Shadow. (This will need tweaking if we use draw loopers for other things. ) 112 // Shadow. (This will need tweaking if we use draw loopers for other things. )
113 SkDrawLooper* drawLooper() const { return m_looper.get(); } 113 SkDrawLooper* drawLooper() const { return m_looper.get(); }
114 void setDrawLooper(PassRefPtr<SkDrawLooper>); 114 void setDrawLooper(PassRefPtr<SkDrawLooper>);
115 void clearDrawLooper(); 115 void clearDrawLooper();
(...skipping 68 matching lines...)
184 uint16_t m_saveCount; 184 uint16_t m_saveCount;
185 185
186 bool m_shouldAntialias : 1; 186 bool m_shouldAntialias : 1;
187 bool m_shouldSmoothFonts : 1; 187 bool m_shouldSmoothFonts : 1;
188 bool m_shouldClampToSourceRect : 1; 188 bool m_shouldClampToSourceRect : 1;
189 }; 189 };
190 190
191 } // namespace blink 191 } // namespace blink
192 192
193 #endif // GraphicsContextState_h 193 #endif // GraphicsContextState_h
OLDNEW

Powered by Google App Engine