Chromium Code Reviews| 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 67033a1bb16bd8ffca9c096d6903f5e4ebb20eaf..bd02152e8b53862a926cd2604585c5a4f0945964 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/ExpensiveCanvasHeuristicParameters.h |
| +++ b/third_party/WebKit/Source/platform/graphics/ExpensiveCanvasHeuristicParameters.h |
| @@ -69,6 +69,44 @@ enum { |
| }; // enum |
| + |
| +// Constants and Coefficients for 2D Canvas Dynamic Rendering Mode |
| +// =============================================================== |
| + |
| +// Approximate relative costs of different types of operations for the |
| +// accelerated rendering pipeline and the recording rendering pipeline. |
| +// These costs were estimated experimentally based on the performance |
| +// of each pipeline in the animometer benchmark. Multiple factors influence |
| +// the true cost of each type of operation, including: |
| +// - The hardware configuration |
| +// - Version of the project |
| +// - Additional details about the operation: |
| +// - Subtype of operation (png vs svg image, arc vs line...) |
| +// - Scale |
| +// - Associated effects (patterns, gradients...) |
| + |
| +const double AcceleratedDrawPathApproximateCost = 0.004; |
|
Stephen White
2016/07/14 18:53:05
Could you put the methodology you used to create t
sebastienlc
2016/07/14 22:26:53
Done.
|
| +const double AcceleratedGetImageDataApproximateCost = 0.1; |
| +const double AcceleratedDrawImageApproximateCost = 0.002; |
| + |
| +const double RecordingDrawPathApproximateCost = 0.0014; |
|
Stephen White
2016/07/14 18:53:05
Bikeshedding on names a bit: I'm not sure I like t
sebastienlc
2016/07/14 22:26:53
Done.
|
| +const double RecordingGetImageDataApproximateCost = 0.001; |
|
Stephen White
2016/07/14 18:53:04
I'm a little confused about GetImageData in "Recor
sebastienlc
2016/07/14 22:26:53
Done.
|
| +const double RecordingDrawImageApproximateCost = 0.004; |
| + |
| +// Coefficient used in the isAccelerationOptimalForCanvasContent |
| +// heuristic to create a bias in the output. |
| +// If set to a value greater than 1, it creates a bias towards suggesting acceleration. |
| +// If set to a value smaller than 1, it creates a bias towards not suggesting acceleration |
| +// For example, if its value is 1.5, then disabling gpu acceleration will only be suggested if |
| +// recordingCost * 1.5 < acceleratedCost. |
| +const double AcceleratedHeuristicBias = 1.5; |
| + |
| +// Minimum number of frames that need to be rendered |
| +// before the rendering pipeline may be switched. Having this set |
| +// to more than 1 increases the sample size of usage data before a |
| +// decision is made, improving the accuracy of heuristics. |
| +const int MinFramesBeforeSwitch = 3; |
| + |
| } // namespace ExpensiveCanvasHeuristicParameters |
| } // namespace blink |