Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1205)

Unified Diff: src/gpu/gl/GrGLGpu.cpp

Issue 1965973002: Disable unpack row length when uploading mips (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLGpu.cpp
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index 027d9527c09bd7800a725badd67325cefa254a21..8a3416b74f3b7b6a2d9150b5c5e55d01beca290d 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -1278,7 +1278,12 @@ bool GrGLGpu::uploadTexData(const GrSurfaceDesc& desc,
restoreGLRowLength = false;
const size_t rowBytes = texelsShallowCopy[currentMipLevel].fRowBytes;
- if (caps.unpackRowLengthSupport() && !swFlipY) {
+
+ // TODO: This optimization should be enabled with or without mips.
+ // For use with mips, we must set GR_GL_UNPACK_ROW_LENGTH once per
+ // mip level, before calling glTexImage2D.
+ const bool usesMips = texelsShallowCopy.count() > 1;
+ if (caps.unpackRowLengthSupport() && !swFlipY && !usesMips) {
// can't use this for flipping, only non-neg values allowed. :(
if (rowBytes != trimRowBytes) {
GrGLint rowLength = static_cast<GrGLint>(rowBytes / bpp);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698