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
3 // found in the LICENSE file.
5 #ifndef CC_CONTENTS_SCALING_LAYER_H_
6 #define CC_CONTENTS_SCALING_LAYER_H_
8 #include "cc/cc_export.h"
13 // Base class for layers that need contents scale.
14 // The content bounds are determined by bounds and scale of the contents.
15 class CC_EXPORT ContentsScalingLayer
: public Layer
{
17 virtual void calculateContentsScale(
18 float ideal_contents_scale
,
19 bool animating_transform_to_screen
,
20 float* contents_scale_x
,
21 float* contents_scale_y
,
22 gfx::Size
* content_bounds
) OVERRIDE
;
23 virtual void didUpdateBounds() OVERRIDE
;
26 ResourceUpdateQueue
& queue
,
27 const OcclusionTracker
* occlusion
,
28 RenderingStats
* stats
) OVERRIDE
;
31 ContentsScalingLayer();
32 virtual ~ContentsScalingLayer();
34 gfx::Size
computeContentBoundsForScale(float scaleX
, float scaleY
) const;
37 float last_update_contents_scale_x_
;
38 float last_update_contents_scale_y_
;
43 #endif // CC_CONTENTS_SCALING_LAYER_H__