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

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: remove changes to enums that require arraysize 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
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;
danakj 2013/08/26 15:55:39 can you return false here and NOTREACHED() below?
reveman 2013/08/26 17:16:57 Done.
reveman 2013/08/26 23:38:41 I was too quick to change this. We can't of course
danakj 2013/08/27 00:18:54 Oh. Loops, how do they work? Sorry about that, tha
}
}
@@ -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;
danakj 2013/08/26 15:55:39 same request here
reveman 2013/08/26 17:16:57 Done.
}
}

Powered by Google App Engine
This is Rietveld 408576698