OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_COMPOSITOR_LAYER_DELEGATE_H_ | 5 #ifndef UI_COMPOSITOR_LAYER_DELEGATE_H_ |
6 #define UI_COMPOSITOR_LAYER_DELEGATE_H_ | 6 #define UI_COMPOSITOR_LAYER_DELEGATE_H_ |
7 | 7 |
8 #include "base/callback_forward.h" | 8 #include "base/callback_forward.h" |
9 #include "ui/compositor/compositor_export.h" | 9 #include "ui/compositor/compositor_export.h" |
10 | 10 |
11 namespace gfx { | 11 namespace gfx { |
12 class Canvas; | 12 class Canvas; |
13 class Rect; | |
13 } | 14 } |
14 | 15 |
15 namespace ui { | 16 namespace ui { |
16 | 17 |
17 // A delegate interface implemented by an object that renders to a Layer. | 18 // A delegate interface implemented by an object that renders to a Layer. |
18 class COMPOSITOR_EXPORT LayerDelegate { | 19 class COMPOSITOR_EXPORT LayerDelegate { |
19 public: | 20 public: |
20 // Paint content for the layer to the specified canvas. It has already been | 21 // Paint content for the layer to the specified canvas. It has already been |
21 // clipped to the Layer's invalid rect. | 22 // clipped to the Layer's invalid rect. |
22 virtual void OnPaintLayer(gfx::Canvas* canvas) = 0; | 23 virtual void OnPaintLayer(gfx::Canvas* canvas) = 0; |
23 | 24 |
25 // A notification that some sublayer in the tree has had a delegated | |
danakj
2014/08/18 20:01:49
that this layer not sublayer?
enne (OOO)
2014/08/18 23:32:21
Done.
| |
26 // frame swap and will be repainted. | |
27 virtual void OnDelegatedFrameDamage(const gfx::Rect& damage_rect_in_dip) = 0; | |
28 | |
24 // Called when the layer's device scale factor has changed. | 29 // Called when the layer's device scale factor has changed. |
25 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) = 0; | 30 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) = 0; |
26 | 31 |
27 // Invoked prior to the bounds changing. The returned closured is run after | 32 // Invoked prior to the bounds changing. The returned closured is run after |
28 // the bounds change. | 33 // the bounds change. |
29 virtual base::Closure PrepareForLayerBoundsChange() = 0; | 34 virtual base::Closure PrepareForLayerBoundsChange() = 0; |
30 | 35 |
31 protected: | 36 protected: |
32 virtual ~LayerDelegate() {} | 37 virtual ~LayerDelegate() {} |
33 }; | 38 }; |
34 | 39 |
35 } // namespace ui | 40 } // namespace ui |
36 | 41 |
37 #endif // UI_COMPOSITOR_LAYER_DELEGATE_H_ | 42 #endif // UI_COMPOSITOR_LAYER_DELEGATE_H_ |
OLD | NEW |