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_GFX_COMPOSITOR_LAYER_H_ | 5 #ifndef UI_GFX_COMPOSITOR_LAYER_H_ |
6 #define UI_GFX_COMPOSITOR_LAYER_H_ | 6 #define UI_GFX_COMPOSITOR_LAYER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 void set_name(const std::string& name) { name_ = name; } | 156 void set_name(const std::string& name) { name_ = name; } |
157 | 157 |
158 const ui::Texture* texture() const { return texture_.get(); } | 158 const ui::Texture* texture() const { return texture_.get(); } |
159 | 159 |
160 // Assigns a new external texture. |texture| can be NULL to disable external | 160 // Assigns a new external texture. |texture| can be NULL to disable external |
161 // updates. | 161 // updates. |
162 // TODO(beng): This can be removed from the API when we are in a | 162 // TODO(beng): This can be removed from the API when we are in a |
163 // single-compositor world. | 163 // single-compositor world. |
164 void SetExternalTexture(ui::Texture* texture); | 164 void SetExternalTexture(ui::Texture* texture); |
165 | 165 |
166 // Resets the canvas of the texture. | |
167 void SetCanvas(const SkCanvas& canvas, const gfx::Point& origin); | |
168 | |
169 // Adds |invalid_rect| to the Layer's pending invalid rect and calls | 166 // Adds |invalid_rect| to the Layer's pending invalid rect and calls |
170 // ScheduleDraw(). | 167 // ScheduleDraw(). |
171 void SchedulePaint(const gfx::Rect& invalid_rect); | 168 void SchedulePaint(const gfx::Rect& invalid_rect); |
172 | 169 |
173 // Schedules a redraw of the layer tree at the compositor. | 170 // Schedules a redraw of the layer tree at the compositor. |
174 void ScheduleDraw(); | 171 void ScheduleDraw(); |
175 | 172 |
176 // Sometimes the Layer is being updated by something other than SetCanvas | 173 // Sometimes the Layer is being updated by something other than SetCanvas |
177 // (e.g. the GPU process on UI_COMPOSITOR_IMAGE_TRANSPORT). | 174 // (e.g. the GPU process on UI_COMPOSITOR_IMAGE_TRANSPORT). |
178 bool layer_updated_externally() const { return layer_updated_externally_; } | 175 bool layer_updated_externally() const { return layer_updated_externally_; } |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 WebKit::WebLayer web_layer_; | 267 WebKit::WebLayer web_layer_; |
271 bool web_layer_is_accelerated_; | 268 bool web_layer_is_accelerated_; |
272 bool show_debug_borders_; | 269 bool show_debug_borders_; |
273 | 270 |
274 DISALLOW_COPY_AND_ASSIGN(Layer); | 271 DISALLOW_COPY_AND_ASSIGN(Layer); |
275 }; | 272 }; |
276 | 273 |
277 } // namespace ui | 274 } // namespace ui |
278 | 275 |
279 #endif // UI_GFX_COMPOSITOR_LAYER_H_ | 276 #endif // UI_GFX_COMPOSITOR_LAYER_H_ |
OLD | NEW |