Index: src/gpu/gl/GrGLGpu.cpp |
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp |
index e002d5101bab5a114a75f5ea8d0e219989d0a675..f4252d8eb31adf1fc07511dfd829f08fca6eec50 100644 |
--- a/src/gpu/gl/GrGLGpu.cpp |
+++ b/src/gpu/gl/GrGLGpu.cpp |
@@ -993,6 +993,7 @@ static bool allocate_and_populate_uncompressed_texture(const GrSurfaceDesc& desc |
const GrGLCaps& caps, |
GrGLenum target, |
GrGLenum internalFormat, |
+ GrGLenum sizedInternalFormat, |
Brian Osman
2016/09/12 15:08:17
FWIW: Don't think we need to change allocate_and_p
bsalomon
2016/09/12 15:14:54
My only hesitation here is that calling this sized
|
GrGLenum externalFormat, |
GrGLenum externalType, |
const SkTArray<GrMipLevel>& texels, |
@@ -1012,7 +1013,7 @@ static bool allocate_and_populate_uncompressed_texture(const GrSurfaceDesc& desc |
GL_ALLOC_CALL(&interface, |
TexStorage2D(target, |
texels.count(), |
- internalFormat, |
+ sizedInternalFormat, |
desc.fWidth, desc.fHeight)); |
GrGLenum error = check_alloc_error(desc, &interface); |
if (error != GR_GL_NO_ERROR) { |
@@ -1254,6 +1255,8 @@ bool GrGLGpu::uploadTexData(const GrSurfaceDesc& desc, |
&externalFormat, &externalType)) { |
return false; |
} |
+ GrGLenum sizedInternalFormat = this->glCaps().configSizedInternalFormat(desc.fConfig); |
+ |
/* |
* Check whether to allocate a temporary buffer for flipping y or |
* because our srcData has extra bytes past each row. If so, we need |
@@ -1356,9 +1359,9 @@ bool GrGLGpu::uploadTexData(const GrSurfaceDesc& desc, |
0 == left && 0 == top && |
desc.fWidth == width && desc.fHeight == height) { |
succeeded = allocate_and_populate_uncompressed_texture(desc, *interface, caps, target, |
- internalFormat, externalFormat, |
- externalType, texelsShallowCopy, |
- width, height); |
+ internalFormat, sizedInternalFormat, |
+ externalFormat, externalType, |
+ texelsShallowCopy, width, height); |
} else { |
if (swFlipY || glFlipY) { |
top = desc.fHeight - (top + height); |