OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2009, 2010, 2011, 2012 Apple Inc. All rights | 2 * Copyright (C) 2006, 2007, 2009, 2010, 2011, 2012 Apple Inc. All rights |
3 * reserved. | 3 * reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
84 Document& document) override { | 84 Document& document) override { |
85 return new CanvasRenderingContext2D(canvas, attrs, document); | 85 return new CanvasRenderingContext2D(canvas, attrs, document); |
86 } | 86 } |
87 CanvasRenderingContext::ContextType GetContextType() const override { | 87 CanvasRenderingContext::ContextType GetContextType() const override { |
88 return CanvasRenderingContext::kContext2d; | 88 return CanvasRenderingContext::kContext2d; |
89 } | 89 } |
90 }; | 90 }; |
91 | 91 |
92 ~CanvasRenderingContext2D() override; | 92 ~CanvasRenderingContext2D() override; |
93 | 93 |
94 void SetCanvasGetContextResult(RenderingContext&) final; | 94 void SetCanvasGetContextResult(blink::RenderingContext&) final; |
95 | 95 |
96 bool isContextLost() const override; | 96 bool isContextLost() const override; |
97 | 97 |
98 bool ShouldAntialias() const override; | 98 bool ShouldAntialias() const override; |
99 void SetShouldAntialias(bool) override; | 99 void SetShouldAntialias(bool) override; |
100 | 100 |
101 void scrollPathIntoView(); | 101 void scrollPathIntoView(); |
102 void scrollPathIntoView(Path2D*); | 102 void scrollPathIntoView(Path2D*); |
103 | 103 |
104 void clearRect(double x, double y, double width, double height) override; | 104 void clearRect(double x, double y, double width, double height) override; |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
193 void ResetUsageTracking(); | 193 void ResetUsageTracking(); |
194 | 194 |
195 void FinalizeFrame() override { usage_counters_.num_frames_since_reset++; } | 195 void FinalizeFrame() override { usage_counters_.num_frames_since_reset++; } |
196 | 196 |
197 bool IsPaintable() const final { return HasImageBuffer(); } | 197 bool IsPaintable() const final { return HasImageBuffer(); } |
198 | 198 |
199 ColorBehavior DrawImageColorBehavior() const final; | 199 ColorBehavior DrawImageColorBehavior() const final; |
200 | 200 |
201 void WillDrawImage(CanvasImageSource*) const final; | 201 void WillDrawImage(CanvasImageSource*) const final; |
202 | 202 |
203 ImageData* createImageData(ImageData*, ExceptionState&) const; | |
fserb
2017/04/11 03:21:44
do we need those on CanvasRenderingContext2D at al
zakerinasab
2017/04/11 19:53:00
All moved to BaseRenderingContext2D.
| |
204 ImageData* createImageData(int, int, ExceptionState&) const; | |
205 ImageData* createImageData(unsigned, | |
206 unsigned, | |
207 ImageDataColorSettings&, | |
208 ExceptionState&) const; | |
209 ImageData* createImageData(ImageDataArray&, | |
210 unsigned, | |
211 unsigned, | |
212 ImageDataColorSettings&, | |
213 ExceptionState&) const; | |
214 | |
203 protected: | 215 protected: |
204 virtual void NeedsFinalizeFrame() { | 216 virtual void NeedsFinalizeFrame() { |
205 CanvasRenderingContext::NeedsFinalizeFrame(); | 217 CanvasRenderingContext::NeedsFinalizeFrame(); |
206 } | 218 } |
207 | 219 |
208 private: | 220 private: |
209 friend class CanvasRenderingContext2DAutoRestoreSkCanvas; | 221 friend class CanvasRenderingContext2DAutoRestoreSkCanvas; |
210 | 222 |
211 CanvasRenderingContext2D(HTMLCanvasElement*, | 223 CanvasRenderingContext2D(HTMLCanvasElement*, |
212 const CanvasContextCreationAttributes& attrs, | 224 const CanvasContextCreationAttributes& attrs, |
(...skipping 17 matching lines...) Expand all Loading... | |
230 float GetFontBaseline(const FontMetrics&) const; | 242 float GetFontBaseline(const FontMetrics&) const; |
231 | 243 |
232 void DrawFocusIfNeededInternal(const Path&, Element*); | 244 void DrawFocusIfNeededInternal(const Path&, Element*); |
233 bool FocusRingCallIsValid(const Path&, Element*); | 245 bool FocusRingCallIsValid(const Path&, Element*); |
234 void DrawFocusRing(const Path&); | 246 void DrawFocusRing(const Path&); |
235 void UpdateElementAccessibility(const Path&, Element*); | 247 void UpdateElementAccessibility(const Path&, Element*); |
236 | 248 |
237 CanvasRenderingContext::ContextType GetContextType() const override { | 249 CanvasRenderingContext::ContextType GetContextType() const override { |
238 return CanvasRenderingContext::kContext2d; | 250 return CanvasRenderingContext::kContext2d; |
239 } | 251 } |
252 | |
253 CanvasColorSpace ColorSpace() const override; | |
254 String ColorSpaceAsString() const override; | |
255 CanvasPixelFormat PixelFormat() const override; | |
256 | |
240 bool Is2d() const override { return true; } | 257 bool Is2d() const override { return true; } |
241 bool IsComposited() const override; | 258 bool IsComposited() const override; |
242 bool IsAccelerated() const override; | 259 bool IsAccelerated() const override; |
243 bool HasAlpha() const override { return CreationAttributes().alpha(); } | 260 bool HasAlpha() const override { return CreationAttributes().alpha(); } |
244 void SetIsHidden(bool) override; | 261 void SetIsHidden(bool) override; |
245 void Stop() final; | 262 void Stop() final; |
246 DECLARE_VIRTUAL_TRACE(); | 263 DECLARE_VIRTUAL_TRACE(); |
247 | 264 |
248 virtual bool IsTransformInvertible() const; | 265 virtual bool IsTransformInvertible() const; |
249 | 266 |
(...skipping 16 matching lines...) Expand all Loading... | |
266 | 283 |
267 DEFINE_TYPE_CASTS(CanvasRenderingContext2D, | 284 DEFINE_TYPE_CASTS(CanvasRenderingContext2D, |
268 CanvasRenderingContext, | 285 CanvasRenderingContext, |
269 context, | 286 context, |
270 context->Is2d() && context->canvas(), | 287 context->Is2d() && context->canvas(), |
271 context.Is2d() && context.canvas()); | 288 context.Is2d() && context.canvas()); |
272 | 289 |
273 } // namespace blink | 290 } // namespace blink |
274 | 291 |
275 #endif // CanvasRenderingContext2D_h | 292 #endif // CanvasRenderingContext2D_h |
OLD | NEW |