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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 // The Compositor does not own the root layer. | 129 // The Compositor does not own the root layer. |
130 const Layer* root_layer() const { return root_layer_; } | 130 const Layer* root_layer() const { return root_layer_; } |
131 Layer* root_layer() { return root_layer_; } | 131 Layer* root_layer() { return root_layer_; } |
132 void SetRootLayer(Layer* root_layer); | 132 void SetRootLayer(Layer* root_layer); |
133 | 133 |
134 // 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 |
135 // |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 |
136 // compositing. | 136 // compositing. |
137 void Draw(bool force_clear); | 137 void Draw(bool force_clear); |
138 | 138 |
139 // Reads the contents of the last rendered frame into the given bitmap. | 139 // Reads the region |bounds| of the contents of the last rendered frame |
| 140 // into the given bitmap. |
140 // Returns false if the pixels could not be read. | 141 // Returns false if the pixels could not be read. |
141 virtual bool ReadPixels(SkBitmap* bitmap) = 0; | 142 virtual bool ReadPixels(SkBitmap* bitmap, const gfx::Rect& bounds) = 0; |
142 | 143 |
143 // Notifies the compositor that the size of the widget that it is | 144 // Notifies the compositor that the size of the widget that it is |
144 // drawing to has changed. | 145 // drawing to has changed. |
145 void WidgetSizeChanged(const gfx::Size& size) { | 146 void WidgetSizeChanged(const gfx::Size& size) { |
146 if (size.IsEmpty()) | 147 if (size.IsEmpty()) |
147 return; | 148 return; |
148 size_ = size; | 149 size_ = size; |
149 OnWidgetSizeChanged(); | 150 OnWidgetSizeChanged(); |
150 } | 151 } |
151 | 152 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 // calls to it. | 211 // calls to it. |
211 static ui::Compositor*(*compositor_factory_)( | 212 static ui::Compositor*(*compositor_factory_)( |
212 ui::CompositorDelegate* delegate); | 213 ui::CompositorDelegate* delegate); |
213 | 214 |
214 friend class base::RefCounted<Compositor>; | 215 friend class base::RefCounted<Compositor>; |
215 }; | 216 }; |
216 | 217 |
217 } // namespace ui | 218 } // namespace ui |
218 | 219 |
219 #endif // UI_GFX_COMPOSITOR_COMPOSITOR_H_ | 220 #endif // UI_GFX_COMPOSITOR_COMPOSITOR_H_ |
OLD | NEW |