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 <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 virtual ScrollbarLayerImplBase* ToScrollbarLayer(); | 211 virtual ScrollbarLayerImplBase* ToScrollbarLayer(); |
212 | 212 |
213 // Returns true if this layer has content to draw. | 213 // Returns true if this layer has content to draw. |
214 void SetDrawsContent(bool draws_content); | 214 void SetDrawsContent(bool draws_content); |
215 bool DrawsContent() const { return draws_content_; } | 215 bool DrawsContent() const { return draws_content_; } |
216 | 216 |
217 int NumDescendantsThatDrawContent() const; | 217 int NumDescendantsThatDrawContent() const; |
218 void SetHideLayerAndSubtree(bool hide); | 218 void SetHideLayerAndSubtree(bool hide); |
219 bool hide_layer_and_subtree() const { return hide_layer_and_subtree_; } | 219 bool hide_layer_and_subtree() const { return hide_layer_and_subtree_; } |
220 | 220 |
221 bool force_render_surface() const { return force_render_surface_; } | |
222 void SetForceRenderSurface(bool force) { force_render_surface_ = force; } | |
223 | |
224 void SetTransformOrigin(const gfx::Point3F& transform_origin); | 221 void SetTransformOrigin(const gfx::Point3F& transform_origin); |
225 gfx::Point3F transform_origin() const { return transform_origin_; } | 222 gfx::Point3F transform_origin() const { return transform_origin_; } |
226 | 223 |
227 void SetBackgroundColor(SkColor background_color); | 224 void SetBackgroundColor(SkColor background_color); |
228 SkColor background_color() const { return background_color_; } | 225 SkColor background_color() const { return background_color_; } |
229 // If contents_opaque(), return an opaque color else return a | 226 // If contents_opaque(), return an opaque color else return a |
230 // non-opaque color. Tries to return background_color(), if possible. | 227 // non-opaque color. Tries to return background_color(), if possible. |
231 SkColor SafeOpaqueBackgroundColor() const; | 228 SkColor SafeOpaqueBackgroundColor() const; |
232 | 229 |
233 void SetFilters(const FilterOperations& filters); | 230 void SetFilters(const FilterOperations& filters); |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 } | 289 } |
293 bool use_parent_backface_visibility() const { | 290 bool use_parent_backface_visibility() const { |
294 return use_parent_backface_visibility_; | 291 return use_parent_backface_visibility_; |
295 } | 292 } |
296 | 293 |
297 bool ShowDebugBorders() const; | 294 bool ShowDebugBorders() const; |
298 | 295 |
299 // These invalidate the host's render surface layer list. The caller | 296 // These invalidate the host's render surface layer list. The caller |
300 // is responsible for calling set_needs_update_draw_properties on the tree | 297 // is responsible for calling set_needs_update_draw_properties on the tree |
301 // so that its list can be recreated. | 298 // so that its list can be recreated. |
302 void CreateRenderSurface(); | |
303 void ClearRenderSurface(); | |
304 void ClearRenderSurfaceLayerList(); | 299 void ClearRenderSurfaceLayerList(); |
| 300 void SetHasRenderSurface(bool has_render_surface); |
| 301 |
| 302 RenderSurfaceImpl* render_surface() const { return render_surface_.get(); } |
305 | 303 |
306 DrawProperties<LayerImpl>& draw_properties() { | 304 DrawProperties<LayerImpl>& draw_properties() { |
307 return draw_properties_; | 305 return draw_properties_; |
308 } | 306 } |
309 const DrawProperties<LayerImpl>& draw_properties() const { | 307 const DrawProperties<LayerImpl>& draw_properties() const { |
310 return draw_properties_; | 308 return draw_properties_; |
311 } | 309 } |
312 | 310 |
313 // The following are shortcut accessors to get various information from | 311 // The following are shortcut accessors to get various information from |
314 // draw_properties_ | 312 // draw_properties_ |
(...skipping 28 matching lines...) Expand all Loading... |
343 LayerImpl* render_target() { | 341 LayerImpl* render_target() { |
344 DCHECK(!draw_properties_.render_target || | 342 DCHECK(!draw_properties_.render_target || |
345 draw_properties_.render_target->render_surface()); | 343 draw_properties_.render_target->render_surface()); |
346 return draw_properties_.render_target; | 344 return draw_properties_.render_target; |
347 } | 345 } |
348 const LayerImpl* render_target() const { | 346 const LayerImpl* render_target() const { |
349 DCHECK(!draw_properties_.render_target || | 347 DCHECK(!draw_properties_.render_target || |
350 draw_properties_.render_target->render_surface()); | 348 draw_properties_.render_target->render_surface()); |
351 return draw_properties_.render_target; | 349 return draw_properties_.render_target; |
352 } | 350 } |
353 RenderSurfaceImpl* render_surface() const { | 351 |
354 return draw_properties_.render_surface.get(); | |
355 } | |
356 int num_unclipped_descendants() const { | 352 int num_unclipped_descendants() const { |
357 return draw_properties_.num_unclipped_descendants; | 353 return draw_properties_.num_unclipped_descendants; |
358 } | 354 } |
359 | 355 |
360 // The client should be responsible for setting bounds, content bounds and | 356 // The client should be responsible for setting bounds, content bounds and |
361 // contents scale to appropriate values. LayerImpl doesn't calculate any of | 357 // contents scale to appropriate values. LayerImpl doesn't calculate any of |
362 // them from the other values. | 358 // them from the other values. |
363 | 359 |
364 void SetBounds(const gfx::Size& bounds); | 360 void SetBounds(const gfx::Size& bounds); |
365 gfx::Size bounds() const; | 361 gfx::Size bounds() const; |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 // Tracks if drawing-related properties have changed since last redraw. | 619 // Tracks if drawing-related properties have changed since last redraw. |
624 bool layer_property_changed_ : 1; | 620 bool layer_property_changed_ : 1; |
625 | 621 |
626 bool masks_to_bounds_ : 1; | 622 bool masks_to_bounds_ : 1; |
627 bool contents_opaque_ : 1; | 623 bool contents_opaque_ : 1; |
628 bool is_root_for_isolated_group_ : 1; | 624 bool is_root_for_isolated_group_ : 1; |
629 bool use_parent_backface_visibility_ : 1; | 625 bool use_parent_backface_visibility_ : 1; |
630 bool draw_checkerboard_for_missing_tiles_ : 1; | 626 bool draw_checkerboard_for_missing_tiles_ : 1; |
631 bool draws_content_ : 1; | 627 bool draws_content_ : 1; |
632 bool hide_layer_and_subtree_ : 1; | 628 bool hide_layer_and_subtree_ : 1; |
633 bool force_render_surface_ : 1; | |
634 | 629 |
635 // Cache transform_'s invertibility. | 630 // Cache transform_'s invertibility. |
636 bool transform_is_invertible_ : 1; | 631 bool transform_is_invertible_ : 1; |
637 | 632 |
638 // Set for the layer that other layers are fixed to. | 633 // Set for the layer that other layers are fixed to. |
639 bool is_container_for_fixed_position_layers_ : 1; | 634 bool is_container_for_fixed_position_layers_ : 1; |
640 Region non_fast_scrollable_region_; | 635 Region non_fast_scrollable_region_; |
641 Region touch_event_handler_region_; | 636 Region touch_event_handler_region_; |
642 SkColor background_color_; | 637 SkColor background_color_; |
643 | 638 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 | 692 |
698 scoped_ptr<ScrollbarSet> scrollbars_; | 693 scoped_ptr<ScrollbarSet> scrollbars_; |
699 | 694 |
700 ScopedPtrVector<CopyOutputRequest> copy_requests_; | 695 ScopedPtrVector<CopyOutputRequest> copy_requests_; |
701 | 696 |
702 // Group of properties that need to be computed based on the layer tree | 697 // Group of properties that need to be computed based on the layer tree |
703 // hierarchy before layers can be drawn. | 698 // hierarchy before layers can be drawn. |
704 DrawProperties<LayerImpl> draw_properties_; | 699 DrawProperties<LayerImpl> draw_properties_; |
705 | 700 |
706 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_; | 701 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_; |
707 | 702 scoped_ptr<RenderSurfaceImpl> render_surface_; |
708 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 703 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
709 }; | 704 }; |
710 | 705 |
711 } // namespace cc | 706 } // namespace cc |
712 | 707 |
713 #endif // CC_LAYERS_LAYER_IMPL_H_ | 708 #endif // CC_LAYERS_LAYER_IMPL_H_ |
OLD | NEW |