Do not clear the source device in SkGpuDevice::drawDevice
Do not clear the source device in SkGpuDevice::drawDevice based on
the status whether the destination device needs a clear.
Source device clear is flushed in SkGpuDevice::accessRenderTarget()
and target device clear is flushed in CHECK_SHOULD_DRAW(draw).
Review URL: https://codereview.chromium.org/943623002
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 630755b..9760968 100644
--- a/src/gpu/SkGpuDevice.cpp
+++ b/src/gpu/SkGpuDevice.cpp
@@ -1544,10 +1544,10 @@
// clear of the source device must occur before CHECK_SHOULD_DRAW
GR_CREATE_TRACE_MARKER_CONTEXT("SkGpuDevice::drawDevice", fContext);
SkGpuDevice* dev = static_cast<SkGpuDevice*>(device);
- if (fNeedClear) {
- // TODO: could check here whether we really need to draw at all
- dev->clearAll();
- }
+
+ // TODO: If the source device covers the whole of this device, we could
+ // omit fNeedsClear -related flushing.
+ // TODO: if source needs clear, we could maybe omit the draw fully.
// drawDevice is defined to be in device coords.
CHECK_SHOULD_DRAW(draw);