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

Unified Diff: src/image/SkImage_Gpu.cpp

Issue 1831873002: Add early out for large textures (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: fix indent Created 4 years, 9 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/image/SkImage_Gpu.cpp
diff --git a/src/image/SkImage_Gpu.cpp b/src/image/SkImage_Gpu.cpp
index 7a99dfeaa5d1187135c021c6679e35968b821870..60eedbc9a7a71fafb198a5fd4fae4d4f00ca47b7 100644
--- a/src/image/SkImage_Gpu.cpp
+++ b/src/image/SkImage_Gpu.cpp
@@ -355,6 +355,11 @@ size_t SkImage::getDeferredTextureImageData(const GrContextThreadSafeProxy& prox
return 0;
}
+ const int maxTextureSize = proxy.fCaps->maxTextureSize();
+ if (width() > maxTextureSize || height() > maxTextureSize) {
+ return 0;
+ }
+
SkAutoPixmapStorage pixmap;
SkImageInfo info;
size_t pixelSize = 0;
« 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