rename SkDevice::eraseColor to clear and make virtual.
Properly flush in GrContext before calling GrGpu::clear()
Review URL: http://codereview.appspot.com/4419043/
git-svn-id: http://skia.googlecode.com/svn/trunk@1130 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/core/SkDevice.cpp b/src/core/SkDevice.cpp
index 69d0c1c..6305e19 100644
--- a/src/core/SkDevice.cpp
+++ b/src/core/SkDevice.cpp
@@ -65,8 +65,8 @@
return sect ? sect->intersect(r, bounds) : SkIRect::Intersects(r, bounds);
}
-void SkDevice::eraseColor(SkColor eraseColor) {
- fBitmap.eraseColor(eraseColor);
+void SkDevice::clear(SkColor color) {
+ fBitmap.eraseColor(color);
}
void SkDevice::onAccessBitmap(SkBitmap* bitmap) {}
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 723c635..f89d4b1 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -323,7 +323,7 @@
convert_matrixclip(fContext, matrix, clipStack, clip, this->getOrigin());
if (fNeedClear) {
- fContext->eraseColor(0x0);
+ fContext->clear(0x0);
fNeedClear = false;
}
}
@@ -591,6 +591,10 @@
///////////////////////////////////////////////////////////////////////////////
+void SkGpuDevice::clear(SkColor color) {
+ fContext->clear(color);
+}
+
void SkGpuDevice::drawPaint(const SkDraw& draw, const SkPaint& paint) {
CHECK_SHOULD_DRAW(draw);