| 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::Size bounds() const; | 367 gfx::SizeF 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 return scrollbar_animation_controller_.get(); | 507 return scrollbar_animation_controller_.get(); |
| 508 } | 508 } |
| 509 | 509 |
| 510 typedef std::set<ScrollbarLayerImplBase*> ScrollbarSet; | 510 typedef std::set<ScrollbarLayerImplBase*> ScrollbarSet; |
| 511 ScrollbarSet* scrollbars() { return scrollbars_.get(); } | 511 ScrollbarSet* scrollbars() { return scrollbars_.get(); } |
| 512 void ClearScrollbars(); | 512 void ClearScrollbars(); |
| 513 void AddScrollbar(ScrollbarLayerImplBase* layer); | 513 void AddScrollbar(ScrollbarLayerImplBase* layer); |
| 514 void RemoveScrollbar(ScrollbarLayerImplBase* layer); | 514 void RemoveScrollbar(ScrollbarLayerImplBase* layer); |
| 515 bool HasScrollbar(ScrollbarOrientation orientation) const; | 515 bool HasScrollbar(ScrollbarOrientation orientation) const; |
| 516 void ScrollbarParametersDidChange(); | 516 void ScrollbarParametersDidChange(); |
| 517 int clip_height() { | |
| 518 return scroll_clip_layer_ ? scroll_clip_layer_->bounds().height() : 0; | |
| 519 } | |
| 520 | 517 |
| 521 gfx::Rect LayerRectToContentRect(const gfx::RectF& layer_rect) const; | 518 gfx::Rect LayerRectToContentRect(const gfx::RectF& layer_rect) const; |
| 522 | 519 |
| 523 virtual skia::RefPtr<SkPicture> GetPicture(); | 520 virtual skia::RefPtr<SkPicture> GetPicture(); |
| 524 | 521 |
| 525 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl); | 522 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl); |
| 526 virtual void PushPropertiesTo(LayerImpl* layer); | 523 virtual void PushPropertiesTo(LayerImpl* layer); |
| 527 | 524 |
| 528 virtual void GetAllTilesForTracing(std::set<const Tile*>* tiles) const; | 525 virtual void GetAllTilesForTracing(std::set<const Tile*>* tiles) const; |
| 529 virtual void AsValueInto(base::debug::TracedValue* dict) const; | 526 virtual void AsValueInto(base::debug::TracedValue* dict) const; |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 DrawProperties<LayerImpl> draw_properties_; | 703 DrawProperties<LayerImpl> draw_properties_; |
| 707 | 704 |
| 708 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_; | 705 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_; |
| 709 | 706 |
| 710 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 707 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
| 711 }; | 708 }; |
| 712 | 709 |
| 713 } // namespace cc | 710 } // namespace cc |
| 714 | 711 |
| 715 #endif // CC_LAYERS_LAYER_IMPL_H_ | 712 #endif // CC_LAYERS_LAYER_IMPL_H_ |
| OLD | NEW |