Index: src/gpu/SkGpuDevice.cpp |
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp |
index 3a0d6f4e3a3fcd9f5c006c5483b6cd4474308111..3f08aa4def073d422e2afc1ab1e9e5c3a8a02857 100644 |
--- a/src/gpu/SkGpuDevice.cpp |
+++ b/src/gpu/SkGpuDevice.cpp |
@@ -68,7 +68,7 @@ enum { kDefaultImageFilterCacheSize = 32 * 1024 * 1024 }; |
#define DO_DEFERRED_CLEAR() \ |
do { \ |
if (fFlags & kNeedClear_Flag) { \ |
- this->clearAll(); \ |
+ this->clear(SK_ColorTRANSPARENT); \ |
} \ |
} while (false) \ |
@@ -294,14 +294,6 @@ GrRenderTarget* SkGpuDevice::accessRenderTarget() { |
return fRenderTarget; |
} |
-void SkGpuDevice::clearAll() { |
- GrColor color = 0; |
- GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::clearAll", fContext); |
- SkIRect rect = SkIRect::MakeWH(this->width(), this->height()); |
- fContext->clear(&rect, color, true, fRenderTarget); |
- fFlags &= ~kNeedClear_Flag; |
-} |
- |
/////////////////////////////////////////////////////////////////////////////// |
SK_COMPILE_ASSERT(SkShader::kNone_BitmapType == 0, shader_type_mismatch); |
@@ -317,6 +309,13 @@ SK_COMPILE_ASSERT(SkShader::kLast_BitmapType == 6, shader_type_mismatch); |
/////////////////////////////////////////////////////////////////////////////// |
+void SkGpuDevice::clear(SkColor color) { |
+ GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::clear", fContext); |
+ SkIRect rect = SkIRect::MakeWH(this->width(), this->height()); |
+ fContext->clear(&rect, SkColor2GrColor(color), true, fRenderTarget); |
+ fFlags &= ~kNeedClear_Flag; |
+} |
+ |
void SkGpuDevice::drawPaint(const SkDraw& draw, const SkPaint& paint) { |
CHECK_SHOULD_DRAW(draw, false); |
GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawPaint", fContext); |
@@ -1515,7 +1514,7 @@ void SkGpuDevice::drawDevice(const SkDraw& draw, SkBaseDevice* device, |
SkGpuDevice* dev = static_cast<SkGpuDevice*>(device); |
if (dev->fFlags & kNeedClear_Flag) { |
// TODO: could check here whether we really need to draw at all |
- dev->clearAll(); |
+ dev->clear(0x0); |
} |
// drawDevice is defined to be in device coords. |