| 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 102 |
| 103 float shadowOffsetY() const; | 103 float shadowOffsetY() const; |
| 104 void setShadowOffsetY(float); | 104 void setShadowOffsetY(float); |
| 105 | 105 |
| 106 float shadowBlur() const; | 106 float shadowBlur() const; |
| 107 void setShadowBlur(float); | 107 void setShadowBlur(float); |
| 108 | 108 |
| 109 String shadowColor() const; | 109 String shadowColor() const; |
| 110 void setShadowColor(const String&); | 110 void setShadowColor(const String&); |
| 111 | 111 |
| 112 float globalAlpha() const; | |
| 113 void setGlobalAlpha(float); | |
| 114 | |
| 115 bool isContextLost() const; | 112 bool isContextLost() const; |
| 116 | 113 |
| 117 String globalCompositeOperation() const; | |
| 118 void setGlobalCompositeOperation(const String&); | |
| 119 | |
| 120 void save() { ++m_stateStack.last()->m_unrealizedSaveCount; } | 114 void save() { ++m_stateStack.last()->m_unrealizedSaveCount; } |
| 121 void restore(); | 115 void restore(); |
| 122 | 116 |
| 123 void scale(float sx, float sy); | 117 void scale(float sx, float sy); |
| 124 void rotate(float angleInRadians); | 118 void rotate(float angleInRadians); |
| 125 void translate(float tx, float ty); | 119 void translate(float tx, float ty); |
| 126 void transform(float m11, float m12, float m21, float m22, float dx, float d
y); | 120 void transform(float m11, float m12, float m21, float m22, float dx, float d
y); |
| 127 void setTransform(float m11, float m12, float m21, float m22, float dx, floa
t dy); | 121 void setTransform(float m11, float m12, float m21, float m22, float dx, floa
t dy); |
| 128 void resetTransform(); | 122 void resetTransform(); |
| 129 | 123 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 | 166 |
| 173 void clearShadow(); | 167 void clearShadow(); |
| 174 | 168 |
| 175 void drawImage(CanvasImageSource*, float x, float y, ExceptionState&); | 169 void drawImage(CanvasImageSource*, float x, float y, ExceptionState&); |
| 176 void drawImage(CanvasImageSource*, float x, float y, float width, float heig
ht, ExceptionState&); | 170 void drawImage(CanvasImageSource*, float x, float y, float width, float heig
ht, ExceptionState&); |
| 177 void drawImage(CanvasImageSource*, float sx, float sy, float sw, float sh, f
loat dx, float dy, float dw, float dh, ExceptionState&); | 171 void drawImage(CanvasImageSource*, float sx, float sy, float sw, float sh, f
loat dx, float dy, float dw, float dh, ExceptionState&); |
| 178 | 172 |
| 179 void drawImageFromRect(HTMLImageElement*, float sx = 0, float sy = 0, float
sw = 0, float sh = 0, | 173 void drawImageFromRect(HTMLImageElement*, float sx = 0, float sy = 0, float
sw = 0, float sh = 0, |
| 180 float dx = 0, float dy = 0, float dw = 0, float dh =
0, const String& compositeOperation = emptyString()); | 174 float dx = 0, float dy = 0, float dw = 0, float dh =
0, const String& compositeOperation = emptyString()); |
| 181 | 175 |
| 182 void setAlpha(float); | |
| 183 | |
| 184 void setCompositeOperation(const String&); | 176 void setCompositeOperation(const String&); |
| 185 | 177 |
| 186 PassRefPtr<CanvasGradient> createLinearGradient(float x0, float y0, float x1
, float y1); | 178 PassRefPtr<CanvasGradient> createLinearGradient(float x0, float y0, float x1
, float y1); |
| 187 PassRefPtr<CanvasGradient> createRadialGradient(float x0, float y0, float r0
, float x1, float y1, float r1, ExceptionState&); | 179 PassRefPtr<CanvasGradient> createRadialGradient(float x0, float y0, float r0
, float x1, float y1, float r1, ExceptionState&); |
| 188 PassRefPtr<CanvasPattern> createPattern(CanvasImageSource*, const String& re
petitionType, ExceptionState&); | 180 PassRefPtr<CanvasPattern> createPattern(CanvasImageSource*, const String& re
petitionType, ExceptionState&); |
| 189 | 181 |
| 190 PassRefPtr<ImageData> createImageData(PassRefPtr<ImageData>) const; | 182 PassRefPtr<ImageData> createImageData(PassRefPtr<ImageData>) const; |
| 191 PassRefPtr<ImageData> createImageData(float width, float height, ExceptionSt
ate&) const; | 183 PassRefPtr<ImageData> createImageData(float width, float height, ExceptionSt
ate&) const; |
| 192 PassRefPtr<ImageData> getImageData(float sx, float sy, float sw, float sh, E
xceptionState&) const; | 184 PassRefPtr<ImageData> getImageData(float sx, float sy, float sw, float sh, E
xceptionState&) const; |
| 193 void putImageData(ImageData*, float dx, float dy); | 185 void putImageData(ImageData*, float dx, float dy); |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 String m_unparsedFillColor; | 250 String m_unparsedFillColor; |
| 259 RefPtr<CanvasStyle> m_strokeStyle; | 251 RefPtr<CanvasStyle> m_strokeStyle; |
| 260 RefPtr<CanvasStyle> m_fillStyle; | 252 RefPtr<CanvasStyle> m_fillStyle; |
| 261 float m_lineWidth; | 253 float m_lineWidth; |
| 262 LineCap m_lineCap; | 254 LineCap m_lineCap; |
| 263 LineJoin m_lineJoin; | 255 LineJoin m_lineJoin; |
| 264 float m_miterLimit; | 256 float m_miterLimit; |
| 265 FloatSize m_shadowOffset; | 257 FloatSize m_shadowOffset; |
| 266 float m_shadowBlur; | 258 float m_shadowBlur; |
| 267 RGBA32 m_shadowColor; | 259 RGBA32 m_shadowColor; |
| 268 float m_globalAlpha; | |
| 269 CompositeOperator m_globalComposite; | |
| 270 blink::WebBlendMode m_globalBlend; | |
| 271 AffineTransform m_transform; | 260 AffineTransform m_transform; |
| 272 bool m_invertibleCTM; | 261 bool m_invertibleCTM; |
| 273 Vector<float> m_lineDash; | 262 Vector<float> m_lineDash; |
| 274 float m_lineDashOffset; | 263 float m_lineDashOffset; |
| 275 bool m_imageSmoothingEnabled; | 264 bool m_imageSmoothingEnabled; |
| 276 | 265 |
| 277 // Text state. | 266 // Text state. |
| 278 TextAlign m_textAlign; | 267 TextAlign m_textAlign; |
| 279 TextBaseline m_textBaseline; | 268 TextBaseline m_textBaseline; |
| 280 Direction m_direction; | 269 Direction m_direction; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 bool focusRingCallIsValid(const Path&, Element*); | 330 bool focusRingCallIsValid(const Path&, Element*); |
| 342 void drawFocusRing(const Path&); | 331 void drawFocusRing(const Path&); |
| 343 | 332 |
| 344 void addHitRegionInternal(const HitRegionOptions&, ExceptionState&); | 333 void addHitRegionInternal(const HitRegionOptions&, ExceptionState&); |
| 345 bool hasClip() { return state().m_hasClip; } | 334 bool hasClip() { return state().m_hasClip; } |
| 346 | 335 |
| 347 void validateStateStack(); | 336 void validateStateStack(); |
| 348 | 337 |
| 349 virtual bool is2d() const override { return true; } | 338 virtual bool is2d() const override { return true; } |
| 350 virtual bool isAccelerated() const override; | 339 virtual bool isAccelerated() const override; |
| 351 virtual bool hasAlpha() const override { return m_hasAlpha; } | |
| 352 virtual void setIsHidden(bool) override; | 340 virtual void setIsHidden(bool) override; |
| 353 | 341 |
| 354 virtual bool isTransformInvertible() const override { return state().m_inver
tibleCTM; } | 342 virtual bool isTransformInvertible() const override { return state().m_inver
tibleCTM; } |
| 355 | 343 |
| 356 virtual blink::WebLayer* platformLayer() const override; | 344 virtual blink::WebLayer* platformLayer() const override; |
| 357 TextDirection toTextDirection(Direction, RenderStyle** computedStyle = nullp
tr) const; | 345 TextDirection toTextDirection(Direction, RenderStyle** computedStyle = nullp
tr) const; |
| 358 | 346 |
| 359 Vector<OwnPtr<State> > m_stateStack; | 347 Vector<OwnPtr<State> > m_stateStack; |
| 360 OwnPtr<HitRegionManager> m_hitRegionManager; | 348 OwnPtr<HitRegionManager> m_hitRegionManager; |
| 361 bool m_hasAlpha; | |
| 362 bool m_isContextLost; | 349 bool m_isContextLost; |
| 363 bool m_contextRestorable; | 350 bool m_contextRestorable; |
| 364 Canvas2DContextStorage m_storageMode; | 351 Canvas2DContextStorage m_storageMode; |
| 365 MutableStylePropertyMap m_fetchedFonts; | 352 MutableStylePropertyMap m_fetchedFonts; |
| 366 unsigned m_tryRestoreContextAttemptCount; | 353 unsigned m_tryRestoreContextAttemptCount; |
| 367 Timer<CanvasRenderingContext2D> m_dispatchContextLostEventTimer; | 354 Timer<CanvasRenderingContext2D> m_dispatchContextLostEventTimer; |
| 368 Timer<CanvasRenderingContext2D> m_dispatchContextRestoredEventTimer; | 355 Timer<CanvasRenderingContext2D> m_dispatchContextRestoredEventTimer; |
| 369 Timer<CanvasRenderingContext2D> m_tryRestoreContextEventTimer; | 356 Timer<CanvasRenderingContext2D> m_tryRestoreContextEventTimer; |
| 370 }; | 357 }; |
| 371 | 358 |
| 372 DEFINE_TYPE_CASTS(CanvasRenderingContext2D, CanvasRenderingContext, context, con
text->is2d(), context.is2d()); | 359 DEFINE_TYPE_CASTS(CanvasRenderingContext2D, CanvasRenderingContext, context, con
text->is2d(), context.is2d()); |
| 373 | 360 |
| 374 } // namespace blink | 361 } // namespace blink |
| 375 | 362 |
| 376 #endif // CanvasRenderingContext2D_h | 363 #endif // CanvasRenderingContext2D_h |
| OLD | NEW |