| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_CONTENTS_SCALING_LAYER_H_ | 5 #ifndef CC_CONTENTS_SCALING_LAYER_H_ |
| 6 #define CC_CONTENTS_SCALING_LAYER_H_ | 6 #define CC_CONTENTS_SCALING_LAYER_H_ |
| 7 | 7 |
| 8 #include "cc/cc_export.h" | 8 #include "cc/cc_export.h" |
| 9 #include "cc/layer.h" | 9 #include "cc/layer.h" |
| 10 | 10 |
| 11 namespace cc { | 11 namespace cc { |
| 12 | 12 |
| 13 // Base class for layers that need contents scale. | 13 // Base class for layers that need contents scale. |
| 14 // The content bounds are determined by bounds and scale of the contents. | 14 // The content bounds are determined by bounds and scale of the contents. |
| 15 class CC_EXPORT ContentsScalingLayer : public Layer { | 15 class CC_EXPORT ContentsScalingLayer : public Layer { |
| 16 public: | 16 public: |
| 17 virtual void calculateContentsScale( | 17 virtual void calculateContentsScale( |
| 18 float ideal_contents_scale, | 18 float ideal_contents_scale, |
| 19 float* contents_scale_x, | 19 float* contents_scale_x, |
| 20 float* contents_scale_y, | 20 float* contents_scale_y, |
| 21 gfx::Size* content_bounds) OVERRIDE; | 21 gfx::Size* content_bounds) OVERRIDE; |
| 22 virtual void didUpdateBounds() OVERRIDE; | 22 virtual void didUpdateBounds() OVERRIDE; |
| 23 | 23 |
| 24 virtual void update( | 24 virtual void update( |
| 25 ResourceUpdateQueue& queue, | 25 ResourceUpdateQueue& queue, |
| 26 const OcclusionTracker* occlusion, | 26 const OcclusionTracker* occlusion, |
| 27 RenderingStats& stats) OVERRIDE; | 27 RenderingStats* stats) OVERRIDE; |
| 28 | 28 |
| 29 protected: | 29 protected: |
| 30 ContentsScalingLayer(); | 30 ContentsScalingLayer(); |
| 31 virtual ~ContentsScalingLayer(); | 31 virtual ~ContentsScalingLayer(); |
| 32 | 32 |
| 33 gfx::Size computeContentBoundsForScale(float scaleX, float scaleY) const; | 33 gfx::Size computeContentBoundsForScale(float scaleX, float scaleY) const; |
| 34 | 34 |
| 35 private: | 35 private: |
| 36 float last_update_contents_scale_x_; | 36 float last_update_contents_scale_x_; |
| 37 float last_update_contents_scale_y_; | 37 float last_update_contents_scale_y_; |
| 38 }; | 38 }; |
| 39 | 39 |
| 40 } // namespace cc | 40 } // namespace cc |
| 41 | 41 |
| 42 #endif // CC_CONTENTS_SCALING_LAYER_H__ | 42 #endif // CC_CONTENTS_SCALING_LAYER_H__ |
| OLD | NEW |