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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/ExpensiveCanvasHeuristicParameters.h

Issue 2388293002: Disable GPU acceleration on 2D canvas when readbacks are needed (Closed)
Patch Set: fixed tests 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
« no previous file with comments | « third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // Whan a canvas is used as a source image, if its destination is
71 // non-accelerated and the source canvas is accelerated, a readback
72 // from the gpu is necessary. This option cause the source canvas to
Stephen White 2016/10/04 18:40:14 Nit: cause -> causes
73 // switch to non-accelerated when this situation is encountered to
74 // prevent future canvas to canvas draws from requiring a readback.
Stephen White 2016/10/04 18:40:14 uNit: "canvas to canvas" -> "canvas-to-canvas"
75 DisableAccelerationToAvoidReadbacks = 1,
76
70 // When drawing very large images to canvases, there is a point where 77 // When drawing very large images to canvases, there is a point where
71 // GPU acceleration becomes inefficient due to texture upload overhead, 78 // GPU acceleration becomes inefficient due to texture upload overhead,
72 // especially when the image is large enough that it is likely to 79 // 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 80 // 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 81 // point that few of the upload texels are actually sampled. When both
75 // of these conditions are met, we disable acceleration. 82 // of these conditions are met, we disable acceleration.
76 DrawImageTextureUploadSoftSizeLimit = 4096 * 4096, 83 DrawImageTextureUploadSoftSizeLimit = 4096 * 4096,
77 DrawImageTextureUploadSoftSizeLimitScaleThreshold = 4, 84 DrawImageTextureUploadSoftSizeLimitScaleThreshold = 4,
78 DrawImageTextureUploadHardSizeLimit = 8192 * 8192, 85 DrawImageTextureUploadHardSizeLimit = 8192 * 8192,
79 86
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 // before the rendering pipeline may be switched. Having this set 183 // before the rendering pipeline may be switched. Having this set
177 // to more than 1 increases the sample size of usage data before a 184 // to more than 1 increases the sample size of usage data before a
178 // decision is made, improving the accuracy of heuristics. 185 // decision is made, improving the accuracy of heuristics.
179 const int MinFramesBeforeSwitch = 3; 186 const int MinFramesBeforeSwitch = 3;
180 187
181 } // namespace ExpensiveCanvasHeuristicParameters 188 } // namespace ExpensiveCanvasHeuristicParameters
182 189
183 } // namespace blink 190 } // namespace blink
184 191
185 #endif 192 #endif
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698