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

Unified Diff: cc/output/filter_operations.cc

Issue 1867913002: Implement cc::FilterOperations::MapRect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: senorblanco review Created 4 years, 8 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 | « cc/output/filter_operations.h ('k') | 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 396e239698a78c885175fed0c22d32dcd23aff49..ffa37bab6c45d07542b7f3578631e7839ec01a93 100644
--- a/cc/output/filter_operations.cc
+++ b/cc/output/filter_operations.cc
@@ -7,10 +7,12 @@
#include <stddef.h>
#include <cmath>
+#include <numeric>
#include "base/trace_event/trace_event_argument.h"
#include "base/values.h"
#include "cc/output/filter_operation.h"
+#include "ui/gfx/geometry/rect.h"
namespace cc {
@@ -56,6 +58,14 @@ static int SpreadForStdDeviation(float std_deviation) {
return static_cast<int>(ceilf(d * 3.f / 2.f));
}
+gfx::Rect FilterOperations::MapRect(const gfx::Rect& rect) const {
+ auto accumulate_rect = [](const gfx::Rect& rect, const FilterOperation& op) {
+ return op.MapRect(rect);
+ };
+ return std::accumulate(operations_.begin(), operations_.end(), rect,
+ accumulate_rect);
+}
+
void FilterOperations::GetOutsets(int* top,
int* right,
int* bottom,
« no previous file with comments | « cc/output/filter_operations.h ('k') | cc/output/filter_operations_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698