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

Unified Diff: src/gpu/gl/GrGLGpu.cpp

Issue 1275543005: Move some work from backend onClear to base class clear (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Pass references and rebase Created 5 years, 4 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/gl/GrGLGpu.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLGpu.cpp
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index faee922ac5b14533e0d1d412b9dbc0e0de5f4feb..ec95557655b55739aa9d4f7cc0e2c964cecfa996 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -1569,33 +1569,14 @@ void GrGLGpu::disableScissor() {
}
}
-void GrGLGpu::onClear(GrRenderTarget* target, const SkIRect* rect, GrColor color,
- bool canIgnoreRect) {
+void GrGLGpu::onClear(GrRenderTarget* target, const SkIRect& rect, GrColor color) {
// parent class should never let us get here with no RT
SkASSERT(target);
GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(target);
- if (canIgnoreRect && this->glCaps().fullClearIsFree()) {
- rect = NULL;
- }
-
- SkIRect clippedRect;
- if (rect) {
- // flushScissor expects rect to be clipped to the target.
- clippedRect = *rect;
- SkIRect rtRect = SkIRect::MakeWH(target->width(), target->height());
- if (clippedRect.intersect(rtRect)) {
- rect = &clippedRect;
- } else {
- return;
- }
- }
-
- this->flushRenderTarget(glRT, rect);
+ this->flushRenderTarget(glRT, &rect);
GrScissorState scissorState;
- if (rect) {
- scissorState.set(*rect);
- }
+ scissorState.set(rect);
this->flushScissor(scissorState, glRT->getViewport(), glRT->origin());
GrGLfloat r, g, b, a;
« no previous file with comments | « src/gpu/gl/GrGLGpu.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698