| 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 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 } | 357 } |
| 358 int num_unclipped_descendants() const { | 358 int num_unclipped_descendants() const { |
| 359 return draw_properties_.num_unclipped_descendants; | 359 return draw_properties_.num_unclipped_descendants; |
| 360 } | 360 } |
| 361 | 361 |
| 362 // The client should be responsible for setting bounds, content bounds and | 362 // The client should be responsible for setting bounds, content bounds and |
| 363 // contents scale to appropriate values. LayerImpl doesn't calculate any of | 363 // contents scale to appropriate values. LayerImpl doesn't calculate any of |
| 364 // them from the other values. | 364 // them from the other values. |
| 365 | 365 |
| 366 void SetBounds(const gfx::Size& bounds); | 366 void SetBounds(const gfx::Size& bounds); |
| 367 gfx::SizeF bounds() const; | 367 gfx::Size bounds() const; |
| 368 void SetBoundsDelta(const gfx::Vector2dF& bounds_delta); | 368 void SetBoundsDelta(const gfx::Vector2dF& bounds_delta); |
| 369 gfx::Vector2dF bounds_delta() const { return bounds_delta_; } | 369 gfx::Vector2dF bounds_delta() const { return bounds_delta_; } |
| 370 | 370 |
| 371 void SetContentBounds(const gfx::Size& content_bounds); | 371 void SetContentBounds(const gfx::Size& content_bounds); |
| 372 gfx::Size content_bounds() const { return draw_properties_.content_bounds; } | 372 gfx::Size content_bounds() const { return draw_properties_.content_bounds; } |
| 373 | 373 |
| 374 float contents_scale_x() const { return draw_properties_.contents_scale_x; } | 374 float contents_scale_x() const { return draw_properties_.contents_scale_x; } |
| 375 float contents_scale_y() const { return draw_properties_.contents_scale_y; } | 375 float contents_scale_y() const { return draw_properties_.contents_scale_y; } |
| 376 void SetContentsScale(float contents_scale_x, float contents_scale_y); | 376 void SetContentsScale(float contents_scale_x, float contents_scale_y); |
| 377 | 377 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 508 return scrollbar_animation_controller_.get(); | 508 return scrollbar_animation_controller_.get(); |
| 509 } | 509 } |
| 510 | 510 |
| 511 typedef std::set<ScrollbarLayerImplBase*> ScrollbarSet; | 511 typedef std::set<ScrollbarLayerImplBase*> ScrollbarSet; |
| 512 ScrollbarSet* scrollbars() { return scrollbars_.get(); } | 512 ScrollbarSet* scrollbars() { return scrollbars_.get(); } |
| 513 void ClearScrollbars(); | 513 void ClearScrollbars(); |
| 514 void AddScrollbar(ScrollbarLayerImplBase* layer); | 514 void AddScrollbar(ScrollbarLayerImplBase* layer); |
| 515 void RemoveScrollbar(ScrollbarLayerImplBase* layer); | 515 void RemoveScrollbar(ScrollbarLayerImplBase* layer); |
| 516 bool HasScrollbar(ScrollbarOrientation orientation) const; | 516 bool HasScrollbar(ScrollbarOrientation orientation) const; |
| 517 void ScrollbarParametersDidChange(bool on_resize); | 517 void ScrollbarParametersDidChange(bool on_resize); |
| 518 int clip_height() { |
| 519 return scroll_clip_layer_ ? scroll_clip_layer_->bounds().height() : 0; |
| 520 } |
| 518 | 521 |
| 519 gfx::Rect LayerRectToContentRect(const gfx::RectF& layer_rect) const; | 522 gfx::Rect LayerRectToContentRect(const gfx::RectF& layer_rect) const; |
| 520 | 523 |
| 521 virtual skia::RefPtr<SkPicture> GetPicture(); | 524 virtual skia::RefPtr<SkPicture> GetPicture(); |
| 522 | 525 |
| 523 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl); | 526 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl); |
| 524 virtual void PushPropertiesTo(LayerImpl* layer); | 527 virtual void PushPropertiesTo(LayerImpl* layer); |
| 525 | 528 |
| 526 virtual void GetAllTilesForTracing(std::set<const Tile*>* tiles) const; | 529 virtual void GetAllTilesForTracing(std::set<const Tile*>* tiles) const; |
| 527 virtual void AsValueInto(base::debug::TracedValue* dict) const; | 530 virtual void AsValueInto(base::debug::TracedValue* dict) const; |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 DrawProperties<LayerImpl> draw_properties_; | 707 DrawProperties<LayerImpl> draw_properties_; |
| 705 | 708 |
| 706 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_; | 709 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_; |
| 707 | 710 |
| 708 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 711 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
| 709 }; | 712 }; |
| 710 | 713 |
| 711 } // namespace cc | 714 } // namespace cc |
| 712 | 715 |
| 713 #endif // CC_LAYERS_LAYER_IMPL_H_ | 716 #endif // CC_LAYERS_LAYER_IMPL_H_ |
| OLD | NEW |