diff options
author | 2015-08-06 10:54:13 -0700 | |
---|---|---|
committer | 2015-08-06 10:54:13 -0700 | |
commit | 51c8d409ad55a72eceb46ec7b65702d6d540aa4f (patch) | |
tree | 4b37a2800d5f057c7577988307e724d85c7a79c0 /src/gpu/gl/GrGLGpu.cpp | |
parent | b4f9d0ec6cc95ce46f9351fee5adaffcfa729e38 (diff) |
Move some work from backend onClear to base class clear
BUG=skia:
Review URL: https://codereview.chromium.org/1275543005
Diffstat (limited to 'src/gpu/gl/GrGLGpu.cpp')
-rw-r--r-- | src/gpu/gl/GrGLGpu.cpp | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index faee922ac5..ec95557655 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; |