Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(259)

Side by Side Diff: cc/contents_scaling_layer.h

Issue 11503005: cc: Refactor content scale/bounds into draw properties (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | cc/contents_scaling_layer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 gfx::Size contentBounds() const OVERRIDE; 17 virtual void calculateContentsScale(
18 virtual float contentsScaleX() const OVERRIDE; 18 float ideal_contents_scale,
19 virtual float contentsScaleY() const OVERRIDE; 19 float* contents_scale_x,
20 virtual void setContentsScale(float contentsScale) OVERRIDE; 20 float* contents_scale_y,
21 gfx::Size* content_bounds) OVERRIDE;
22 virtual void didUpdateBounds() OVERRIDE;
21 23
22 protected: 24 protected:
23 ContentsScalingLayer(); 25 ContentsScalingLayer();
24 virtual ~ContentsScalingLayer(); 26 virtual ~ContentsScalingLayer();
25 27
26 gfx::Size computeContentBoundsForScale(float scaleX, float scaleY) const; 28 gfx::Size computeContentBoundsForScale(float scaleX, float scaleY) const;
27
28 private:
29 float m_contentsScale;
30 }; 29 };
31 30
32 } // namespace cc 31 } // namespace cc
33 32
34 #endif // CC_CONTENTS_SCALING_LAYER_H__ 33 #endif // CC_CONTENTS_SCALING_LAYER_H__
OLDNEW
« no previous file with comments | « no previous file | cc/contents_scaling_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698