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

Side by Side Diff: Source/modules/canvas2d/CanvasRenderingContext2D.h

Issue 1297663002: Eliminate deferral overhead with canvas to canvas draws (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: git cl web Created 5 years, 4 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 void setShadow(const FloatSize& offset, float blur, RGBA32 color); 235 void setShadow(const FloatSize& offset, float blur, RGBA32 color);
236 236
237 void dispatchContextLostEvent(Timer<CanvasRenderingContext2D>*); 237 void dispatchContextLostEvent(Timer<CanvasRenderingContext2D>*);
238 void dispatchContextRestoredEvent(Timer<CanvasRenderingContext2D>*); 238 void dispatchContextRestoredEvent(Timer<CanvasRenderingContext2D>*);
239 void tryRestoreContextEvent(Timer<CanvasRenderingContext2D>*); 239 void tryRestoreContextEvent(Timer<CanvasRenderingContext2D>*);
240 240
241 bool computeDirtyRect(const FloatRect& localBounds, SkIRect*); 241 bool computeDirtyRect(const FloatRect& localBounds, SkIRect*);
242 bool computeDirtyRect(const FloatRect& localBounds, const SkIRect& transform edClipBounds, SkIRect*); 242 bool computeDirtyRect(const FloatRect& localBounds, const SkIRect& transform edClipBounds, SkIRect*);
243 void didDraw(const SkIRect&); 243 void didDraw(const SkIRect&);
244 244
245 enum CanvasDeferralMode { 245 SkCanvas* drawingCanvas() const;
246 AllowDeferredCanvas,
247 ForceImmediateCanvas,
248 };
249
250 SkCanvas* drawingCanvas(CanvasDeferralMode = AllowDeferredCanvas) const;
251 246
252 void unwindStateStack(); 247 void unwindStateStack();
253 void realizeSaves(); 248 void realizeSaves();
254 249
255 void pruneLocalFontCache(size_t targetSize); 250 void pruneLocalFontCache(size_t targetSize);
256 void schedulePruneLocalFontCacheIfNeeded(); 251 void schedulePruneLocalFontCacheIfNeeded();
257 252
258 bool shouldDrawImageAntialiased(const FloatRect& destRect) const; 253 bool shouldDrawImageAntialiased(const FloatRect& destRect) const;
259 254
260 template<typename DrawFunc, typename ContainsFunc> 255 template<typename DrawFunc, typename ContainsFunc>
261 bool draw(const DrawFunc&, const ContainsFunc&, CanvasDeferralMode, const Sk Rect& bounds, CanvasRenderingContext2DState::PaintType, CanvasRenderingContext2D State::ImageType = CanvasRenderingContext2DState::NoImage); 256 bool draw(const DrawFunc&, const ContainsFunc&, const SkRect& bounds, Canvas RenderingContext2DState::PaintType, CanvasRenderingContext2DState::ImageType = C anvasRenderingContext2DState::NoImage);
262 void drawPathInternal(const Path&, CanvasRenderingContext2DState::PaintType, SkPath::FillType = SkPath::kWinding_FillType); 257 void drawPathInternal(const Path&, CanvasRenderingContext2DState::PaintType, SkPath::FillType = SkPath::kWinding_FillType);
263 void drawImageInternal(SkCanvas*, CanvasImageSource*, Image*, const FloatRec t& srcRect, const FloatRect& dstRect, const SkPaint*); 258 void drawImageInternal(SkCanvas*, CanvasImageSource*, Image*, const FloatRec t& srcRect, const FloatRect& dstRect, const SkPaint*);
264 void clipInternal(const Path&, const String& windingRuleString); 259 void clipInternal(const Path&, const String& windingRuleString);
265 260
266 bool isPointInPathInternal(const Path&, const float x, const float y, const String& windingRuleString); 261 bool isPointInPathInternal(const Path&, const float x, const float y, const String& windingRuleString);
267 bool isPointInStrokeInternal(const Path&, const float x, const float y); 262 bool isPointInStrokeInternal(const Path&, const float x, const float y);
268 263
269 void scrollPathIntoViewInternal(const Path&); 264 void scrollPathIntoViewInternal(const Path&);
270 265
271 void drawTextInternal(const String&, float x, float y, CanvasRenderingContex t2DState::PaintType, float* maxWidth = nullptr); 266 void drawTextInternal(const String&, float x, float y, CanvasRenderingContex t2DState::PaintType, float* maxWidth = nullptr);
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 HashMap<String, Font> m_fontsResolvedUsingCurrentStyle; 316 HashMap<String, Font> m_fontsResolvedUsingCurrentStyle;
322 bool m_pruneLocalFontCacheScheduled; 317 bool m_pruneLocalFontCacheScheduled;
323 ListHashSet<String> m_fontLRUList; 318 ListHashSet<String> m_fontLRUList;
324 }; 319 };
325 320
326 DEFINE_TYPE_CASTS(CanvasRenderingContext2D, CanvasRenderingContext, context, con text->is2d(), context.is2d()); 321 DEFINE_TYPE_CASTS(CanvasRenderingContext2D, CanvasRenderingContext, context, con text->is2d(), context.is2d());
327 322
328 } // namespace blink 323 } // namespace blink
329 324
330 #endif // CanvasRenderingContext2D_h 325 #endif // CanvasRenderingContext2D_h
OLDNEW
« no previous file with comments | « Source/core/html/HTMLCanvasElement.cpp ('k') | Source/modules/canvas2d/CanvasRenderingContext2D.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698