| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_GFX_COMPOSITOR_COMPOSITOR_H_ | 5 #ifndef UI_GFX_COMPOSITOR_COMPOSITOR_H_ |
| 6 #define UI_GFX_COMPOSITOR_COMPOSITOR_H_ | 6 #define UI_GFX_COMPOSITOR_COMPOSITOR_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 | 115 |
| 116 // Creates a new texture. The caller owns the returned object. | 116 // Creates a new texture. The caller owns the returned object. |
| 117 virtual Texture* CreateTexture() = 0; | 117 virtual Texture* CreateTexture() = 0; |
| 118 | 118 |
| 119 // Blurs the specific region in the compositor. | 119 // Blurs the specific region in the compositor. |
| 120 virtual void Blur(const gfx::Rect& bounds) = 0; | 120 virtual void Blur(const gfx::Rect& bounds) = 0; |
| 121 | 121 |
| 122 // Schedules a redraw of the layer tree associated with this compositor. | 122 // Schedules a redraw of the layer tree associated with this compositor. |
| 123 virtual void ScheduleDraw(); | 123 virtual void ScheduleDraw(); |
| 124 | 124 |
| 125 // Sets the root of the layer tree drawn by this Compositor. | 125 // Sets the root of the layer tree drawn by this Compositor. The root layer |
| 126 // must have no parent. The compositor's root layer is reset if the root layer |
| 127 // is destroyed. NULL can be passed to reset the root layer, in which case the |
| 128 // compositor will stop drawing anything. |
| 126 // The Compositor does not own the root layer. | 129 // The Compositor does not own the root layer. |
| 127 const Layer* root_layer() const { return root_layer_; } | 130 const Layer* root_layer() const { return root_layer_; } |
| 128 Layer* root_layer() { return root_layer_; } | 131 Layer* root_layer() { return root_layer_; } |
| 129 void SetRootLayer(Layer* root_layer); | 132 void SetRootLayer(Layer* root_layer); |
| 130 | 133 |
| 131 // Draws the scene created by the layer tree and any visual effects. If | 134 // Draws the scene created by the layer tree and any visual effects. If |
| 132 // |force_clear| is true, this will cause the compositor to clear before | 135 // |force_clear| is true, this will cause the compositor to clear before |
| 133 // compositing. | 136 // compositing. |
| 134 void Draw(bool force_clear); | 137 void Draw(bool force_clear); |
| 135 | 138 |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 // calls to it. | 210 // calls to it. |
| 208 static ui::Compositor*(*compositor_factory_)( | 211 static ui::Compositor*(*compositor_factory_)( |
| 209 ui::CompositorDelegate* delegate); | 212 ui::CompositorDelegate* delegate); |
| 210 | 213 |
| 211 friend class base::RefCounted<Compositor>; | 214 friend class base::RefCounted<Compositor>; |
| 212 }; | 215 }; |
| 213 | 216 |
| 214 } // namespace ui | 217 } // namespace ui |
| 215 | 218 |
| 216 #endif // UI_GFX_COMPOSITOR_COMPOSITOR_H_ | 219 #endif // UI_GFX_COMPOSITOR_COMPOSITOR_H_ |
| OLD | NEW |