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

Unified Diff: cc/output/filter_operations.cc

Issue 2115163002: cc: Fix a bug where filter outsets for drop-shadow could be negative. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 4 years, 6 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 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_operations.cc
diff --git a/cc/output/filter_operations.cc b/cc/output/filter_operations.cc
index 8263518640b8a30f291febaba75dd92684e215aa..f0cca86f744548c58b57bf238c1d0dccb37c27f9 100644
--- a/cc/output/filter_operations.cc
+++ b/cc/output/filter_operations.cc
@@ -110,10 +110,10 @@ void FilterOperations::GetOutsets(int* top,
*bottom += spread;
*left += spread;
} else {
- *top += spread - op.drop_shadow_offset().y();
- *right += spread + op.drop_shadow_offset().x();
- *bottom += spread + op.drop_shadow_offset().y();
- *left += spread - op.drop_shadow_offset().x();
+ *top += std::max(0, spread - op.drop_shadow_offset().y());
enne (OOO) 2016/07/06 17:34:57 What if your drop shadow is up and to the left ins
jbroman 2016/07/06 17:37:32 I don't understand your question. No, it doesn't h
enne (OOO) 2016/07/06 17:57:18 *drinks more coffee* Oops, sorry about misreading
+ *right += std::max(0, spread + op.drop_shadow_offset().x());
+ *bottom += std::max(0, spread + op.drop_shadow_offset().y());
+ *left += std::max(0, spread - op.drop_shadow_offset().x());
}
}
}
« 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