diff options
author | 2018-03-07 13:01:25 -0500 | |
---|---|---|
committer | 2018-03-07 18:22:40 +0000 | |
commit | 58389b90cd387533021c109eb28da40c08e0ead5 (patch) | |
tree | 7744ee9c23c74c61aa00a3cc01eff74cedb8f541 /src/gpu/gl/GrGLGpu.cpp | |
parent | ab6fd7ef91aeca8a3fbbc6c6670cb89a5a7b6d53 (diff) |
Initial texture data is never flipped when uploaded.
The first bytes of the data always refer to the pixel accessed by texture coord (0, 0).
Change-Id: I708702d90f35b3bc896a48c3c3fd6a0be73f505a
Reviewed-on: https://skia-review.googlesource.com/112261
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/gl/GrGLGpu.cpp')
-rw-r--r-- | src/gpu/gl/GrGLGpu.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index ea7be0ef93..2a1d403cea 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -1413,7 +1413,6 @@ static void set_initial_texture_params(const GrGLInterface* interface, sk_sp<GrTexture> GrGLGpu::onCreateTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted, - GrSurfaceOrigin texelsOrigin, const GrMipLevel texels[], int mipLevelCount) { // We fail if the MSAA was requested and is not available. @@ -1445,8 +1444,8 @@ sk_sp<GrTexture> GrGLGpu::onCreateTexture(const GrSurfaceDesc& desc, idDesc.fOwnership = GrBackendObjectOwnership::kOwned; GrMipMapsStatus mipMapsStatus; GrGLTexture::TexParams initialTexParams; - if (!this->createTextureImpl(desc, &idDesc.fInfo, isRenderTarget, &initialTexParams, - texelsOrigin, texels, mipLevelCount, &mipMapsStatus)) { + if (!this->createTextureImpl(desc, &idDesc.fInfo, isRenderTarget, &initialTexParams, texels, + mipLevelCount, &mipMapsStatus)) { return return_null_texture(); } @@ -1632,8 +1631,7 @@ int GrGLGpu::getCompatibleStencilIndex(GrPixelConfig config) { } bool GrGLGpu::createTextureImpl(const GrSurfaceDesc& desc, GrGLTextureInfo* info, bool renderTarget, - GrGLTexture::TexParams* initialTexParams, - GrSurfaceOrigin texelsOrigin, const GrMipLevel texels[], + GrGLTexture::TexParams* initialTexParams, const GrMipLevel texels[], int mipLevelCount, GrMipMapsStatus* mipMapsStatus) { info->fID = 0; info->fTarget = GR_GL_TEXTURE_2D; @@ -1657,9 +1655,9 @@ bool GrGLGpu::createTextureImpl(const GrSurfaceDesc& desc, GrGLTextureInfo* info set_initial_texture_params(this->glInterface(), *info, initialTexParams); } - if (!this->uploadTexData(desc.fConfig, desc.fWidth, desc.fHeight, texelsOrigin, info->fTarget, - kNewTexture_UploadType, 0, 0, desc.fWidth, desc.fHeight, desc.fConfig, - texels, mipLevelCount, mipMapsStatus)) { + if (!this->uploadTexData(desc.fConfig, desc.fWidth, desc.fHeight, kTopLeft_GrSurfaceOrigin, + info->fTarget, kNewTexture_UploadType, 0, 0, desc.fWidth, desc.fHeight, + desc.fConfig, texels, mipLevelCount, mipMapsStatus)) { GL_CALL(DeleteTextures(1, &(info->fID))); return false; } |