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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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::Size bounds() const; |
| 368 // Like bounds() but doesn't snap to int. Lossy on giant pages (e.g. millions |
| 369 // of pixels) due to use of single precision float. |
| 370 gfx::SizeF BoundsForScrolling() const; |
368 void SetBoundsDelta(const gfx::Vector2dF& bounds_delta); | 371 void SetBoundsDelta(const gfx::Vector2dF& bounds_delta); |
369 gfx::Vector2dF bounds_delta() const { return bounds_delta_; } | 372 gfx::Vector2dF bounds_delta() const { return bounds_delta_; } |
370 | 373 |
371 void SetContentBounds(const gfx::Size& content_bounds); | 374 void SetContentBounds(const gfx::Size& content_bounds); |
372 gfx::Size content_bounds() const { return draw_properties_.content_bounds; } | 375 gfx::Size content_bounds() const { return draw_properties_.content_bounds; } |
373 | 376 |
374 float contents_scale_x() const { return draw_properties_.contents_scale_x; } | 377 float contents_scale_x() const { return draw_properties_.contents_scale_x; } |
375 float contents_scale_y() const { return draw_properties_.contents_scale_y; } | 378 float contents_scale_y() const { return draw_properties_.contents_scale_y; } |
376 void SetContentsScale(float contents_scale_x, float contents_scale_y); | 379 void SetContentsScale(float contents_scale_x, float contents_scale_y); |
377 | 380 |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 DrawProperties<LayerImpl> draw_properties_; | 710 DrawProperties<LayerImpl> draw_properties_; |
708 | 711 |
709 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_; | 712 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_; |
710 | 713 |
711 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 714 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
712 }; | 715 }; |
713 | 716 |
714 } // namespace cc | 717 } // namespace cc |
715 | 718 |
716 #endif // CC_LAYERS_LAYER_IMPL_H_ | 719 #endif // CC_LAYERS_LAYER_IMPL_H_ |
OLD | NEW |