diff options
author | Robert Phillips <robertphillips@google.com> | 2016-11-23 19:37:13 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-11-25 21:36:00 +0000 |
commit | 93f1633abca95e302fdd31ece0f4d602b0b26708 (patch) | |
tree | 6748ace1f1f7fc629e29511e22ffe96e023432b8 /src/gpu/GrRenderTargetContext.cpp | |
parent | 58cda8fa495225bbcb3d93bdd7f81ec515402475 (diff) |
Fix gpu blurring on platforms that "useDrawInsteadOfClear"
Platforms that "useDrawInsteadOfClear" take a different path in
GrRenderTargetContext::internalClear. The different path involves
a lot of comparisons of the drawn rect with the bounds of the RenderTarget. Since the RenderTargets are now deferred (and the instantiated version might be larger than the proxied size) case must be taken in prematurely optimizing away clears and draws.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=5148
TBR=bsalomon@google.com
Change-Id: If63b6393fb66328175bc92de211e7242e903f25e
Reviewed-on: https://skia-review.googlesource.com/5148
Reviewed-by: Robert Phillips <robertphillips@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrRenderTargetContext.cpp')
-rw-r--r-- | src/gpu/GrRenderTargetContext.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp index f08f39a1be..8cc6dd9c49 100644 --- a/src/gpu/GrRenderTargetContext.cpp +++ b/src/gpu/GrRenderTargetContext.cpp @@ -254,10 +254,10 @@ void GrRenderTargetContext::internalClear(const GrFixedClip& clip, // This works around a driver bug with clear by drawing a rect instead. // The driver will ignore a clear if it is the only thing rendered to a // target before the target is read. - SkRect clearRect = SkRect::MakeIWH(this->width(), this->height()); + SkIRect clearRect = SkIRect::MakeWH(this->worstCaseWidth(), this->worstCaseHeight()); if (isFull) { this->discard(); - } else if (!clearRect.intersect(SkRect::Make(clip.scissorRect()))) { + } else if (!clearRect.intersect(clip.scissorRect())) { return; } @@ -265,7 +265,7 @@ void GrRenderTargetContext::internalClear(const GrFixedClip& clip, paint.setColor4f(GrColor4f::FromGrColor(color)); paint.setXPFactory(GrPorterDuffXPFactory::Make(SkBlendMode::kSrc)); - this->drawRect(clip, paint, SkMatrix::I(), clearRect); + this->drawRect(clip, paint, SkMatrix::I(), SkRect::Make(clearRect)); } else if (isFull) { if (this->accessRenderTarget()) { this->getOpList()->fullClear(this->accessRenderTarget(), color); @@ -415,7 +415,8 @@ bool GrRenderTargetContext::drawFilledRect(const GrClip& clip, const SkRect& rect, const GrUserStencilSettings* ss) { SkRect croppedRect = rect; - if (!crop_filled_rect(this->width(), this->height(), clip, viewMatrix, &croppedRect)) { + if (!crop_filled_rect(this->worstCaseWidth(), this->worstCaseHeight(), + clip, viewMatrix, &croppedRect)) { return true; } |