| 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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 void setShadowBlur(float); | 106 void setShadowBlur(float); |
| 107 | 107 |
| 108 String shadowColor() const; | 108 String shadowColor() const; |
| 109 void setShadowColor(const String&); | 109 void setShadowColor(const String&); |
| 110 | 110 |
| 111 float globalAlpha() const; | 111 float globalAlpha() const; |
| 112 void setGlobalAlpha(float); | 112 void setGlobalAlpha(float); |
| 113 | 113 |
| 114 bool isContextLost() const; | 114 bool isContextLost() const; |
| 115 | 115 |
| 116 bool shouldAntialias() const; |
| 117 void setShouldAntialias(bool); |
| 118 |
| 116 String globalCompositeOperation() const; | 119 String globalCompositeOperation() const; |
| 117 void setGlobalCompositeOperation(const String&); | 120 void setGlobalCompositeOperation(const String&); |
| 118 | 121 |
| 119 void save(); | 122 void save(); |
| 120 void restore(); | 123 void restore(); |
| 121 | 124 |
| 122 PassRefPtrWillBeRawPtr<SVGMatrixTearOff> currentTransform() const; | 125 PassRefPtrWillBeRawPtr<SVGMatrixTearOff> currentTransform() const; |
| 123 void setCurrentTransform(PassRefPtrWillBeRawPtr<SVGMatrixTearOff>); | 126 void setCurrentTransform(PassRefPtrWillBeRawPtr<SVGMatrixTearOff>); |
| 124 | 127 |
| 125 void scale(float sx, float sy); | 128 void scale(float sx, float sy); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 | 218 |
| 216 private: | 219 private: |
| 217 friend class CanvasRenderingContext2DAutoRestoreSkCanvas; | 220 friend class CanvasRenderingContext2DAutoRestoreSkCanvas; |
| 218 | 221 |
| 219 CanvasRenderingContext2D(HTMLCanvasElement*, const CanvasContextCreationAttr
ibutes& attrs, Document&); | 222 CanvasRenderingContext2D(HTMLCanvasElement*, const CanvasContextCreationAttr
ibutes& attrs, Document&); |
| 220 | 223 |
| 221 CanvasRenderingContext2DState& modifiableState(); | 224 CanvasRenderingContext2DState& modifiableState(); |
| 222 const CanvasRenderingContext2DState& state() const { return *m_stateStack.la
st(); } | 225 const CanvasRenderingContext2DState& state() const { return *m_stateStack.la
st(); } |
| 223 | 226 |
| 224 void setShadow(const FloatSize& offset, float blur, RGBA32 color); | 227 void setShadow(const FloatSize& offset, float blur, RGBA32 color); |
| 225 void applyShadow(ShadowMode = DrawShadowAndForeground); | |
| 226 | 228 |
| 227 void dispatchContextLostEvent(Timer<CanvasRenderingContext2D>*); | 229 void dispatchContextLostEvent(Timer<CanvasRenderingContext2D>*); |
| 228 void dispatchContextRestoredEvent(Timer<CanvasRenderingContext2D>*); | 230 void dispatchContextRestoredEvent(Timer<CanvasRenderingContext2D>*); |
| 229 void tryRestoreContextEvent(Timer<CanvasRenderingContext2D>*); | 231 void tryRestoreContextEvent(Timer<CanvasRenderingContext2D>*); |
| 230 | 232 |
| 231 bool computeDirtyRect(const FloatRect& localBounds, SkIRect*); | 233 bool computeDirtyRect(const FloatRect& localBounds, SkIRect*); |
| 232 bool computeDirtyRect(const FloatRect& localBounds, const SkIRect& transform
edClipBounds, SkIRect*); | 234 bool computeDirtyRect(const FloatRect& localBounds, const SkIRect& transform
edClipBounds, SkIRect*); |
| 233 void didDraw(const SkIRect&); | 235 void didDraw(const SkIRect&); |
| 234 | 236 |
| 235 GraphicsContext* drawingContext() const; // Deprecated: use drawingCanvas | |
| 236 SkCanvas* drawingCanvas() const; | 237 SkCanvas* drawingCanvas() const; |
| 237 | 238 |
| 238 void unwindStateStack(); | 239 void unwindStateStack(); |
| 239 void realizeSaves(SkCanvas*); | 240 void realizeSaves(); |
| 241 |
| 242 bool shouldDrawImageAntialiased(const FloatRect& destRect) const; |
| 240 | 243 |
| 241 template<typename DrawFunc, typename ContainsFunc> | 244 template<typename DrawFunc, typename ContainsFunc> |
| 242 bool draw(const DrawFunc&, const ContainsFunc&, const SkRect& bounds, Canvas
RenderingContext2DState::PaintType, CanvasRenderingContext2DState::ImageType = C
anvasRenderingContext2DState::NoImage); | 245 bool draw(const DrawFunc&, const ContainsFunc&, const SkRect& bounds, Canvas
RenderingContext2DState::PaintType, CanvasRenderingContext2DState::ImageType = C
anvasRenderingContext2DState::NoImage); |
| 243 void drawPathInternal(const Path&, CanvasRenderingContext2DState::PaintType,
SkPath::FillType = SkPath::kWinding_FillType); | 246 void drawPathInternal(const Path&, CanvasRenderingContext2DState::PaintType,
SkPath::FillType = SkPath::kWinding_FillType); |
| 244 void drawImageOnContext(CanvasImageSource*, Image*, const FloatRect& srcRect
, const FloatRect& dstRect, const SkPaint*); | 247 void drawImageInternal(CanvasImageSource*, Image*, const FloatRect& srcRect,
const FloatRect& dstRect, const SkPaint*); |
| 245 void drawVideo(CanvasImageSource*, const FloatRect& srcRect, const FloatRect
& dstRect); | |
| 246 void clipInternal(const Path&, const String& windingRuleString); | 248 void clipInternal(const Path&, const String& windingRuleString); |
| 247 | 249 |
| 248 bool isPointInPathInternal(const Path&, const float x, const float y, const
String& windingRuleString); | 250 bool isPointInPathInternal(const Path&, const float x, const float y, const
String& windingRuleString); |
| 249 bool isPointInStrokeInternal(const Path&, const float x, const float y); | 251 bool isPointInStrokeInternal(const Path&, const float x, const float y); |
| 250 | 252 |
| 251 void scrollPathIntoViewInternal(const Path&); | 253 void scrollPathIntoViewInternal(const Path&); |
| 252 | 254 |
| 253 void drawTextInternal(const String&, float x, float y, CanvasRenderingContex
t2DState::PaintType, float* maxWidth = nullptr); | 255 void drawTextInternal(const String&, float x, float y, CanvasRenderingContex
t2DState::PaintType, float* maxWidth = nullptr); |
| 254 | 256 |
| 255 const Font& accessFont(); | 257 const Font& accessFont(); |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 Timer<CanvasRenderingContext2D> m_dispatchContextLostEventTimer; | 302 Timer<CanvasRenderingContext2D> m_dispatchContextLostEventTimer; |
| 301 Timer<CanvasRenderingContext2D> m_dispatchContextRestoredEventTimer; | 303 Timer<CanvasRenderingContext2D> m_dispatchContextRestoredEventTimer; |
| 302 Timer<CanvasRenderingContext2D> m_tryRestoreContextEventTimer; | 304 Timer<CanvasRenderingContext2D> m_tryRestoreContextEventTimer; |
| 303 }; | 305 }; |
| 304 | 306 |
| 305 DEFINE_TYPE_CASTS(CanvasRenderingContext2D, CanvasRenderingContext, context, con
text->is2d(), context.is2d()); | 307 DEFINE_TYPE_CASTS(CanvasRenderingContext2D, CanvasRenderingContext, context, con
text->is2d(), context.is2d()); |
| 306 | 308 |
| 307 } // namespace blink | 309 } // namespace blink |
| 308 | 310 |
| 309 #endif // CanvasRenderingContext2D_h | 311 #endif // CanvasRenderingContext2D_h |
| OLD | NEW |