OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 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 CC_LAYERS_LAYER_IMPL_H_ | 5 #ifndef CC_LAYERS_LAYER_IMPL_H_ |
6 #define CC_LAYERS_LAYER_IMPL_H_ | 6 #define CC_LAYERS_LAYER_IMPL_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 // These invalidate the host's render surface layer list. The caller | 352 // These invalidate the host's render surface layer list. The caller |
353 // is responsible for calling set_needs_update_draw_properties on the tree | 353 // is responsible for calling set_needs_update_draw_properties on the tree |
354 // so that its list can be recreated. | 354 // so that its list can be recreated. |
355 void ClearRenderSurfaceLayerList(); | 355 void ClearRenderSurfaceLayerList(); |
356 void SetHasRenderSurface(bool has_render_surface); | 356 void SetHasRenderSurface(bool has_render_surface); |
357 | 357 |
358 void SetForceRenderSurface(bool has_render_surface); | 358 void SetForceRenderSurface(bool has_render_surface); |
359 | 359 |
360 RenderSurfaceImpl* render_surface() const { return render_surface_.get(); } | 360 RenderSurfaceImpl* render_surface() const { return render_surface_.get(); } |
361 | 361 |
| 362 // The render surface which this layer draws into. This can be either owned by |
| 363 // the same layer or an ancestor of this layer. |
| 364 RenderSurfaceImpl* render_target(); |
| 365 const RenderSurfaceImpl* render_target() const; |
| 366 |
362 DrawProperties& draw_properties() { return draw_properties_; } | 367 DrawProperties& draw_properties() { return draw_properties_; } |
363 const DrawProperties& draw_properties() const { return draw_properties_; } | 368 const DrawProperties& draw_properties() const { return draw_properties_; } |
364 | 369 |
365 gfx::Transform DrawTransform() const; | 370 gfx::Transform DrawTransform() const; |
366 gfx::Transform ScreenSpaceTransform() const; | 371 gfx::Transform ScreenSpaceTransform() const; |
367 PerformanceProperties<LayerImpl>& performance_properties() { | 372 PerformanceProperties<LayerImpl>& performance_properties() { |
368 return performance_properties_; | 373 return performance_properties_; |
369 } | 374 } |
370 | 375 |
371 // Setter for draw_properties_. | 376 // Setter for draw_properties_. |
(...skipping 11 matching lines...) Expand all Loading... |
383 return draw_properties_.screen_space_transform_is_animating; | 388 return draw_properties_.screen_space_transform_is_animating; |
384 } | 389 } |
385 bool can_use_lcd_text() const { return draw_properties_.can_use_lcd_text; } | 390 bool can_use_lcd_text() const { return draw_properties_.can_use_lcd_text; } |
386 gfx::Rect clip_rect() const { return draw_properties_.clip_rect; } | 391 gfx::Rect clip_rect() const { return draw_properties_.clip_rect; } |
387 gfx::Rect drawable_content_rect() const { | 392 gfx::Rect drawable_content_rect() const { |
388 return draw_properties_.drawable_content_rect; | 393 return draw_properties_.drawable_content_rect; |
389 } | 394 } |
390 gfx::Rect visible_layer_rect() const { | 395 gfx::Rect visible_layer_rect() const { |
391 return draw_properties_.visible_layer_rect; | 396 return draw_properties_.visible_layer_rect; |
392 } | 397 } |
393 LayerImpl* render_target() { | |
394 DCHECK(!draw_properties_.render_target || | |
395 draw_properties_.render_target->render_surface()); | |
396 return draw_properties_.render_target; | |
397 } | |
398 const LayerImpl* render_target() const { | |
399 DCHECK(!draw_properties_.render_target || | |
400 draw_properties_.render_target->render_surface()); | |
401 return draw_properties_.render_target; | |
402 } | |
403 | |
404 size_t num_unclipped_descendants() const { | 398 size_t num_unclipped_descendants() const { |
405 return draw_properties_.num_unclipped_descendants; | 399 return draw_properties_.num_unclipped_descendants; |
406 } | 400 } |
407 | 401 |
408 // The client should be responsible for setting bounds, content bounds and | 402 // The client should be responsible for setting bounds, content bounds and |
409 // contents scale to appropriate values. LayerImpl doesn't calculate any of | 403 // contents scale to appropriate values. LayerImpl doesn't calculate any of |
410 // them from the other values. | 404 // them from the other values. |
411 | 405 |
412 void SetBounds(const gfx::Size& bounds); | 406 void SetBounds(const gfx::Size& bounds); |
413 gfx::Size bounds() const; | 407 gfx::Size bounds() const; |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
767 bool layer_or_descendant_is_drawn_; | 761 bool layer_or_descendant_is_drawn_; |
768 // If true, the layer or one of its descendants has a touch handler. | 762 // If true, the layer or one of its descendants has a touch handler. |
769 bool layer_or_descendant_has_touch_handler_; | 763 bool layer_or_descendant_has_touch_handler_; |
770 | 764 |
771 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 765 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
772 }; | 766 }; |
773 | 767 |
774 } // namespace cc | 768 } // namespace cc |
775 | 769 |
776 #endif // CC_LAYERS_LAYER_IMPL_H_ | 770 #endif // CC_LAYERS_LAYER_IMPL_H_ |
OLD | NEW |