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

Unified Diff: include/core/SkCanvas.h

Issue 778563002: Revert "Change clear() to respect the clip" (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/core/SkBitmapDevice.h ('k') | include/core/SkDevice.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkCanvas.h
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h
index ee539c4244864072ac25be34f06c1b01d2d189f0..0685b6a8e66dcd08a9081e9ac854debccad10589 100644
--- a/include/core/SkCanvas.h
+++ b/include/core/SkCanvas.h
@@ -619,12 +619,24 @@ public:
@param color the color to draw with
@param mode the mode to apply the color in (defaults to SrcOver)
*/
- void drawColor(SkColor color, SkXfermode::Mode mode = SkXfermode::kSrcOver_Mode);
+ void drawColor(SkColor color,
+ SkXfermode::Mode mode = SkXfermode::kSrcOver_Mode);
- // TODO: remove virtual when chrome subclass stop overriding this.
- virtual void clear(SkColor color) {
- this->drawColor(color, SkXfermode::kSrc_Mode);
- }
+ /**
+ * This erases the entire drawing surface to the specified color,
+ * irrespective of the clip. It does not blend with the previous pixels,
+ * but always overwrites them.
+ *
+ * It is roughly equivalent to the following:
+ * canvas.save();
+ * canvas.clipRect(hugeRect, kReplace_Op);
+ * paint.setColor(color);
+ * paint.setXfermodeMode(kSrc_Mode);
+ * canvas.drawPaint(paint);
+ * canvas.restore();
+ * though it is almost always much more efficient.
+ */
+ virtual void clear(SkColor);
/**
* This makes the contents of the canvas undefined. Subsequent calls that
« no previous file with comments | « include/core/SkBitmapDevice.h ('k') | include/core/SkDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698