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

Unified Diff: cc/output/filter_operation.h

Issue 317663005: Scale the ALPHA_THRESHOLD filter's region based on the device scale factor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove call to SetAlphaShape from this cl Created 6 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_operation.cc » ('j') | cc/output/filter_operation.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/filter_operation.h
diff --git a/cc/output/filter_operation.h b/cc/output/filter_operation.h
index 626d2e7f06bb7e750c4ea9cd8cb2b309ec1b34ec..3de252f562fb8c4b5ca86b2ceee070ac8d6184af 100644
--- a/cc/output/filter_operation.h
+++ b/cc/output/filter_operation.h
@@ -89,6 +89,11 @@ class CC_EXPORT FilterOperation {
return region_;
}
+ float device_scale_factor() const {
+ DCHECK_EQ(type_, ALPHA_THRESHOLD);
+ return device_scale_factor_;
+ }
+
static FilterOperation CreateGrayscaleFilter(float amount) {
return FilterOperation(GRAYSCALE, amount);
}
@@ -149,10 +154,14 @@ class CC_EXPORT FilterOperation {
}
static FilterOperation CreateAlphaThresholdFilter(const SkRegion& region,
+ float device_scale_factor,
danakj 2014/06/17 21:35:28 The fact that you're setting this to the DSF doesn
garykac 2014/07/10 23:02:24 Acknowledged.
float inner_threshold,
float outer_threshold) {
- return FilterOperation(ALPHA_THRESHOLD, region,
- inner_threshold, outer_threshold);
+ return FilterOperation(ALPHA_THRESHOLD,
+ region,
+ device_scale_factor,
+ inner_threshold,
+ outer_threshold);
}
bool operator==(const FilterOperation& other) const;
@@ -210,6 +219,11 @@ class CC_EXPORT FilterOperation {
region_ = region;
}
+ void set_device_scale_factor(float scale) {
+ DCHECK_EQ(type_, ALPHA_THRESHOLD);
+ device_scale_factor_ = scale;
+ }
+
// Given two filters of the same type, returns a filter operation created by
// linearly interpolating a |progress| fraction from |from| to |to|. If either
// |from| or |to| (but not both) is null, it is treated as a no-op filter of
@@ -239,6 +253,7 @@ class CC_EXPORT FilterOperation {
FilterOperation(FilterType type,
const SkRegion& region,
+ float device_scale_factor,
float inner_threshold,
float outer_threshold);
@@ -251,6 +266,7 @@ class CC_EXPORT FilterOperation {
SkScalar matrix_[20];
int zoom_inset_;
SkRegion region_;
+ float device_scale_factor_;
};
} // namespace cc
« no previous file with comments | « no previous file | cc/output/filter_operation.cc » ('j') | cc/output/filter_operation.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698