From 58389b90cd387533021c109eb28da40c08e0ead5 Mon Sep 17 00:00:00 2001 From: Brian Salomon Date: Wed, 7 Mar 2018 13:01:25 -0500 Subject: 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 Reviewed-by: Robert Phillips --- src/gpu/vk/GrVkGpu.cpp | 7 +++---- src/gpu/vk/GrVkGpu.h | 3 +-- 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'src/gpu/vk') diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp index 3a81eed350..1af5a3fff1 100644 --- a/src/gpu/vk/GrVkGpu.cpp +++ b/src/gpu/vk/GrVkGpu.cpp @@ -763,8 +763,7 @@ bool GrVkGpu::uploadTexDataOptimal(GrVkTexture* tex, GrSurfaceOrigin texOrigin, //////////////////////////////////////////////////////////////////////////////// sk_sp GrVkGpu::onCreateTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted, - GrSurfaceOrigin texelsOrigin, const GrMipLevel texels[], - int mipLevelCount) { + const GrMipLevel texels[], int mipLevelCount) { bool renderTarget = SkToBool(desc.fFlags & kRenderTarget_GrSurfaceFlag); VkFormat pixelFormat; @@ -825,8 +824,8 @@ sk_sp GrVkGpu::onCreateTexture(const GrSurfaceDesc& desc, SkBudgeted auto colorType = GrPixelConfigToColorType(desc.fConfig); if (mipLevelCount) { - if (!this->uploadTexDataOptimal(tex.get(), texelsOrigin, 0, 0, desc.fWidth, desc.fHeight, - colorType, texels, mipLevelCount)) { + if (!this->uploadTexDataOptimal(tex.get(), kTopLeft_GrSurfaceOrigin, 0, 0, desc.fWidth, + desc.fHeight, colorType, texels, mipLevelCount)) { tex->unref(); return nullptr; } diff --git a/src/gpu/vk/GrVkGpu.h b/src/gpu/vk/GrVkGpu.h index 7616fccefe..e622d573de 100644 --- a/src/gpu/vk/GrVkGpu.h +++ b/src/gpu/vk/GrVkGpu.h @@ -164,8 +164,7 @@ private: void destroyResources(); - sk_sp onCreateTexture(const GrSurfaceDesc& desc, SkBudgeted budgeted, - GrSurfaceOrigin texelsOrigin, const GrMipLevel texels[], + sk_sp onCreateTexture(const GrSurfaceDesc&, SkBudgeted, const GrMipLevel[], int mipLevelCount) override; sk_sp onWrapBackendTexture(const GrBackendTexture&, GrWrapOwnership) override; -- cgit v1.2.3