| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 // The size of the rectangle. | 107 // The size of the rectangle. |
| 108 gfx::Size size_; | 108 gfx::Size size_; |
| 109 | 109 |
| 110 // The radius of the corners. | 110 // The radius of the corners. |
| 111 int corner_radius_; | 111 int corner_radius_; |
| 112 | 112 |
| 113 DISALLOW_COPY_AND_ASSIGN(RoundedRectangleLayerDelegate); | 113 DISALLOW_COPY_AND_ASSIGN(RoundedRectangleLayerDelegate); |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 // A BasePaintedLayerDelegate that paints a shadow around the outside of a | 116 // A BasePaintedLayerDelegate that paints a shadow around the outside of a |
| 117 // specified roundrect. | 117 // specified roundrect, and also fills the round rect. |
| 118 class VIEWS_EXPORT BorderShadowLayerDelegate : public BasePaintedLayerDelegate { | 118 class VIEWS_EXPORT BorderShadowLayerDelegate : public BasePaintedLayerDelegate { |
| 119 public: | 119 public: |
| 120 BorderShadowLayerDelegate(const std::vector<gfx::ShadowValue>& shadows, | 120 BorderShadowLayerDelegate(const std::vector<gfx::ShadowValue>& shadows, |
| 121 const gfx::Rect& shadowed_area_bounds, | 121 const gfx::Rect& shadowed_area_bounds, |
| 122 SkColor fill_color, |
| 122 int corner_radius); | 123 int corner_radius); |
| 123 ~BorderShadowLayerDelegate() override; | 124 ~BorderShadowLayerDelegate() override; |
| 124 | 125 |
| 125 // BasePaintedLayerDelegate: | 126 // BasePaintedLayerDelegate: |
| 126 gfx::Rect GetPaintedBounds() const override; | 127 gfx::Rect GetPaintedBounds() const override; |
| 127 gfx::Vector2dF GetCenteringOffset() const override; | 128 gfx::Vector2dF GetCenteringOffset() const override; |
| 128 void OnPaintLayer(const ui::PaintContext& context) override; | 129 void OnPaintLayer(const ui::PaintContext& context) override; |
| 129 | 130 |
| 130 private: | 131 private: |
| 131 gfx::Rect GetTotalRect() const; | 132 gfx::Rect GetTotalRect() const; |
| 132 | 133 |
| 133 const std::vector<gfx::ShadowValue> shadows_; | 134 const std::vector<gfx::ShadowValue> shadows_; |
| 134 | 135 |
| 135 // The bounds of the shadowed area. | 136 // The bounds of the shadowed area. |
| 136 gfx::Rect bounds_; | 137 const gfx::Rect bounds_; |
| 137 | 138 |
| 138 int corner_radius_; | 139 const SkColor fill_color_; |
| 140 |
| 141 const int corner_radius_; |
| 139 | 142 |
| 140 DISALLOW_COPY_AND_ASSIGN(BorderShadowLayerDelegate); | 143 DISALLOW_COPY_AND_ASSIGN(BorderShadowLayerDelegate); |
| 141 }; | 144 }; |
| 142 | 145 |
| 143 } // namespace views | 146 } // namespace views |
| 144 | 147 |
| 145 #endif // UI_VIEWS_ANIMATION_INK_DROP_PAINTED_LAYER_DELEGATES_H_ | 148 #endif // UI_VIEWS_ANIMATION_INK_DROP_PAINTED_LAYER_DELEGATES_H_ |
| OLD | NEW |