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

Unified Diff: third_party/WebKit/Source/platform/graphics/ExpensiveCanvasHeuristicParameters.h

Issue 2362363002: Cancel GPU acceleration for 2D canvas when drawing very large images (Closed)
Patch Set: fix sqrt Created 4 years, 3 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
Index: third_party/WebKit/Source/platform/graphics/ExpensiveCanvasHeuristicParameters.h
diff --git a/third_party/WebKit/Source/platform/graphics/ExpensiveCanvasHeuristicParameters.h b/third_party/WebKit/Source/platform/graphics/ExpensiveCanvasHeuristicParameters.h
index f32dda3d3b2ff9f5db0be15ac09b666b8d5e01c5..1afe3b0f774f5f7f3d97899704635275b98492a9 100644
--- a/third_party/WebKit/Source/platform/graphics/ExpensiveCanvasHeuristicParameters.h
+++ b/third_party/WebKit/Source/platform/graphics/ExpensiveCanvasHeuristicParameters.h
@@ -67,6 +67,16 @@ enum {
GetImageDataForcesNoAcceleration = 1,
+ // When drawing very large images to canvases, there is a point where
+ // GPU acceleration becomes inefficient due to texture upload overhead,
+ // especially when the image is large enough that it is likely to
+ // monopolize the texture cache, and when it is being downsized to the
+ // point that few of the upload texels are actually sampled. When both
+ // of these conditions are met, we disable acceleration.
+ DrawImageTextureUploadSoftSizeLimit = 4096 * 4096,
+ DrawImageTextureUploadSoftSizeLimitScaleThreshold = 4,
+ DrawImageTextureUploadHardSizeLimit = 8192 * 8192,
+
}; // enum

Powered by Google App Engine
This is Rietveld 408576698