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

Unified Diff: cc/output/filter_operations.cc

Issue 22875045: cc: Remove unnecessary "default" cases from switch statements. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix HasFilterThatMovesPixels()/HasFilterThatAffectsOpacity() Created 7 years, 4 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_operation.cc ('k') | cc/output/render_surface_filters.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 24208418026390d2127183481018a7a9b6265eb3..e526f5c419bed3ae53cbab223109f19c85ec385b 100644
--- a/cc/output/filter_operations.cc
+++ b/cc/output/filter_operations.cc
@@ -86,7 +86,16 @@ bool FilterOperations::HasFilterThatMovesPixels() const {
case FilterOperation::DROP_SHADOW:
case FilterOperation::ZOOM:
return true;
- default:
+ case FilterOperation::OPACITY:
+ case FilterOperation::COLOR_MATRIX:
+ case FilterOperation::GRAYSCALE:
+ case FilterOperation::SEPIA:
+ case FilterOperation::SATURATE:
+ case FilterOperation::HUE_ROTATE:
+ case FilterOperation::INVERT:
+ case FilterOperation::BRIGHTNESS:
+ case FilterOperation::CONTRAST:
+ case FilterOperation::SATURATING_BRIGHTNESS:
break;
}
}
@@ -104,10 +113,22 @@ bool FilterOperations::HasFilterThatAffectsOpacity() const {
return true;
case FilterOperation::COLOR_MATRIX: {
const SkScalar* matrix = op.matrix();
- return matrix[15] || matrix[16] || matrix[17] || matrix[18] != 1 ||
- matrix[19];
+ if (matrix[15] ||
+ matrix[16] ||
+ matrix[17] ||
+ matrix[18] != 1 ||
+ matrix[19])
+ return true;
+ break;
}
- default:
+ case FilterOperation::GRAYSCALE:
+ case FilterOperation::SEPIA:
+ case FilterOperation::SATURATE:
+ case FilterOperation::HUE_ROTATE:
+ case FilterOperation::INVERT:
+ case FilterOperation::BRIGHTNESS:
+ case FilterOperation::CONTRAST:
+ case FilterOperation::SATURATING_BRIGHTNESS:
break;
}
}
« no previous file with comments | « cc/output/filter_operation.cc ('k') | cc/output/render_surface_filters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698