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

Unified Diff: cc/output/filter_operation.cc

Issue 2593583005: cc: Prevent float-cast-overflow in MapRectInternal. (Closed)
Patch Set: . Created 4 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/output/filter_operations_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/filter_operation.cc
diff --git a/cc/output/filter_operation.cc b/cc/output/filter_operation.cc
index 198057a265d9643d150ed8d66123192452813e59..e75b41707ba47250fa8009ae737c55c2c7b7de75 100644
--- a/cc/output/filter_operation.cc
+++ b/cc/output/filter_operation.cc
@@ -336,9 +336,9 @@ gfx::Rect MapRectInternal(const FilterOperation& op,
SkVector spread = MapStdDeviation(op.amount(), matrix);
float spread_x = std::abs(spread.x());
float spread_y = std::abs(spread.y());
- gfx::Rect result = rect;
+ gfx::RectF result(rect);
result.Inset(-spread_x, -spread_y, -spread_x, -spread_y);
- return result;
+ return gfx::ToEnclosingRect(result);
}
case FilterOperation::DROP_SHADOW: {
SkVector spread = MapStdDeviation(op.amount(), matrix);
« no previous file with comments | « no previous file | cc/output/filter_operations_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698