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

Side by Side Diff: Source/platform/graphics/GraphicsContext.h

Issue 379253002: Initial implementation of display list backed 2D canvases (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebased Created 6 years, 5 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
« no previous file with comments | « Source/platform/blink_platform.gypi ('k') | Source/platform/graphics/GraphicsContext.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 void drawImage(Image*, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator, blink::WebBlendMode, RespectImageOrientationEnum = DoNotRespe ctImageOrientation); 288 void drawImage(Image*, const FloatRect& destRect, const FloatRect& srcRect, CompositeOperator, blink::WebBlendMode, RespectImageOrientationEnum = DoNotRespe ctImageOrientation);
286 289
287 void drawTiledImage(Image*, const IntRect& destRect, const IntPoint& srcPoin t, const IntSize& tileSize, 290 void drawTiledImage(Image*, const IntRect& destRect, const IntPoint& srcPoin t, const IntSize& tileSize,
288 CompositeOperator = CompositeSourceOver, blink::WebBlendMode = blink::We bBlendModeNormal, const IntSize& repeatSpacing = IntSize()); 291 CompositeOperator = CompositeSourceOver, blink::WebBlendMode = blink::We bBlendModeNormal, const IntSize& repeatSpacing = IntSize());
289 void drawTiledImage(Image*, const IntRect& destRect, const IntRect& srcRect, 292 void drawTiledImage(Image*, const IntRect& destRect, const IntRect& srcRect,
290 const FloatSize& tileScaleFactor, Image::TileRule hRule = Image::Stretch Tile, Image::TileRule vRule = Image::StretchTile, 293 const FloatSize& tileScaleFactor, Image::TileRule hRule = Image::Stretch Tile, Image::TileRule vRule = Image::StretchTile,
291 CompositeOperator = CompositeSourceOver); 294 CompositeOperator = CompositeSourceOver);
292 295
293 void drawImageBuffer(ImageBuffer*, const FloatRect& destRect, const FloatRec t* srcRect = 0, CompositeOperator = CompositeSourceOver); 296 void drawImageBuffer(ImageBuffer*, const FloatRect& destRect, const FloatRec t* srcRect = 0, CompositeOperator = CompositeSourceOver);
294 297
298 void drawPicture(PassRefPtr<SkPicture>, const FloatRect& dest, const FloatRe ct& src, CompositeOperator, blink::WebBlendMode);
299
295 // These methods write to the canvas and modify the opaque region, if tracke d. 300 // These methods write to the canvas and modify the opaque region, if tracke d.
296 // Also drawLine(const IntPoint& point1, const IntPoint& point2) and fillRou ndedRect 301 // Also drawLine(const IntPoint& point1, const IntPoint& point2) and fillRou ndedRect
297 void writePixels(const SkImageInfo&, const void* pixels, size_t rowBytes, in t x, int y); 302 void writePixels(const SkImageInfo&, const void* pixels, size_t rowBytes, in t x, int y);
298 void writePixels(const SkBitmap&, int x, int y); 303 void writePixels(const SkBitmap&, int x, int y);
299 void drawBitmap(const SkBitmap&, SkScalar, SkScalar, const SkPaint* = 0); 304 void drawBitmap(const SkBitmap&, SkScalar, SkScalar, const SkPaint* = 0);
300 void drawBitmapRect(const SkBitmap&, const SkRect*, const SkRect&, const SkP aint* = 0); 305 void drawBitmapRect(const SkBitmap&, const SkRect*, const SkRect&, const SkP aint* = 0);
301 void drawOval(const SkRect&, const SkPaint&); 306 void drawOval(const SkRect&, const SkPaint&);
302 void drawPath(const SkPath&, const SkPaint&); 307 void drawPath(const SkPath&, const SkPaint&);
303 // After drawing directly to the context's canvas, use this function to noti fy the context so 308 // After drawing directly to the context's canvas, use this function to noti fy the context so
304 // it can track the opaque region. 309 // it can track the opaque region.
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 bool m_updatingControlTints : 1; 529 bool m_updatingControlTints : 1;
525 bool m_accelerated : 1; 530 bool m_accelerated : 1;
526 bool m_isCertainlyOpaque : 1; 531 bool m_isCertainlyOpaque : 1;
527 bool m_printing : 1; 532 bool m_printing : 1;
528 bool m_antialiasHairlineImages : 1; 533 bool m_antialiasHairlineImages : 1;
529 }; 534 };
530 535
531 } // namespace blink 536 } // namespace blink
532 537
533 #endif // GraphicsContext_h 538 #endif // GraphicsContext_h
OLDNEW
« no previous file with comments | « Source/platform/blink_platform.gypi ('k') | Source/platform/graphics/GraphicsContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698