OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2003, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. |
3 * Copyright (C) 2008-2009 Torch Mobile, Inc. | 3 * Copyright (C) 2008-2009 Torch Mobile, Inc. |
4 * Copyright (C) 2013 Google Inc. All rights reserved. | 4 * Copyright (C) 2013 Google Inc. All rights reserved. |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 // Flush any pending saves. | 88 // Flush any pending saves. |
89 realizeCanvasSave(); | 89 realizeCanvasSave(); |
90 | 90 |
91 return m_canvas; | 91 return m_canvas; |
92 } | 92 } |
93 const SkCanvas* canvas() const | 93 const SkCanvas* canvas() const |
94 { | 94 { |
95 ASSERT(!paintingDisabled()); | 95 ASSERT(!paintingDisabled()); |
96 return m_canvas; | 96 return m_canvas; |
97 } | 97 } |
| 98 |
| 99 void resetCanvas(SkCanvas*); |
| 100 |
98 bool paintingDisabled() const { return m_disabledState & PaintingDisabled; } | 101 bool paintingDisabled() const { return m_disabledState & PaintingDisabled; } |
99 bool contextDisabled() const { return m_disabledState; } | 102 bool contextDisabled() const { return m_disabledState; } |
100 | 103 |
101 // This is just a heuristic that currently happens to work. We need either | 104 // This is just a heuristic that currently happens to work. We need either |
102 // a more reliable way to know that we are recording, or (better) we need | 105 // a more reliable way to know that we are recording, or (better) we need |
103 // to obviate the need for this query, and address whatever the caller | 106 // to obviate the need for this query, and address whatever the caller |
104 // needed in some other way. | 107 // needed in some other way. |
105 // See bug# 372110 | 108 // See bug# 372110 |
106 bool isRecordingCanvas() const | 109 bool isRecordingCanvas() const |
107 { | 110 { |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 void drawImage(Image*, const FloatRect& destRect, const FloatRect& srcRect,
CompositeOperator, blink::WebBlendMode, RespectImageOrientationEnum = DoNotRespe
ctImageOrientation); | 287 void drawImage(Image*, const FloatRect& destRect, const FloatRect& srcRect,
CompositeOperator, blink::WebBlendMode, RespectImageOrientationEnum = DoNotRespe
ctImageOrientation); |
285 | 288 |
286 void drawTiledImage(Image*, const IntRect& destRect, const IntPoint& srcPoin
t, const IntSize& tileSize, | 289 void drawTiledImage(Image*, const IntRect& destRect, const IntPoint& srcPoin
t, const IntSize& tileSize, |
287 CompositeOperator = CompositeSourceOver, blink::WebBlendMode = blink::We
bBlendModeNormal, const IntSize& repeatSpacing = IntSize()); | 290 CompositeOperator = CompositeSourceOver, blink::WebBlendMode = blink::We
bBlendModeNormal, const IntSize& repeatSpacing = IntSize()); |
288 void drawTiledImage(Image*, const IntRect& destRect, const IntRect& srcRect, | 291 void drawTiledImage(Image*, const IntRect& destRect, const IntRect& srcRect, |
289 const FloatSize& tileScaleFactor, Image::TileRule hRule = Image::Stretch
Tile, Image::TileRule vRule = Image::StretchTile, | 292 const FloatSize& tileScaleFactor, Image::TileRule hRule = Image::Stretch
Tile, Image::TileRule vRule = Image::StretchTile, |
290 CompositeOperator = CompositeSourceOver); | 293 CompositeOperator = CompositeSourceOver); |
291 | 294 |
292 void drawImageBuffer(ImageBuffer*, const FloatRect& destRect, const FloatRec
t* srcRect = 0, CompositeOperator = CompositeSourceOver); | 295 void drawImageBuffer(ImageBuffer*, const FloatRect& destRect, const FloatRec
t* srcRect = 0, CompositeOperator = CompositeSourceOver); |
293 | 296 |
| 297 void drawPicture(PassRefPtr<SkPicture>, const FloatRect& dest, const FloatRe
ct& src, CompositeOperator, blink::WebBlendMode); |
| 298 |
294 // These methods write to the canvas and modify the opaque region, if tracke
d. | 299 // These methods write to the canvas and modify the opaque region, if tracke
d. |
295 // Also drawLine(const IntPoint& point1, const IntPoint& point2) and fillRou
ndedRect | 300 // Also drawLine(const IntPoint& point1, const IntPoint& point2) and fillRou
ndedRect |
296 void writePixels(const SkImageInfo&, const void* pixels, size_t rowBytes, in
t x, int y); | 301 void writePixels(const SkImageInfo&, const void* pixels, size_t rowBytes, in
t x, int y); |
297 void writePixels(const SkBitmap&, int x, int y); | 302 void writePixels(const SkBitmap&, int x, int y); |
298 void drawBitmap(const SkBitmap&, SkScalar, SkScalar, const SkPaint* = 0); | 303 void drawBitmap(const SkBitmap&, SkScalar, SkScalar, const SkPaint* = 0); |
299 void drawBitmapRect(const SkBitmap&, const SkRect*, const SkRect&, const SkP
aint* = 0); | 304 void drawBitmapRect(const SkBitmap&, const SkRect*, const SkRect&, const SkP
aint* = 0); |
300 void drawOval(const SkRect&, const SkPaint&); | 305 void drawOval(const SkRect&, const SkPaint&); |
301 void drawPath(const SkPath&, const SkPaint&); | 306 void drawPath(const SkPath&, const SkPaint&); |
302 // After drawing directly to the context's canvas, use this function to noti
fy the context so | 307 // After drawing directly to the context's canvas, use this function to noti
fy the context so |
303 // it can track the opaque region. | 308 // it can track the opaque region. |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 bool m_updatingControlTints : 1; | 528 bool m_updatingControlTints : 1; |
524 bool m_accelerated : 1; | 529 bool m_accelerated : 1; |
525 bool m_isCertainlyOpaque : 1; | 530 bool m_isCertainlyOpaque : 1; |
526 bool m_printing : 1; | 531 bool m_printing : 1; |
527 bool m_antialiasHairlineImages : 1; | 532 bool m_antialiasHairlineImages : 1; |
528 }; | 533 }; |
529 | 534 |
530 } // namespace WebCore | 535 } // namespace WebCore |
531 | 536 |
532 #endif // GraphicsContext_h | 537 #endif // GraphicsContext_h |
OLD | NEW |