Index: cc/base/filter_operation.cc |
diff --git a/cc/output/filter_operation.cc b/cc/base/filter_operation.cc |
similarity index 88% |
rename from cc/output/filter_operation.cc |
rename to cc/base/filter_operation.cc |
index e75b41707ba47250fa8009ae737c55c2c7b7de75..aed4b024936e89c1a23918bf3cb94933f5bf341c 100644 |
--- a/cc/output/filter_operation.cc |
+++ b/cc/base/filter_operation.cc |
@@ -8,8 +8,8 @@ |
#include "base/trace_event/trace_event_argument.h" |
#include "base/values.h" |
+#include "cc/base/filter_operation.h" |
#include "cc/base/math_util.h" |
-#include "cc/output/filter_operation.h" |
#include "ui/gfx/animation/tween.h" |
#include "ui/gfx/geometry/rect.h" |
#include "ui/gfx/geometry/rect_conversions.h" |
@@ -31,9 +31,8 @@ bool FilterOperation::operator==(const FilterOperation& other) const { |
return image_filter_.get() == other.image_filter_.get(); |
} |
if (type_ == ALPHA_THRESHOLD) { |
- return region_ == other.region_ && |
- amount_ == other.amount_ && |
- outer_threshold_ == other.outer_threshold_; |
+ return region_ == other.region_ && amount_ == other.amount_ && |
+ outer_threshold_ == other.outer_threshold_; |
} |
return amount_ == other.amount_; |
} |
@@ -129,8 +128,7 @@ FilterOperation::FilterOperation(const FilterOperation& other) |
memcpy(matrix_, other.matrix_, sizeof(matrix_)); |
} |
-FilterOperation::~FilterOperation() { |
-} |
+FilterOperation::~FilterOperation() {} |
static FilterOperation CreateNoOpFilter(FilterOperation::FilterType type) { |
switch (type) { |
@@ -153,8 +151,8 @@ static FilterOperation CreateNoOpFilter(FilterOperation::FilterType type) { |
case FilterOperation::BLUR: |
return FilterOperation::CreateBlurFilter(0.f); |
case FilterOperation::DROP_SHADOW: |
- return FilterOperation::CreateDropShadowFilter( |
- gfx::Point(0, 0), 0.f, SK_ColorTRANSPARENT); |
+ return FilterOperation::CreateDropShadowFilter(gfx::Point(0, 0), 0.f, |
+ SK_ColorTRANSPARENT); |
case FilterOperation::COLOR_MATRIX: { |
SkScalar matrix[20]; |
memset(matrix, 0, 20 * sizeof(SkScalar)); |
@@ -234,13 +232,12 @@ FilterOperation FilterOperation::Blend(const FilterOperation* from, |
to_op.type())); |
if (to_op.type() == FilterOperation::DROP_SHADOW) { |
- gfx::Point blended_offset( |
- gfx::Tween::LinearIntValueBetween(progress, |
- from_op.drop_shadow_offset().x(), |
- to_op.drop_shadow_offset().x()), |
- gfx::Tween::LinearIntValueBetween(progress, |
- from_op.drop_shadow_offset().y(), |
- to_op.drop_shadow_offset().y())); |
+ gfx::Point blended_offset(gfx::Tween::LinearIntValueBetween( |
+ progress, from_op.drop_shadow_offset().x(), |
+ to_op.drop_shadow_offset().x()), |
+ gfx::Tween::LinearIntValueBetween( |
+ progress, from_op.drop_shadow_offset().y(), |
+ to_op.drop_shadow_offset().y())); |
blended_filter.set_drop_shadow_offset(blended_offset); |
blended_filter.set_drop_shadow_color(gfx::Tween::ColorValueBetween( |
progress, from_op.drop_shadow_color(), to_op.drop_shadow_color())); |
@@ -251,10 +248,9 @@ FilterOperation FilterOperation::Blend(const FilterOperation* from, |
0)); |
} else if (to_op.type() == FilterOperation::ALPHA_THRESHOLD) { |
blended_filter.set_outer_threshold(ClampAmountForFilterType( |
- gfx::Tween::FloatValueBetween(progress, |
- from_op.outer_threshold(), |
- to_op.outer_threshold()), |
- to_op.type())); |
+ gfx::Tween::FloatValueBetween(progress, from_op.outer_threshold(), |
+ to_op.outer_threshold()), |
+ to_op.type())); |
blended_filter.set_region(to_op.region()); |
} |
@@ -302,19 +298,18 @@ void FilterOperation::AsValueInto(base::trace_event::TracedValue* value) const { |
break; |
} |
case FilterOperation::ALPHA_THRESHOLD: { |
- value->SetDouble("inner_threshold", amount_); |
- value->SetDouble("outer_threshold", outer_threshold_); |
- std::unique_ptr<base::ListValue> region_value(new base::ListValue()); |
- value->BeginArray("region"); |
- for (SkRegion::Iterator it(region_); !it.done(); it.next()) { |
- value->AppendInteger(it.rect().x()); |
- value->AppendInteger(it.rect().y()); |
- value->AppendInteger(it.rect().width()); |
- value->AppendInteger(it.rect().height()); |
- } |
- value->EndArray(); |
+ value->SetDouble("inner_threshold", amount_); |
+ value->SetDouble("outer_threshold", outer_threshold_); |
+ std::unique_ptr<base::ListValue> region_value(new base::ListValue()); |
+ value->BeginArray("region"); |
+ for (SkRegion::Iterator it(region_); !it.done(); it.next()) { |
+ value->AppendInteger(it.rect().x()); |
+ value->AppendInteger(it.rect().y()); |
+ value->AppendInteger(it.rect().width()); |
+ value->AppendInteger(it.rect().height()); |
} |
- break; |
+ value->EndArray(); |
+ } break; |
} |
} |