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

Side by Side 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, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ExpensiveCanvasHeuristicParameters_h 5 #ifndef ExpensiveCanvasHeuristicParameters_h
6 #define ExpensiveCanvasHeuristicParameters_h 6 #define ExpensiveCanvasHeuristicParameters_h
7 7
8 namespace blink { 8 namespace blink {
9 9
10 namespace ExpensiveCanvasHeuristicParameters { 10 namespace ExpensiveCanvasHeuristicParameters {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 // lists. Rationale: The allocation of large textures for canvas 60 // lists. Rationale: The allocation of large textures for canvas
61 // tends to starve the compositor, and increase the probability of 61 // tends to starve the compositor, and increase the probability of
62 // failure of subsequent allocations required for double buffering. 62 // failure of subsequent allocations required for double buffering.
63 PreferDisplayListOverGpuSizeThreshold = 4096 * 4096, 63 PreferDisplayListOverGpuSizeThreshold = 4096 * 4096,
64 64
65 // Disable Acceleration heuristic parameters 65 // Disable Acceleration heuristic parameters
66 //=========================================== 66 //===========================================
67 67
68 GetImageDataForcesNoAcceleration = 1, 68 GetImageDataForcesNoAcceleration = 1,
69 69
70 // When drawing very large images to canvases, there is a point where
71 // GPU acceleration becomes inefficient due to texture upload overhead,
72 // especially when the image is large enough that it is likely to
73 // monopolize the texture cache, and when it is being downsized to the
74 // point that few of the upload texels are actually sampled. When both
75 // of these conditions are met, we disable acceleration.
76 DrawImageTextureUploadSoftSizeLimit = 4096 * 4096,
77 DrawImageTextureUploadSoftSizeLimitScaleThreshold = 4,
78 DrawImageTextureUploadHardSizeLimit = 8192 * 8192,
79
70 }; // enum 80 }; // enum
71 81
72 82
73 // Constants and Coefficients for 2D Canvas Dynamic Rendering Mode Switching 83 // Constants and Coefficients for 2D Canvas Dynamic Rendering Mode Switching
74 // ========================================================================= 84 // =========================================================================
75 85
76 // Approximate relative costs of different types of operations for the 86 // Approximate relative costs of different types of operations for the
77 // accelerated rendering pipeline and the recording rendering pipeline. 87 // accelerated rendering pipeline and the recording rendering pipeline.
78 // These costs were estimated experimentally using the tools located in the 88 // These costs were estimated experimentally using the tools located in the
79 // third_party/WebKit/Source/modules/canvas2d/performance_analysis directory. 89 // third_party/WebKit/Source/modules/canvas2d/performance_analysis directory.
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 // before the rendering pipeline may be switched. Having this set 149 // before the rendering pipeline may be switched. Having this set
140 // to more than 1 increases the sample size of usage data before a 150 // to more than 1 increases the sample size of usage data before a
141 // decision is made, improving the accuracy of heuristics. 151 // decision is made, improving the accuracy of heuristics.
142 const int MinFramesBeforeSwitch = 3; 152 const int MinFramesBeforeSwitch = 3;
143 153
144 } // namespace ExpensiveCanvasHeuristicParameters 154 } // namespace ExpensiveCanvasHeuristicParameters
145 155
146 } // namespace blink 156 } // namespace blink
147 157
148 #endif 158 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698