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

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

Issue 2640983002: Rename paint data structures (Closed)
Patch Set: DrawingDisplayItem Created 3 years, 10 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
« no previous file with comments | « ui/views/DEPS ('k') | ui/views/animation/ink_drop_painted_layer_delegates.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/ink_drop_mask.h" 5 #include "ui/views/animation/ink_drop_mask.h"
6 6
7 #include "third_party/skia/include/core/SkPaint.h" 7 #include "cc/paint/paint_flags.h"
8 #include "ui/compositor/paint_recorder.h" 8 #include "ui/compositor/paint_recorder.h"
9 #include "ui/gfx/canvas.h" 9 #include "ui/gfx/canvas.h"
10 10
11 namespace views { 11 namespace views {
12 12
13 // InkDropMask 13 // InkDropMask
14 14
15 InkDropMask::InkDropMask(const gfx::Size& layer_size) 15 InkDropMask::InkDropMask(const gfx::Size& layer_size)
16 : layer_(ui::LAYER_TEXTURED) { 16 : layer_(ui::LAYER_TEXTURED) {
17 layer_.set_delegate(this); 17 layer_.set_delegate(this);
(...skipping 17 matching lines...) Expand all
35 // RoundRectInkDropMask 35 // RoundRectInkDropMask
36 36
37 RoundRectInkDropMask::RoundRectInkDropMask(const gfx::Size& layer_size, 37 RoundRectInkDropMask::RoundRectInkDropMask(const gfx::Size& layer_size,
38 const gfx::Insets& mask_insets, 38 const gfx::Insets& mask_insets,
39 int corner_radius) 39 int corner_radius)
40 : InkDropMask(layer_size), 40 : InkDropMask(layer_size),
41 mask_insets_(mask_insets), 41 mask_insets_(mask_insets),
42 corner_radius_(corner_radius) {} 42 corner_radius_(corner_radius) {}
43 43
44 void RoundRectInkDropMask::OnPaintLayer(const ui::PaintContext& context) { 44 void RoundRectInkDropMask::OnPaintLayer(const ui::PaintContext& context) {
45 SkPaint paint; 45 cc::PaintFlags paint;
46 paint.setAlpha(255); 46 paint.setAlpha(255);
47 paint.setStyle(SkPaint::kFill_Style); 47 paint.setStyle(cc::PaintFlags::kFill_Style);
48 paint.setAntiAlias(true); 48 paint.setAntiAlias(true);
49 49
50 ui::PaintRecorder recorder(context, layer()->size()); 50 ui::PaintRecorder recorder(context, layer()->size());
51 gfx::Rect bounds = layer()->bounds(); 51 gfx::Rect bounds = layer()->bounds();
52 bounds.Inset(mask_insets_); 52 bounds.Inset(mask_insets_);
53 recorder.canvas()->DrawRoundRect(bounds, corner_radius_, paint); 53 recorder.canvas()->DrawRoundRect(bounds, corner_radius_, paint);
54 } 54 }
55 55
56 // CircleInkDropMask 56 // CircleInkDropMask
57 57
58 CircleInkDropMask::CircleInkDropMask(const gfx::Size& layer_size, 58 CircleInkDropMask::CircleInkDropMask(const gfx::Size& layer_size,
59 const gfx::Point& mask_center, 59 const gfx::Point& mask_center,
60 int mask_radius) 60 int mask_radius)
61 : InkDropMask(layer_size), 61 : InkDropMask(layer_size),
62 mask_center_(mask_center), 62 mask_center_(mask_center),
63 mask_radius_(mask_radius) {} 63 mask_radius_(mask_radius) {}
64 64
65 void CircleInkDropMask::OnPaintLayer(const ui::PaintContext& context) { 65 void CircleInkDropMask::OnPaintLayer(const ui::PaintContext& context) {
66 SkPaint paint; 66 cc::PaintFlags paint;
67 paint.setAlpha(255); 67 paint.setAlpha(255);
68 paint.setStyle(SkPaint::kFill_Style); 68 paint.setStyle(cc::PaintFlags::kFill_Style);
69 paint.setAntiAlias(true); 69 paint.setAntiAlias(true);
70 70
71 ui::PaintRecorder recorder(context, layer()->size()); 71 ui::PaintRecorder recorder(context, layer()->size());
72 recorder.canvas()->DrawCircle(mask_center_, mask_radius_, paint); 72 recorder.canvas()->DrawCircle(mask_center_, mask_radius_, paint);
73 } 73 }
74 74
75 } // namespace views 75 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/DEPS ('k') | ui/views/animation/ink_drop_painted_layer_delegates.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698