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