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

Unified Diff: src/gpu/SkGpuDevice.cpp

Issue 783493002: 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 | « src/gpu/SkGpuDevice.h ('k') | src/image/SkSurface_Gpu.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/SkGpuDevice.cpp
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp
index 407f36037da15ba96a2221e1cd0aef6787b567a2..f09ebf291f57d061cbc34ef654677a5b13dcf0df 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->clear(SK_ColorTRANSPARENT); \
+ this->clearAll(); \
} \
} while (false) \
@@ -294,6 +294,14 @@ 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);
@@ -309,13 +317,6 @@ 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);
@@ -1514,7 +1515,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->clear(0x0);
+ dev->clearAll();
}
// drawDevice is defined to be in device coords.
« no previous file with comments | « src/gpu/SkGpuDevice.h ('k') | src/image/SkSurface_Gpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698