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

Unified Diff: src/gpu/batches/GrClearBatch.h

Issue 1658823002: Remove deferred clear from SkGpuDevice (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix ptr->bool warning on windows Created 4 years, 10 months 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.cpp ('k') | src/gpu/gl/GrGLGpu.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/batches/GrClearBatch.h
diff --git a/src/gpu/batches/GrClearBatch.h b/src/gpu/batches/GrClearBatch.h
index c38372c1e25490209777fc6fd31803d9b0f4599f..ba4b6d6daeabe94baa4ca052a3247026de9d0094 100644
--- a/src/gpu/batches/GrClearBatch.h
+++ b/src/gpu/batches/GrClearBatch.h
@@ -40,7 +40,19 @@ public:
private:
bool onCombineIfPossible(GrBatch* t, const GrCaps& caps) override {
- // We could combine clears. TBD how much complexity to put here.
+ // This could be much more complicated. Currently we look at cases where the new clear
+ // contains the old clear, or when the new clear is a subset of the old clear and is the
+ // same color.
+ GrClearBatch* cb = t->cast<GrClearBatch>();
+ SkASSERT(cb->fRenderTarget == fRenderTarget);
+ if (cb->fRect.contains(fRect)) {
+ fRect = cb->fRect;
+ fBounds = cb->fBounds;
+ fColor = cb->fColor;
+ return true;
+ } else if (cb->fColor == fColor && fRect.contains(cb->fRect)) {
+ return true;
+ }
return false;
}
« no previous file with comments | « src/gpu/SkGpuDevice.cpp ('k') | src/gpu/gl/GrGLGpu.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698