Chromium Code Reviews| 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* canvas) | |
|
Stephen White
2014/07/09 20:04:07
Nit: probably no reason for this to be inlined. I'
Justin Novosad
2014/07/11 21:16:07
Done.
| |
| 100 { | |
| 101 ASSERT(canvas); | |
| 102 m_canvas = canvas; | |
| 103 m_opaqueRegion.reset(); | |
| 104 } | |
| 105 | |
| 98 bool paintingDisabled() const { return m_disabledState & PaintingDisabled; } | 106 bool paintingDisabled() const { return m_disabledState & PaintingDisabled; } |
| 99 bool contextDisabled() const { return m_disabledState; } | 107 bool contextDisabled() const { return m_disabledState; } |
| 100 | 108 |
| 101 // This is just a heuristic that currently happens to work. We need either | 109 // 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 | 110 // 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 | 111 // to obviate the need for this query, and address whatever the caller |
| 104 // needed in some other way. | 112 // needed in some other way. |
| 105 // See bug# 372110 | 113 // See bug# 372110 |
| 106 bool isRecordingCanvas() const | 114 bool isRecordingCanvas() const |
| 107 { | 115 { |
| (...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); | 292 void drawImage(Image*, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator, blink::WebBlendMode, RespectImageOrientationEnum = DoNotRespe ctImageOrientation); |
| 285 | 293 |
| 286 void drawTiledImage(Image*, const IntRect& destRect, const IntPoint& srcPoin t, const IntSize& tileSize, | 294 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()); | 295 CompositeOperator = CompositeSourceOver, blink::WebBlendMode = blink::We bBlendModeNormal, const IntSize& repeatSpacing = IntSize()); |
| 288 void drawTiledImage(Image*, const IntRect& destRect, const IntRect& srcRect, | 296 void drawTiledImage(Image*, const IntRect& destRect, const IntRect& srcRect, |
| 289 const FloatSize& tileScaleFactor, Image::TileRule hRule = Image::Stretch Tile, Image::TileRule vRule = Image::StretchTile, | 297 const FloatSize& tileScaleFactor, Image::TileRule hRule = Image::Stretch Tile, Image::TileRule vRule = Image::StretchTile, |
| 290 CompositeOperator = CompositeSourceOver); | 298 CompositeOperator = CompositeSourceOver); |
| 291 | 299 |
| 292 void drawImageBuffer(ImageBuffer*, const FloatRect& destRect, const FloatRec t* srcRect = 0, CompositeOperator = CompositeSourceOver); | 300 void drawImageBuffer(ImageBuffer*, const FloatRect& destRect, const FloatRec t* srcRect = 0, CompositeOperator = CompositeSourceOver); |
| 293 | 301 |
| 302 void drawPicture(PassRefPtr<SkPicture>, const FloatRect& dest, const FloatRe ct& src, CompositeOperator, blink::WebBlendMode); | |
| 303 | |
| 294 // These methods write to the canvas and modify the opaque region, if tracke d. | 304 // 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 | 305 // 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); | 306 void writePixels(const SkImageInfo&, const void* pixels, size_t rowBytes, in t x, int y); |
| 297 void writePixels(const SkBitmap&, int x, int y); | 307 void writePixels(const SkBitmap&, int x, int y); |
| 298 void drawBitmap(const SkBitmap&, SkScalar, SkScalar, const SkPaint* = 0); | 308 void drawBitmap(const SkBitmap&, SkScalar, SkScalar, const SkPaint* = 0); |
| 299 void drawBitmapRect(const SkBitmap&, const SkRect*, const SkRect&, const SkP aint* = 0); | 309 void drawBitmapRect(const SkBitmap&, const SkRect*, const SkRect&, const SkP aint* = 0); |
| 300 void drawOval(const SkRect&, const SkPaint&); | 310 void drawOval(const SkRect&, const SkPaint&); |
| 301 void drawPath(const SkPath&, const SkPaint&); | 311 void drawPath(const SkPath&, const SkPaint&); |
| 302 // After drawing directly to the context's canvas, use this function to noti fy the context so | 312 // After drawing directly to the context's canvas, use this function to noti fy the context so |
| 303 // it can track the opaque region. | 313 // it can track the opaque region. |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 523 bool m_updatingControlTints : 1; | 533 bool m_updatingControlTints : 1; |
| 524 bool m_accelerated : 1; | 534 bool m_accelerated : 1; |
| 525 bool m_isCertainlyOpaque : 1; | 535 bool m_isCertainlyOpaque : 1; |
| 526 bool m_printing : 1; | 536 bool m_printing : 1; |
| 527 bool m_antialiasHairlineImages : 1; | 537 bool m_antialiasHairlineImages : 1; |
| 528 }; | 538 }; |
| 529 | 539 |
| 530 } // namespace WebCore | 540 } // namespace WebCore |
| 531 | 541 |
| 532 #endif // GraphicsContext_h | 542 #endif // GraphicsContext_h |
| OLD | NEW |