Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Side by Side Diff: Source/core/html/canvas/CanvasRenderingContext2D.h

Issue 1093673002: Removing the dependency on GraphicsContext for drawing images in 2D canvas (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 215
216 private: 216 private:
217 friend class CanvasRenderingContext2DAutoRestoreSkCanvas; 217 friend class CanvasRenderingContext2DAutoRestoreSkCanvas;
218 218
219 CanvasRenderingContext2D(HTMLCanvasElement*, const CanvasContextCreationAttr ibutes& attrs, Document&); 219 CanvasRenderingContext2D(HTMLCanvasElement*, const CanvasContextCreationAttr ibutes& attrs, Document&);
220 220
221 CanvasRenderingContext2DState& modifiableState(); 221 CanvasRenderingContext2DState& modifiableState();
222 const CanvasRenderingContext2DState& state() const { return *m_stateStack.la st(); } 222 const CanvasRenderingContext2DState& state() const { return *m_stateStack.la st(); }
223 223
224 void setShadow(const FloatSize& offset, float blur, RGBA32 color); 224 void setShadow(const FloatSize& offset, float blur, RGBA32 color);
225 void applyShadow(ShadowMode = DrawShadowAndForeground);
226 225
227 void dispatchContextLostEvent(Timer<CanvasRenderingContext2D>*); 226 void dispatchContextLostEvent(Timer<CanvasRenderingContext2D>*);
228 void dispatchContextRestoredEvent(Timer<CanvasRenderingContext2D>*); 227 void dispatchContextRestoredEvent(Timer<CanvasRenderingContext2D>*);
229 void tryRestoreContextEvent(Timer<CanvasRenderingContext2D>*); 228 void tryRestoreContextEvent(Timer<CanvasRenderingContext2D>*);
230 229
231 bool computeDirtyRect(const FloatRect& localBounds, SkIRect*); 230 bool computeDirtyRect(const FloatRect& localBounds, SkIRect*);
232 bool computeDirtyRect(const FloatRect& localBounds, const SkIRect& transform edClipBounds, SkIRect*); 231 bool computeDirtyRect(const FloatRect& localBounds, const SkIRect& transform edClipBounds, SkIRect*);
233 void didDraw(const SkIRect&); 232 void didDraw(const SkIRect&);
234 233
235 GraphicsContext* drawingContext() const; // Deprecated: use drawingCanvas
236 SkCanvas* drawingCanvas() const; 234 SkCanvas* drawingCanvas() const;
237 235
238 void unwindStateStack(); 236 void unwindStateStack();
239 void realizeSaves(SkCanvas*); 237 void realizeSaves();
240 238
241 template<typename DrawFunc, typename ContainsFunc> 239 template<typename DrawFunc, typename ContainsFunc>
242 bool draw(const DrawFunc&, const ContainsFunc&, const SkRect& bounds, Canvas RenderingContext2DState::PaintType, CanvasRenderingContext2DState::ImageType = C anvasRenderingContext2DState::NoImage); 240 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); 241 void drawPathInternal(const Path&, CanvasRenderingContext2DState::PaintType, SkPath::FillType = SkPath::kWinding_FillType);
244 void drawImageOnContext(CanvasImageSource*, Image*, const FloatRect& srcRect , const FloatRect& dstRect, const SkPaint*); 242 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); 243 void clipInternal(const Path&, const String& windingRuleString);
247 244
248 bool isPointInPathInternal(const Path&, const float x, const float y, const String& windingRuleString); 245 bool isPointInPathInternal(const Path&, const float x, const float y, const String& windingRuleString);
249 bool isPointInStrokeInternal(const Path&, const float x, const float y); 246 bool isPointInStrokeInternal(const Path&, const float x, const float y);
250 247
251 void scrollPathIntoViewInternal(const Path&); 248 void scrollPathIntoViewInternal(const Path&);
252 249
253 void drawTextInternal(const String&, float x, float y, CanvasRenderingContex t2DState::PaintType, float* maxWidth = nullptr); 250 void drawTextInternal(const String&, float x, float y, CanvasRenderingContex t2DState::PaintType, float* maxWidth = nullptr);
254 251
255 const Font& accessFont(); 252 const Font& accessFont();
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 Timer<CanvasRenderingContext2D> m_dispatchContextLostEventTimer; 297 Timer<CanvasRenderingContext2D> m_dispatchContextLostEventTimer;
301 Timer<CanvasRenderingContext2D> m_dispatchContextRestoredEventTimer; 298 Timer<CanvasRenderingContext2D> m_dispatchContextRestoredEventTimer;
302 Timer<CanvasRenderingContext2D> m_tryRestoreContextEventTimer; 299 Timer<CanvasRenderingContext2D> m_tryRestoreContextEventTimer;
303 }; 300 };
304 301
305 DEFINE_TYPE_CASTS(CanvasRenderingContext2D, CanvasRenderingContext, context, con text->is2d(), context.is2d()); 302 DEFINE_TYPE_CASTS(CanvasRenderingContext2D, CanvasRenderingContext, context, con text->is2d(), context.is2d());
306 303
307 } // namespace blink 304 } // namespace blink
308 305
309 #endif // CanvasRenderingContext2D_h 306 #endif // CanvasRenderingContext2D_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698