Chromium Code Reviews| Index: cc/resources/picture_layer_tiling.cc |
| diff --git a/cc/resources/picture_layer_tiling.cc b/cc/resources/picture_layer_tiling.cc |
| index 8cb342488e8cc6505f97764a7c7d9eff10be92ae..0ded11b6e249eb9f4b6491b1ba40c5a82394ec45 100644 |
| --- a/cc/resources/picture_layer_tiling.cc |
| +++ b/cc/resources/picture_layer_tiling.cc |
| @@ -823,9 +823,11 @@ int ComputeExpansionDelta(int num_x_edges, int num_y_edges, |
| int64 c = static_cast<int64>(width) * height - target_area; |
| // Compute the delta for our edges using the quadratic equation. |
| - return a == 0 ? -c / b : |
| - (-b + static_cast<int>( |
| - std::sqrt(static_cast<int64>(b) * b - 4.0 * a * c))) / (2 * a); |
| + int result = |
|
danakj
2014/09/09 15:52:03
nit: s/result/delta/?
|
| + (a == 0) ? -c / b : (-b + static_cast<int>(std::sqrt( |
| + static_cast<int64>(b) * b - 4.0 * a * c))) / |
| + (2 * a); |
| + return std::max(0, result); |
| } |
| } // namespace |