| 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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 68 |
| 69 class CanvasRenderingContext2D FINAL: public CanvasRenderingContext, public Scri
ptWrappable, public CanvasPathMethods { | 69 class CanvasRenderingContext2D FINAL: public CanvasRenderingContext, public Scri
ptWrappable, public CanvasPathMethods { |
| 70 public: | 70 public: |
| 71 static PassOwnPtrWillBeRawPtr<CanvasRenderingContext2D> create(HTMLCanvasEle
ment* canvas, const Canvas2DContextAttributes* attrs, bool usesCSSCompatibilityP
arseMode) | 71 static PassOwnPtrWillBeRawPtr<CanvasRenderingContext2D> create(HTMLCanvasEle
ment* canvas, const Canvas2DContextAttributes* attrs, bool usesCSSCompatibilityP
arseMode) |
| 72 { | 72 { |
| 73 return adoptPtrWillBeNoop(new CanvasRenderingContext2D(canvas, attrs, us
esCSSCompatibilityParseMode)); | 73 return adoptPtrWillBeNoop(new CanvasRenderingContext2D(canvas, attrs, us
esCSSCompatibilityParseMode)); |
| 74 } | 74 } |
| 75 virtual ~CanvasRenderingContext2D(); | 75 virtual ~CanvasRenderingContext2D(); |
| 76 | 76 |
| 77 CanvasStyle* strokeStyle() const; | 77 CanvasStyle* strokeStyle() const; |
| 78 void setStrokeStyle(PassRefPtr<CanvasStyle>); | 78 void setStrokeStyle(PassRefPtrWillBeRawPtr<CanvasStyle>); |
| 79 | 79 |
| 80 CanvasStyle* fillStyle() const; | 80 CanvasStyle* fillStyle() const; |
| 81 void setFillStyle(PassRefPtr<CanvasStyle>); | 81 void setFillStyle(PassRefPtrWillBeRawPtr<CanvasStyle>); |
| 82 | 82 |
| 83 float lineWidth() const; | 83 float lineWidth() const; |
| 84 void setLineWidth(float); | 84 void setLineWidth(float); |
| 85 | 85 |
| 86 String lineCap() const; | 86 String lineCap() const; |
| 87 void setLineCap(const String&); | 87 void setLineCap(const String&); |
| 88 | 88 |
| 89 String lineJoin() const; | 89 String lineJoin() const; |
| 90 void setLineJoin(const String&); | 90 void setLineJoin(const String&); |
| 91 | 91 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 void drawImage(CanvasImageSource*, float x, float y, float width, float heig
ht, ExceptionState&); | 183 void drawImage(CanvasImageSource*, float x, float y, float width, float heig
ht, ExceptionState&); |
| 184 void drawImage(CanvasImageSource*, float sx, float sy, float sw, float sh, f
loat dx, float dy, float dw, float dh, ExceptionState&); | 184 void drawImage(CanvasImageSource*, float sx, float sy, float sw, float sh, f
loat dx, float dy, float dw, float dh, ExceptionState&); |
| 185 | 185 |
| 186 void drawImageFromRect(HTMLImageElement*, float sx = 0, float sy = 0, float
sw = 0, float sh = 0, | 186 void drawImageFromRect(HTMLImageElement*, float sx = 0, float sy = 0, float
sw = 0, float sh = 0, |
| 187 float dx = 0, float dy = 0, float dw = 0, float dh =
0, const String& compositeOperation = emptyString()); | 187 float dx = 0, float dy = 0, float dw = 0, float dh =
0, const String& compositeOperation = emptyString()); |
| 188 | 188 |
| 189 void setAlpha(float); | 189 void setAlpha(float); |
| 190 | 190 |
| 191 void setCompositeOperation(const String&); | 191 void setCompositeOperation(const String&); |
| 192 | 192 |
| 193 PassRefPtr<CanvasGradient> createLinearGradient(float x0, float y0, float x1
, float y1); | 193 PassRefPtrWillBeRawPtr<CanvasGradient> createLinearGradient(float x0, float
y0, float x1, float y1); |
| 194 PassRefPtr<CanvasGradient> createRadialGradient(float x0, float y0, float r0
, float x1, float y1, float r1, ExceptionState&); | 194 PassRefPtrWillBeRawPtr<CanvasGradient> createRadialGradient(float x0, float
y0, float r0, float x1, float y1, float r1, ExceptionState&); |
| 195 PassRefPtr<CanvasPattern> createPattern(CanvasImageSource*, const String& re
petitionType, ExceptionState&); | 195 PassRefPtrWillBeRawPtr<CanvasPattern> createPattern(CanvasImageSource*, cons
t String& repetitionType, ExceptionState&); |
| 196 | 196 |
| 197 PassRefPtrWillBeRawPtr<ImageData> createImageData(PassRefPtrWillBeRawPtr<Ima
geData>) const; | 197 PassRefPtrWillBeRawPtr<ImageData> createImageData(PassRefPtrWillBeRawPtr<Ima
geData>) const; |
| 198 PassRefPtrWillBeRawPtr<ImageData> createImageData(float width, float height,
ExceptionState&) const; | 198 PassRefPtrWillBeRawPtr<ImageData> createImageData(float width, float height,
ExceptionState&) const; |
| 199 PassRefPtrWillBeRawPtr<ImageData> getImageData(float sx, float sy, float sw,
float sh, ExceptionState&) const; | 199 PassRefPtrWillBeRawPtr<ImageData> getImageData(float sx, float sy, float sw,
float sh, ExceptionState&) const; |
| 200 void putImageData(ImageData*, float dx, float dy); | 200 void putImageData(ImageData*, float dx, float dy); |
| 201 void putImageData(ImageData*, float dx, float dy, float dirtyX, float dirtyY
, float dirtyWidth, float dirtyHeight); | 201 void putImageData(ImageData*, float dx, float dy, float dirtyX, float dirtyY
, float dirtyWidth, float dirtyHeight); |
| 202 | 202 |
| 203 void reset(); | 203 void reset(); |
| 204 | 204 |
| 205 String font() const; | 205 String font() const; |
| 206 void setFont(const String&); | 206 void setFont(const String&); |
| 207 | 207 |
| 208 String textAlign() const; | 208 String textAlign() const; |
| 209 void setTextAlign(const String&); | 209 void setTextAlign(const String&); |
| 210 | 210 |
| 211 String textBaseline() const; | 211 String textBaseline() const; |
| 212 void setTextBaseline(const String&); | 212 void setTextBaseline(const String&); |
| 213 | 213 |
| 214 void fillText(const String& text, float x, float y); | 214 void fillText(const String& text, float x, float y); |
| 215 void fillText(const String& text, float x, float y, float maxWidth); | 215 void fillText(const String& text, float x, float y, float maxWidth); |
| 216 void strokeText(const String& text, float x, float y); | 216 void strokeText(const String& text, float x, float y); |
| 217 void strokeText(const String& text, float x, float y, float maxWidth); | 217 void strokeText(const String& text, float x, float y, float maxWidth); |
| 218 PassRefPtr<TextMetrics> measureText(const String& text); | 218 PassRefPtrWillBeRawPtr<TextMetrics> measureText(const String& text); |
| 219 | 219 |
| 220 LineCap getLineCap() const { return state().m_lineCap; } | 220 LineCap getLineCap() const { return state().m_lineCap; } |
| 221 LineJoin getLineJoin() const { return state().m_lineJoin; } | 221 LineJoin getLineJoin() const { return state().m_lineJoin; } |
| 222 | 222 |
| 223 bool imageSmoothingEnabled() const; | 223 bool imageSmoothingEnabled() const; |
| 224 void setImageSmoothingEnabled(bool); | 224 void setImageSmoothingEnabled(bool); |
| 225 | 225 |
| 226 PassRefPtr<Canvas2DContextAttributes> getContextAttributes() const; | 226 PassRefPtrWillBeRawPtr<Canvas2DContextAttributes> getContextAttributes() con
st; |
| 227 | 227 |
| 228 void drawFocusIfNeeded(Element*); | 228 void drawFocusIfNeeded(Element*); |
| 229 void drawFocusIfNeeded(Path2D*, Element*); | 229 void drawFocusIfNeeded(Path2D*, Element*); |
| 230 | 230 |
| 231 void addHitRegion(ExceptionState&); | 231 void addHitRegion(ExceptionState&); |
| 232 void addHitRegion(const Dictionary&, ExceptionState&); | 232 void addHitRegion(const Dictionary&, ExceptionState&); |
| 233 void removeHitRegion(const String& id); | 233 void removeHitRegion(const String& id); |
| 234 void clearHitRegions(); | 234 void clearHitRegions(); |
| 235 HitRegion* hitRegionAtPoint(const LayoutPoint&); | 235 HitRegion* hitRegionAtPoint(const LayoutPoint&); |
| 236 unsigned hitRegionsCount() const; | 236 unsigned hitRegionsCount() const; |
| 237 | 237 |
| 238 void loseContext(); | 238 void loseContext(); |
| 239 void restoreContext(); | 239 void restoreContext(); |
| 240 | 240 |
| 241 virtual void trace(Visitor*) OVERRIDE; | 241 virtual void trace(Visitor*) OVERRIDE; |
| 242 | 242 |
| 243 private: | 243 private: |
| 244 class State FINAL : public CSSFontSelectorClient { | 244 class State FINAL : public CSSFontSelectorClient { |
| 245 public: | 245 public: |
| 246 State(); | 246 State(); |
| 247 virtual ~State(); | 247 virtual ~State(); |
| 248 | 248 |
| 249 State(const State&); | 249 State(const State&); |
| 250 State& operator=(const State&); | 250 State& operator=(const State&); |
| 251 | 251 |
| 252 // CSSFontSelectorClient implementation | 252 // CSSFontSelectorClient implementation |
| 253 virtual void fontsNeedUpdate(CSSFontSelector*) OVERRIDE; | 253 virtual void fontsNeedUpdate(CSSFontSelector*) OVERRIDE; |
| 254 | 254 |
| 255 virtual void trace(Visitor* visitor) OVERRIDE { CSSFontSelectorClient::t
race(visitor); } | 255 virtual void trace(Visitor*) OVERRIDE; |
| 256 | 256 |
| 257 unsigned m_unrealizedSaveCount; | 257 unsigned m_unrealizedSaveCount; |
| 258 | 258 |
| 259 String m_unparsedStrokeColor; | 259 String m_unparsedStrokeColor; |
| 260 String m_unparsedFillColor; | 260 String m_unparsedFillColor; |
| 261 RefPtr<CanvasStyle> m_strokeStyle; | 261 RefPtrWillBeMember<CanvasStyle> m_strokeStyle; |
| 262 RefPtr<CanvasStyle> m_fillStyle; | 262 RefPtrWillBeMember<CanvasStyle> m_fillStyle; |
| 263 float m_lineWidth; | 263 float m_lineWidth; |
| 264 LineCap m_lineCap; | 264 LineCap m_lineCap; |
| 265 LineJoin m_lineJoin; | 265 LineJoin m_lineJoin; |
| 266 float m_miterLimit; | 266 float m_miterLimit; |
| 267 FloatSize m_shadowOffset; | 267 FloatSize m_shadowOffset; |
| 268 float m_shadowBlur; | 268 float m_shadowBlur; |
| 269 RGBA32 m_shadowColor; | 269 RGBA32 m_shadowColor; |
| 270 float m_globalAlpha; | 270 float m_globalAlpha; |
| 271 CompositeOperator m_globalComposite; | 271 CompositeOperator m_globalComposite; |
| 272 blink::WebBlendMode m_globalBlend; | 272 blink::WebBlendMode m_globalBlend; |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 Timer<CanvasRenderingContext2D> m_dispatchContextLostEventTimer; | 368 Timer<CanvasRenderingContext2D> m_dispatchContextLostEventTimer; |
| 369 Timer<CanvasRenderingContext2D> m_dispatchContextRestoredEventTimer; | 369 Timer<CanvasRenderingContext2D> m_dispatchContextRestoredEventTimer; |
| 370 Timer<CanvasRenderingContext2D> m_tryRestoreContextEventTimer; | 370 Timer<CanvasRenderingContext2D> m_tryRestoreContextEventTimer; |
| 371 }; | 371 }; |
| 372 | 372 |
| 373 DEFINE_TYPE_CASTS(CanvasRenderingContext2D, CanvasRenderingContext, context, con
text->is2d(), context.is2d()); | 373 DEFINE_TYPE_CASTS(CanvasRenderingContext2D, CanvasRenderingContext, context, con
text->is2d(), context.is2d()); |
| 374 | 374 |
| 375 } // namespace blink | 375 } // namespace blink |
| 376 | 376 |
| 377 #endif | 377 #endif |
| OLD | NEW |