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 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 void drawTextInternal(const String& text, float x, float y, bool fill, float
maxWidth = 0, bool useMaxWidth = false); | 321 void drawTextInternal(const String& text, float x, float y, bool fill, float
maxWidth = 0, bool useMaxWidth = false); |
322 | 322 |
323 const Font& accessFont(); | 323 const Font& accessFont(); |
324 int getFontBaseline(const FontMetrics&) const; | 324 int getFontBaseline(const FontMetrics&) const; |
325 | 325 |
326 void clearCanvas(); | 326 void clearCanvas(); |
327 bool rectContainsTransformedRect(const FloatRect&, const FloatRect&) const; | 327 bool rectContainsTransformedRect(const FloatRect&, const FloatRect&) const; |
328 | 328 |
329 void inflateStrokeRect(FloatRect&) const; | 329 void inflateStrokeRect(FloatRect&) const; |
330 | 330 |
331 template<class T> void fullCanvasCompositedFill(const T&); | 331 struct StrokePathFunctor { |
| 332 void operator()(const Path& path, GraphicsContext* context) |
| 333 { |
| 334 context->strokePath(path); |
| 335 } |
| 336 }; |
| 337 |
| 338 struct StrokeRectFunctor { |
| 339 void operator()(const FloatRect& rect, GraphicsContext* context) |
| 340 { |
| 341 context->strokeRect(rect); |
| 342 } |
| 343 }; |
| 344 |
| 345 struct FillPathFunctor { |
| 346 void operator()(const Path& path, GraphicsContext* context) |
| 347 { |
| 348 context->fillPath(path); |
| 349 } |
| 350 }; |
| 351 |
| 352 struct FillRectFunctor { |
| 353 void operator()(const FloatRect& rect, GraphicsContext* context) |
| 354 { |
| 355 context->fillRect(rect); |
| 356 } |
| 357 }; |
| 358 |
| 359 template<class T, class Functor> void fullCanvasComposited(const T&, Functor
); |
332 template<class T> void fullCanvasCompositedDrawImage(T*, const FloatRect&, c
onst FloatRect&, CompositeOperator); | 360 template<class T> void fullCanvasCompositedDrawImage(T*, const FloatRect&, c
onst FloatRect&, CompositeOperator); |
333 | 361 |
334 bool focusRingCallIsValid(const Path&, Element*); | 362 bool focusRingCallIsValid(const Path&, Element*); |
335 void updateFocusRingAccessibility(const Path&, Element*); | 363 void updateFocusRingAccessibility(const Path&, Element*); |
336 void drawFocusRing(const Path&); | 364 void drawFocusRing(const Path&); |
337 | 365 |
338 virtual bool is2d() const OVERRIDE { return true; } | 366 virtual bool is2d() const OVERRIDE { return true; } |
339 virtual bool isAccelerated() const OVERRIDE; | 367 virtual bool isAccelerated() const OVERRIDE; |
340 virtual bool hasAlpha() const OVERRIDE { return m_hasAlpha; } | 368 virtual bool hasAlpha() const OVERRIDE { return m_hasAlpha; } |
341 | 369 |
(...skipping 14 matching lines...) Expand all Loading... |
356 Timer<CanvasRenderingContext2D> m_dispatchContextLostEventTimer; | 384 Timer<CanvasRenderingContext2D> m_dispatchContextLostEventTimer; |
357 Timer<CanvasRenderingContext2D> m_dispatchContextRestoredEventTimer; | 385 Timer<CanvasRenderingContext2D> m_dispatchContextRestoredEventTimer; |
358 Timer<CanvasRenderingContext2D> m_tryRestoreContextEventTimer; | 386 Timer<CanvasRenderingContext2D> m_tryRestoreContextEventTimer; |
359 }; | 387 }; |
360 | 388 |
361 DEFINE_TYPE_CASTS(CanvasRenderingContext2D, CanvasRenderingContext, context, con
text->is2d(), context.is2d()); | 389 DEFINE_TYPE_CASTS(CanvasRenderingContext2D, CanvasRenderingContext, context, con
text->is2d(), context.is2d()); |
362 | 390 |
363 } // namespace WebCore | 391 } // namespace WebCore |
364 | 392 |
365 #endif | 393 #endif |
OLD | NEW |