| OLD | NEW |
| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 // monopolize the texture cache, and when it is being downsized to the | 71 // monopolize the texture cache, and when it is being downsized to the |
| 72 // point that few of the upload texels are actually sampled. When both | 72 // point that few of the upload texels are actually sampled. When both |
| 73 // of these conditions are met, we disable acceleration. | 73 // of these conditions are met, we disable acceleration. |
| 74 DrawImageTextureUploadSoftSizeLimit = 4096 * 4096, | 74 DrawImageTextureUploadSoftSizeLimit = 4096 * 4096, |
| 75 DrawImageTextureUploadSoftSizeLimitScaleThreshold = 4, | 75 DrawImageTextureUploadSoftSizeLimitScaleThreshold = 4, |
| 76 DrawImageTextureUploadHardSizeLimit = 8192 * 8192, | 76 DrawImageTextureUploadHardSizeLimit = 8192 * 8192, |
| 77 | 77 |
| 78 // GPU readback prevention heuristics | 78 // GPU readback prevention heuristics |
| 79 //==================================== | 79 //==================================== |
| 80 | 80 |
| 81 GetImageDataForcesNoAcceleration = 1, | 81 GPUReadbackForcesNoAcceleration = 1, |
| 82 |
| 83 // When gpu readback is successively invoked in following number of frames, |
| 84 // we disable gpu acceleration to avoid the high cost of gpu readback. |
| 85 GPUReadbackMinSuccessiveFrames = 3, |
| 82 | 86 |
| 83 // When a canvas is used as a source image, if its destination is | 87 // When a canvas is used as a source image, if its destination is |
| 84 // non-accelerated and the source canvas is accelerated, a readback | 88 // non-accelerated and the source canvas is accelerated, a readback |
| 85 // from the gpu is necessary. This option causes the source canvas to | 89 // from the gpu is necessary. This option causes the source canvas to |
| 86 // switch to non-accelerated when this situation is encountered to | 90 // switch to non-accelerated when this situation is encountered to |
| 87 // prevent future canvas-to-canvas draws from requiring a readback. | 91 // prevent future canvas-to-canvas draws from requiring a readback. |
| 88 DisableAccelerationToAvoidReadbacks = 0, | 92 DisableAccelerationToAvoidReadbacks = 0, |
| 89 | 93 |
| 90 // See description of DisableAccelerationToAvoidReadbacks. This is the | 94 // See description of DisableAccelerationToAvoidReadbacks. This is the |
| 91 // opposite strategy : accelerate the destination canvas. If both | 95 // opposite strategy : accelerate the destination canvas. If both |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 // before the rendering pipeline may be switched. Having this set | 206 // before the rendering pipeline may be switched. Having this set |
| 203 // to more than 1 increases the sample size of usage data before a | 207 // to more than 1 increases the sample size of usage data before a |
| 204 // decision is made, improving the accuracy of heuristics. | 208 // decision is made, improving the accuracy of heuristics. |
| 205 const int MinFramesBeforeSwitch = 3; | 209 const int MinFramesBeforeSwitch = 3; |
| 206 | 210 |
| 207 } // namespace ExpensiveCanvasHeuristicParameters | 211 } // namespace ExpensiveCanvasHeuristicParameters |
| 208 | 212 |
| 209 } // namespace blink | 213 } // namespace blink |
| 210 | 214 |
| 211 #endif | 215 #endif |
| OLD | NEW |