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 |