OLD | NEW |
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 #ifndef UI_VIEWS_ANIMATION_INK_DROP_PAINTED_LAYER_DELEGATES_H_ | 5 #ifndef UI_VIEWS_ANIMATION_INK_DROP_PAINTED_LAYER_DELEGATES_H_ |
6 #define UI_VIEWS_ANIMATION_INK_DROP_PAINTED_LAYER_DELEGATES_H_ | 6 #define UI_VIEWS_ANIMATION_INK_DROP_PAINTED_LAYER_DELEGATES_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 // color, size and corner radius. | 85 // color, size and corner radius. |
86 class RoundedRectangleLayerDelegate : public BasePaintedLayerDelegate { | 86 class RoundedRectangleLayerDelegate : public BasePaintedLayerDelegate { |
87 public: | 87 public: |
88 RoundedRectangleLayerDelegate(SkColor color, | 88 RoundedRectangleLayerDelegate(SkColor color, |
89 gfx::Size size, | 89 gfx::Size size, |
90 int corner_radius); | 90 int corner_radius); |
91 ~RoundedRectangleLayerDelegate() override; | 91 ~RoundedRectangleLayerDelegate() override; |
92 | 92 |
93 const gfx::Size& size() const { return size_; } | 93 const gfx::Size& size() const { return size_; } |
94 | 94 |
95 // ui::LayerDelegate: | 95 // BasePaintedLayerDelegate: |
96 gfx::PointF GetCenterPoint() const override; | 96 gfx::PointF GetCenterPoint() const override; |
97 void OnPaintLayer(const ui::PaintContext& context) override; | 97 void OnPaintLayer(const ui::PaintContext& context) override; |
98 | 98 |
99 private: | 99 private: |
100 // The size of the rectangle. | 100 // The size of the rectangle. |
101 gfx::Size size_; | 101 gfx::Size size_; |
102 | 102 |
103 // The radius of the corners. | 103 // The radius of the corners. |
104 int corner_radius_; | 104 int corner_radius_; |
105 | 105 |
106 DISALLOW_COPY_AND_ASSIGN(RoundedRectangleLayerDelegate); | 106 DISALLOW_COPY_AND_ASSIGN(RoundedRectangleLayerDelegate); |
107 }; | 107 }; |
108 | 108 |
109 } // namespace views | 109 } // namespace views |
110 | 110 |
111 #endif // UI_VIEWS_ANIMATION_INK_DROP_PAINTED_LAYER_DELEGATES_H_ | 111 #endif // UI_VIEWS_ANIMATION_INK_DROP_PAINTED_LAYER_DELEGATES_H_ |
OLD | NEW |