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

Side by Side Diff: ui/views/animation/square_ink_drop_ripple.cc

Issue 2786543002: Make updates to InkDropHighlight to pave the way for improved ink drops (Closed)
Patch Set: improved docs Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/animation/square_ink_drop_ripple.h" 5 #include "ui/views/animation/square_ink_drop_ripple.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "ui/compositor/layer.h" 10 #include "ui/compositor/layer.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 : activated_shape_(ROUNDED_RECT), 190 : activated_shape_(ROUNDED_RECT),
191 visible_opacity_(visible_opacity), 191 visible_opacity_(visible_opacity),
192 target_center_point_(target_center_point), 192 target_center_point_(target_center_point),
193 large_size_(large_size), 193 large_size_(large_size),
194 large_corner_radius_(large_corner_radius), 194 large_corner_radius_(large_corner_radius),
195 small_size_(small_size), 195 small_size_(small_size),
196 small_corner_radius_(small_corner_radius), 196 small_corner_radius_(small_corner_radius),
197 circle_layer_delegate_(new CircleLayerDelegate( 197 circle_layer_delegate_(new CircleLayerDelegate(
198 color, 198 color,
199 std::min(large_size_.width(), large_size_.height()) / 2)), 199 std::min(large_size_.width(), large_size_.height()) / 2)),
200 rect_layer_delegate_(new RectangleLayerDelegate(color, large_size_)), 200 rect_layer_delegate_(
201 new RectangleLayerDelegate(color, gfx::SizeF(large_size_))),
201 root_layer_(ui::LAYER_NOT_DRAWN) { 202 root_layer_(ui::LAYER_NOT_DRAWN) {
202 root_layer_.set_name("SquareInkDropRipple:ROOT_LAYER"); 203 root_layer_.set_name("SquareInkDropRipple:ROOT_LAYER");
203 204
204 for (int i = 0; i < PAINTED_SHAPE_COUNT; ++i) 205 for (int i = 0; i < PAINTED_SHAPE_COUNT; ++i)
205 AddPaintLayer(static_cast<PaintedShape>(i)); 206 AddPaintLayer(static_cast<PaintedShape>(i));
206 207
207 root_layer_.SetMasksToBounds(false); 208 root_layer_.SetMasksToBounds(false);
208 root_layer_.SetBounds(gfx::Rect(large_size_)); 209 root_layer_.SetBounds(gfx::Rect(large_size_));
209 210
210 gfx::Transform transform; 211 gfx::Transform transform;
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 layer->set_delegate(delegate); 645 layer->set_delegate(delegate);
645 layer->SetVisible(true); 646 layer->SetVisible(true);
646 layer->SetOpacity(1.0); 647 layer->SetOpacity(1.0);
647 layer->SetMasksToBounds(false); 648 layer->SetMasksToBounds(false);
648 layer->set_name("PAINTED_SHAPE_COUNT:" + ToLayerName(painted_shape)); 649 layer->set_name("PAINTED_SHAPE_COUNT:" + ToLayerName(painted_shape));
649 650
650 painted_layers_[painted_shape].reset(layer); 651 painted_layers_[painted_shape].reset(layer);
651 } 652 }
652 653
653 } // namespace views 654 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698