// 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;
// 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;