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

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

Issue 1820913003: Increased Canvas size for the CircleLayerDelegate that is used for MD ripples. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: Created 4 years, 9 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_painted_layer_delegates.h" 5 #include "ui/views/animation/ink_drop_painted_layer_delegates.h"
6 6
7 #include "third_party/skia/include/core/SkPaint.h" 7 #include "third_party/skia/include/core/SkPaint.h"
8 #include "ui/compositor/paint_recorder.h" 8 #include "ui/compositor/paint_recorder.h"
9 #include "ui/gfx/geometry/point.h" 9 #include "ui/gfx/geometry/point.h"
10 #include "ui/gfx/geometry/point_conversions.h" 10 #include "ui/gfx/geometry/point_conversions.h"
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 gfx::PointF CircleLayerDelegate::GetCenterPoint() const { 45 gfx::PointF CircleLayerDelegate::GetCenterPoint() const {
46 return gfx::PointF(radius_, radius_); 46 return gfx::PointF(radius_, radius_);
47 } 47 }
48 48
49 void CircleLayerDelegate::OnPaintLayer(const ui::PaintContext& context) { 49 void CircleLayerDelegate::OnPaintLayer(const ui::PaintContext& context) {
50 SkPaint paint; 50 SkPaint paint;
51 paint.setColor(color()); 51 paint.setColor(color());
52 paint.setFlags(SkPaint::kAntiAlias_Flag); 52 paint.setFlags(SkPaint::kAntiAlias_Flag);
53 paint.setStyle(SkPaint::kFill_Style); 53 paint.setStyle(SkPaint::kFill_Style);
54 54
55 ui::PaintRecorder recorder(context, gfx::Size(radius_, radius_)); 55 ui::PaintRecorder recorder(context, gfx::Size(2 * radius_, 2 * radius_));
56 gfx::Canvas* canvas = recorder.canvas(); 56 gfx::Canvas* canvas = recorder.canvas();
57 57
58 canvas->DrawCircle(ToRoundedPoint(GetCenterPoint()), radius_, paint); 58 canvas->DrawCircle(ToRoundedPoint(GetCenterPoint()), radius_, paint);
59 } 59 }
60 60
61 //////////////////////////////////////////////////////////////////////////////// 61 ////////////////////////////////////////////////////////////////////////////////
62 // 62 //
63 // RectangleLayerDelegate 63 // RectangleLayerDelegate
64 // 64 //
65 65
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 paint.setColor(color()); 107 paint.setColor(color());
108 paint.setFlags(SkPaint::kAntiAlias_Flag); 108 paint.setFlags(SkPaint::kAntiAlias_Flag);
109 paint.setStyle(SkPaint::kFill_Style); 109 paint.setStyle(SkPaint::kFill_Style);
110 110
111 ui::PaintRecorder recorder(context, size_); 111 ui::PaintRecorder recorder(context, size_);
112 gfx::Canvas* canvas = recorder.canvas(); 112 gfx::Canvas* canvas = recorder.canvas();
113 canvas->DrawRoundRect(gfx::Rect(size_), corner_radius_, paint); 113 canvas->DrawRoundRect(gfx::Rect(size_), corner_radius_, paint);
114 } 114 }
115 115
116 } // namespace views 116 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698