diff options
author | bsalomon <bsalomon@google.com> | 2016-06-08 10:02:42 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-08 10:02:42 -0700 |
commit | 5c7d62d431a0ad7988f05fbdb206237729c0c308 (patch) | |
tree | 2f1e5b42f69712fec3bac12e9487d97a512ac374 | |
parent | e8bd9abe3334b1e22d46d28e7c5d5c6495c99fda (diff) |
When setting up a copySurface dst texture make the orientation match the src when glBlitFramebuffer requires it
BUG=chromium:618122
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2049753002
Review-Url: https://codereview.chromium.org/2049753002
-rw-r--r-- | src/gpu/gl/GrGLGpu.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index 8aec4d684d..dcad9ce5a4 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -3575,13 +3575,19 @@ bool GrGLGpu::initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) // texture. This code prefers CopyTexSubImage to fbo blit and avoids triggering temporary fbo // creation. It isn't clear that avoiding temporary fbo creation is actually optimal. + GrSurfaceOrigin originForBlitFramebuffer = kDefault_GrSurfaceOrigin; + if (this->glCaps().blitFramebufferSupport() == + GrGLCaps::kNoScalingNoMirroring_BlitFramebufferSupport) { + originForBlitFramebuffer = src->origin(); + } + // Check for format issues with glCopyTexSubImage2D if (kGLES_GrGLStandard == this->glStandard() && this->glCaps().bgraIsInternalFormat() && kBGRA_8888_GrPixelConfig == src->config()) { // glCopyTexSubImage2D doesn't work with this config. If the bgra can be used with fbo blit // then we set up for that, otherwise fail. if (this->caps()->isConfigRenderable(kBGRA_8888_GrPixelConfig, false)) { - desc->fOrigin = kDefault_GrSurfaceOrigin; + desc->fOrigin = originForBlitFramebuffer; desc->fFlags = kRenderTarget_GrSurfaceFlag; desc->fConfig = kBGRA_8888_GrPixelConfig; return true; @@ -3597,7 +3603,7 @@ bool GrGLGpu::initCopySurfaceDstDesc(const GrSurface* src, GrSurfaceDesc* desc) // It's illegal to call CopyTexSubImage2D on a MSAA renderbuffer. Set up for FBO blit or // fail. if (this->caps()->isConfigRenderable(src->config(), false)) { - desc->fOrigin = kDefault_GrSurfaceOrigin; + desc->fOrigin = originForBlitFramebuffer; desc->fFlags = kRenderTarget_GrSurfaceFlag; desc->fConfig = src->config(); return true; |