OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2009, 2010, 2011, 2012 Apple Inc. All rights reserv
ed. | 2 * Copyright (C) 2006, 2007, 2009, 2010, 2011, 2012 Apple Inc. All rights reserv
ed. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. 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 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 class GraphicsContext; | 55 class GraphicsContext; |
56 class HTMLCanvasElement; | 56 class HTMLCanvasElement; |
57 class HTMLImageElement; | 57 class HTMLImageElement; |
58 class HTMLVideoElement; | 58 class HTMLVideoElement; |
59 class ImageBitmap; | 59 class ImageBitmap; |
60 class ImageData; | 60 class ImageData; |
61 class TextMetrics; | 61 class TextMetrics; |
62 | 62 |
63 typedef HashMap<String, RefPtr<MutableStylePropertySet> > MutableStylePropertyMa
p; | 63 typedef HashMap<String, RefPtr<MutableStylePropertySet> > MutableStylePropertyMa
p; |
64 | 64 |
65 class CanvasRenderingContext2D : public CanvasRenderingContext, public CanvasPat
hMethods { | 65 class CanvasRenderingContext2D FINAL : public CanvasRenderingContext, public Can
vasPathMethods { |
66 public: | 66 public: |
67 static PassOwnPtr<CanvasRenderingContext2D> create(HTMLCanvasElement* canvas
, const Canvas2DContextAttributes* attrs, bool usesCSSCompatibilityParseMode) | 67 static PassOwnPtr<CanvasRenderingContext2D> create(HTMLCanvasElement* canvas
, const Canvas2DContextAttributes* attrs, bool usesCSSCompatibilityParseMode) |
68 { | 68 { |
69 return adoptPtr(new CanvasRenderingContext2D(canvas, attrs, usesCSSCompa
tibilityParseMode)); | 69 return adoptPtr(new CanvasRenderingContext2D(canvas, attrs, usesCSSCompa
tibilityParseMode)); |
70 } | 70 } |
71 virtual ~CanvasRenderingContext2D(); | 71 virtual ~CanvasRenderingContext2D(); |
72 | 72 |
73 CanvasStyle* strokeStyle() const; | 73 CanvasStyle* strokeStyle() const; |
74 void setStrokeStyle(PassRefPtr<CanvasStyle>); | 74 void setStrokeStyle(PassRefPtr<CanvasStyle>); |
75 | 75 |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 | 233 |
234 bool imageSmoothingEnabled() const; | 234 bool imageSmoothingEnabled() const; |
235 void setImageSmoothingEnabled(bool); | 235 void setImageSmoothingEnabled(bool); |
236 | 236 |
237 PassRefPtr<Canvas2DContextAttributes> getContextAttributes() const; | 237 PassRefPtr<Canvas2DContextAttributes> getContextAttributes() const; |
238 | 238 |
239 void drawSystemFocusRing(Element*); | 239 void drawSystemFocusRing(Element*); |
240 bool drawCustomFocusRing(Element*); | 240 bool drawCustomFocusRing(Element*); |
241 | 241 |
242 private: | 242 private: |
243 struct State : FontSelectorClient { | 243 struct State FINAL : FontSelectorClient { |
244 State(); | 244 State(); |
245 virtual ~State(); | 245 virtual ~State(); |
246 | 246 |
247 State(const State&); | 247 State(const State&); |
248 State& operator=(const State&); | 248 State& operator=(const State&); |
249 | 249 |
250 virtual void fontsNeedUpdate(FontSelector*) OVERRIDE; | 250 virtual void fontsNeedUpdate(FontSelector*) OVERRIDE; |
251 | 251 |
252 String m_unparsedStrokeColor; | 252 String m_unparsedStrokeColor; |
253 String m_unparsedFillColor; | 253 String m_unparsedFillColor; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
319 template<class T> void fullCanvasCompositedDrawImage(T*, const FloatRect&, c
onst FloatRect&, CompositeOperator); | 319 template<class T> void fullCanvasCompositedDrawImage(T*, const FloatRect&, c
onst FloatRect&, CompositeOperator); |
320 | 320 |
321 bool focusRingCallIsValid(const Path&, Element*); | 321 bool focusRingCallIsValid(const Path&, Element*); |
322 void updateFocusRingAccessibility(const Path&, Element*); | 322 void updateFocusRingAccessibility(const Path&, Element*); |
323 void drawFocusRing(const Path&); | 323 void drawFocusRing(const Path&); |
324 | 324 |
325 virtual bool is2d() const OVERRIDE { return true; } | 325 virtual bool is2d() const OVERRIDE { return true; } |
326 virtual bool isAccelerated() const OVERRIDE; | 326 virtual bool isAccelerated() const OVERRIDE; |
327 virtual bool hasAlpha() const OVERRIDE { return m_hasAlpha; } | 327 virtual bool hasAlpha() const OVERRIDE { return m_hasAlpha; } |
328 | 328 |
329 virtual bool isTransformInvertible() const { return state().m_invertibleCTM;
} | 329 virtual bool isTransformInvertible() const OVERRIDE { return state().m_inver
tibleCTM; } |
330 | 330 |
331 virtual blink::WebLayer* platformLayer() const OVERRIDE; | 331 virtual blink::WebLayer* platformLayer() const OVERRIDE; |
332 | 332 |
333 Vector<State, 1> m_stateStack; | 333 Vector<State, 1> m_stateStack; |
334 unsigned m_unrealizedSaveCount; | 334 unsigned m_unrealizedSaveCount; |
335 bool m_usesCSSCompatibilityParseMode; | 335 bool m_usesCSSCompatibilityParseMode; |
336 bool m_hasAlpha; | 336 bool m_hasAlpha; |
337 MutableStylePropertyMap m_fetchedFonts; | 337 MutableStylePropertyMap m_fetchedFonts; |
338 }; | 338 }; |
339 | 339 |
340 DEFINE_TYPE_CASTS(CanvasRenderingContext2D, CanvasRenderingContext, context, con
text->is2d(), context.is2d()); | 340 DEFINE_TYPE_CASTS(CanvasRenderingContext2D, CanvasRenderingContext, context, con
text->is2d(), context.is2d()); |
341 | 341 |
342 } // namespace WebCore | 342 } // namespace WebCore |
343 | 343 |
344 #endif | 344 #endif |
OLD | NEW |