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

Unified Diff: cc/layers/layer.cc

Issue 2016203002: Widget opacity goes from 0 to 1, not 0 to 255. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resync Created 4 years, 7 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/layers/layer.cc
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index a1258a64d5d798a27418a5eb0c4b4697a687dd10..4aaeade757203fe7437a3619fd88e2218636e3de 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -467,6 +467,9 @@ void Layer::SetBackgroundFilters(const FilterOperations& filters) {
void Layer::SetOpacity(float opacity) {
DCHECK(IsPropertyChangeAllowed());
+ DCHECK_GE(opacity, 0.f);
+ DCHECK_LE(opacity, 1.f);
+
if (opacity_ == opacity)
return;
// We need to force a property tree rebuild when opacity changes from 1 to a
@@ -1613,6 +1616,9 @@ void Layer::OnFilterAnimated(const FilterOperations& filters) {
}
void Layer::OnOpacityAnimated(float opacity) {
+ DCHECK_GE(opacity, 0.f);
+ DCHECK_LE(opacity, 1.f);
+
if (opacity_ == opacity)
return;
opacity_ = opacity;
« no previous file with comments | « ash/wm/overview/window_grid.cc ('k') | chrome/browser/ui/views/download/download_started_animation_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698