diff options
author | 2017-04-01 01:53:59 +0000 | |
---|---|---|
committer | 2017-04-01 01:54:05 +0000 | |
commit | ec61785bbb989a1901b063923da30c04ed41332f (patch) | |
tree | 39e74b29ec1a34ff63fc347ba9b616186f435ff6 /src/gpu/GrRenderTargetContext.cpp | |
parent | 65c74f1368290551c60e4cd46e08ea1d6970b3d3 (diff) |
Revert "Respect kRectsMustMatchForMSAASrc_BlitFramebufferFlag in dst setup"
This reverts commit d58f040532f2f5a63d24bd17d7c588e52c0b99c3.
Reason for revert: tests/BlendTest is failing on the Nexus Player:
https://chromium-swarm.appspot.com/task?id=353ffc638e202210
https://chromium-swarm.appspot.com/task?id=353ff5e35819ab10
Original change's description:
> Respect kRectsMustMatchForMSAASrc_BlitFramebufferFlag in dst setup
>
> Crurently, when preparing a texture for blitFramebuffer, we ignore the
> kRectsMustMatchForMSAASrc_BlitFramebufferFlag, and may attempt to
> copy from one src rect to a different dst rect.
>
> This change updates initDescForDstCopy and setupDstTexture to allocate
> larger textures if necessary and accomodate this flags requirements.
>
> Bug: 658277
> Change-Id: I9f45a03d4055e0ad87c01e1d826287695096e609
> Reviewed-on: https://skia-review.googlesource.com/10941
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
>
TBR=bsalomon@google.com,ericrk@chromium.org,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
Change-Id: I0fd6ca95bbc342f21978783b0103073179017795
Reviewed-on: https://skia-review.googlesource.com/11016
Reviewed-by: Mike Klein <mtklein@chromium.org>
Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src/gpu/GrRenderTargetContext.cpp')
-rw-r--r-- | src/gpu/GrRenderTargetContext.cpp | 34 |
1 files changed, 7 insertions, 27 deletions
diff --git a/src/gpu/GrRenderTargetContext.cpp b/src/gpu/GrRenderTargetContext.cpp index 49482ed8ed..3061074a08 100644 --- a/src/gpu/GrRenderTargetContext.cpp +++ b/src/gpu/GrRenderTargetContext.cpp @@ -1751,11 +1751,10 @@ void GrRenderTargetContext::setupDstTexture(GrRenderTarget* rt, const GrClip& cl clip.getConservativeBounds(rt->width(), rt->height(), ©Rect); SkIRect drawIBounds; - SkIRect clippedRect; opBounds.roundOut(&drawIBounds); // Cover up for any precision issues by outsetting the op bounds a pixel in each direction. drawIBounds.outset(1, 1); - if (!clippedRect.intersect(copyRect, drawIBounds)) { + if (!copyRect.intersect(drawIBounds)) { #ifdef SK_DEBUG GrCapsDebugf(this->caps(), "Missed an early reject. " "Bailing on draw from setupDstTexture.\n"); @@ -1766,43 +1765,24 @@ void GrRenderTargetContext::setupDstTexture(GrRenderTarget* rt, const GrClip& cl // MSAA consideration: When there is support for reading MSAA samples in the shader we could // have per-sample dst values by making the copy multisampled. GrSurfaceDesc desc; - bool rectsMustMatch = false; - bool disallowSubrect = false; - if (!this->caps()->initDescForDstCopy(rt, &desc, &rectsMustMatch, &disallowSubrect)) { + if (!this->caps()->initDescForDstCopy(rt, &desc)) { desc.fOrigin = kDefault_GrSurfaceOrigin; desc.fFlags = kRenderTarget_GrSurfaceFlag; desc.fConfig = rt->config(); } - if (!disallowSubrect) { - copyRect = clippedRect; - } + desc.fWidth = copyRect.width(); + desc.fHeight = copyRect.height(); - SkIPoint dstPoint; - SkIPoint dstOffset; static const uint32_t kFlags = 0; - sk_sp<GrTexture> copy; - if (rectsMustMatch) { - SkASSERT(desc.fOrigin == rt->origin()); - desc.fWidth = rt->width(); - desc.fHeight = rt->height(); - dstPoint = {copyRect.fLeft, copyRect.fTop}; - dstOffset = {0, 0}; - copy.reset(fContext->resourceProvider()->createTexture(desc, SkBudgeted::kYes, kFlags)); - } else { - desc.fWidth = copyRect.width(); - desc.fHeight = copyRect.height(); - dstPoint = {0, 0}; - dstOffset = {copyRect.fLeft, copyRect.fTop}; - copy.reset(fContext->resourceProvider()->createApproxTexture(desc, kFlags)); - } + sk_sp<GrTexture> copy(fContext->resourceProvider()->createApproxTexture(desc, kFlags)); if (!copy) { SkDebugf("Failed to create temporary copy of destination texture.\n"); return; } - + SkIPoint dstPoint = {0, 0}; this->getOpList()->copySurface(copy.get(), rt, copyRect, dstPoint); dstTexture->setTexture(std::move(copy)); - dstTexture->setOffset(dstOffset); + dstTexture->setOffset(copyRect.fLeft, copyRect.fTop); } |