OLD | NEW |
---|---|
1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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_H_ | 5 #ifndef CC_LAYERS_LAYER_H_ |
6 #define CC_LAYERS_LAYER_H_ | 6 #define CC_LAYERS_LAYER_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
247 Layer* render_target() { | 247 Layer* render_target() { |
248 DCHECK(!draw_properties_.render_target || | 248 DCHECK(!draw_properties_.render_target || |
249 draw_properties_.render_target->render_surface()); | 249 draw_properties_.render_target->render_surface()); |
250 return draw_properties_.render_target; | 250 return draw_properties_.render_target; |
251 } | 251 } |
252 const Layer* render_target() const { | 252 const Layer* render_target() const { |
253 DCHECK(!draw_properties_.render_target || | 253 DCHECK(!draw_properties_.render_target || |
254 draw_properties_.render_target->render_surface()); | 254 draw_properties_.render_target->render_surface()); |
255 return draw_properties_.render_target; | 255 return draw_properties_.render_target; |
256 } | 256 } |
257 RenderSurface* render_surface() const { | 257 RenderSurface* render_surface() const { return render_surface_.get(); } |
danakj
2014/08/26 18:06:13
nit: can you move this out of the middle of the dr
awoloszyn
2014/08/28 19:31:42
Done.
| |
258 return draw_properties_.render_surface.get(); | |
259 } | |
260 int num_unclipped_descendants() const { | 258 int num_unclipped_descendants() const { |
261 return draw_properties_.num_unclipped_descendants; | 259 return draw_properties_.num_unclipped_descendants; |
262 } | 260 } |
263 | 261 |
264 void SetScrollOffset(gfx::Vector2d scroll_offset); | 262 void SetScrollOffset(gfx::Vector2d scroll_offset); |
265 gfx::Vector2d scroll_offset() const { return scroll_offset_; } | 263 gfx::Vector2d scroll_offset() const { return scroll_offset_; } |
266 void SetScrollOffsetFromImplSide(const gfx::Vector2d& scroll_offset); | 264 void SetScrollOffsetFromImplSide(const gfx::Vector2d& scroll_offset); |
267 | 265 |
268 void SetScrollClipLayerId(int clip_layer_id); | 266 void SetScrollClipLayerId(int clip_layer_id); |
269 bool scrollable() const { return scroll_clip_layer_id_ != INVALID_ID; } | 267 bool scrollable() const { return scroll_clip_layer_id_ != INVALID_ID; } |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
369 virtual bool IsSuitableForGpuRasterization() const; | 367 virtual bool IsSuitableForGpuRasterization() const; |
370 | 368 |
371 virtual scoped_refptr<base::debug::ConvertableToTraceFormat> TakeDebugInfo(); | 369 virtual scoped_refptr<base::debug::ConvertableToTraceFormat> TakeDebugInfo(); |
372 | 370 |
373 void SetLayerClient(LayerClient* client) { client_ = client; } | 371 void SetLayerClient(LayerClient* client) { client_ = client; } |
374 | 372 |
375 virtual void PushPropertiesTo(LayerImpl* layer); | 373 virtual void PushPropertiesTo(LayerImpl* layer); |
376 | 374 |
377 void CreateRenderSurface(); | 375 void CreateRenderSurface(); |
378 void ClearRenderSurface(); | 376 void ClearRenderSurface(); |
377 | |
378 void SetShouldHaveRenderSurface(bool should_have); | |
379 void SetRenderSurfaceActive(bool active); | |
danakj
2014/08/26 18:06:13
Should we get rid of {Create,Clear}RenderSurface t
awoloszyn
2014/08/28 19:31:43
This one is a bit tricky. RenderSurfaces get destr
| |
380 bool ShouldHaveRenderSurface() { return should_have_render_surface_; } | |
381 | |
379 void ClearRenderSurfaceLayerList(); | 382 void ClearRenderSurfaceLayerList(); |
380 | 383 |
381 // The contents scale converts from logical, non-page-scaled pixels to target | 384 // The contents scale converts from logical, non-page-scaled pixels to target |
382 // pixels. The contents scale is 1 for the root layer as it is already in | 385 // pixels. The contents scale is 1 for the root layer as it is already in |
383 // physical pixels. By default contents scale is forced to be 1 except for | 386 // physical pixels. By default contents scale is forced to be 1 except for |
384 // subclasses of ContentsScalingLayer. | 387 // subclasses of ContentsScalingLayer. |
385 float contents_scale_x() const { return draw_properties_.contents_scale_x; } | 388 float contents_scale_x() const { return draw_properties_.contents_scale_x; } |
386 float contents_scale_y() const { return draw_properties_.contents_scale_y; } | 389 float contents_scale_y() const { return draw_properties_.contents_scale_y; } |
387 gfx::Size content_bounds() const { return draw_properties_.content_bounds; } | 390 gfx::Size content_bounds() const { return draw_properties_.content_bounds; } |
388 | 391 |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
601 bool draws_content_ : 1; | 604 bool draws_content_ : 1; |
602 bool hide_layer_and_subtree_ : 1; | 605 bool hide_layer_and_subtree_ : 1; |
603 bool masks_to_bounds_ : 1; | 606 bool masks_to_bounds_ : 1; |
604 bool contents_opaque_ : 1; | 607 bool contents_opaque_ : 1; |
605 bool double_sided_ : 1; | 608 bool double_sided_ : 1; |
606 bool should_flatten_transform_ : 1; | 609 bool should_flatten_transform_ : 1; |
607 bool use_parent_backface_visibility_ : 1; | 610 bool use_parent_backface_visibility_ : 1; |
608 bool draw_checkerboard_for_missing_tiles_ : 1; | 611 bool draw_checkerboard_for_missing_tiles_ : 1; |
609 bool force_render_surface_ : 1; | 612 bool force_render_surface_ : 1; |
610 bool transform_is_invertible_ : 1; | 613 bool transform_is_invertible_ : 1; |
614 bool should_have_render_surface_ : 1; | |
611 Region non_fast_scrollable_region_; | 615 Region non_fast_scrollable_region_; |
612 Region touch_event_handler_region_; | 616 Region touch_event_handler_region_; |
613 gfx::PointF position_; | 617 gfx::PointF position_; |
614 SkColor background_color_; | 618 SkColor background_color_; |
615 float opacity_; | 619 float opacity_; |
616 SkXfermode::Mode blend_mode_; | 620 SkXfermode::Mode blend_mode_; |
617 FilterOperations filters_; | 621 FilterOperations filters_; |
618 FilterOperations background_filters_; | 622 FilterOperations background_filters_; |
619 LayerPositionConstraint position_constraint_; | 623 LayerPositionConstraint position_constraint_; |
620 Layer* scroll_parent_; | 624 Layer* scroll_parent_; |
(...skipping 13 matching lines...) Expand all Loading... | |
634 | 638 |
635 LayerClient* client_; | 639 LayerClient* client_; |
636 | 640 |
637 ScopedPtrVector<CopyOutputRequest> copy_requests_; | 641 ScopedPtrVector<CopyOutputRequest> copy_requests_; |
638 | 642 |
639 base::Closure did_scroll_callback_; | 643 base::Closure did_scroll_callback_; |
640 | 644 |
641 DrawProperties<Layer> draw_properties_; | 645 DrawProperties<Layer> draw_properties_; |
642 | 646 |
643 PaintProperties paint_properties_; | 647 PaintProperties paint_properties_; |
648 scoped_ptr<RenderSurface> render_surface_; | |
644 | 649 |
645 DISALLOW_COPY_AND_ASSIGN(Layer); | 650 DISALLOW_COPY_AND_ASSIGN(Layer); |
646 }; | 651 }; |
647 | 652 |
648 } // namespace cc | 653 } // namespace cc |
649 | 654 |
650 #endif // CC_LAYERS_LAYER_H_ | 655 #endif // CC_LAYERS_LAYER_H_ |
OLD | NEW |