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

Unified Diff: cc/contents_scaling_layer.h

Issue 11276060: Pass accurate contentsScale to LayerImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 months 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 side-by-side diff with in-line comments
Download patch
Index: cc/contents_scaling_layer.h
diff --git a/cc/contents_scaling_layer.h b/cc/contents_scaling_layer.h
new file mode 100644
index 0000000000000000000000000000000000000000..3151a303cd09570a6d332a9dfda8b0aa54b10eb6
--- /dev/null
+++ b/cc/contents_scaling_layer.h
@@ -0,0 +1,30 @@
+// Copyright 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CC_CONTENTS_SCALING_LAYER_H
+#define CC_CONTENTS_SCALING_LAYER_H
+
+#include "cc/layer.h"
+
+namespace cc {
+
+// Base class for layers that need contents scale.
+// The content bounds are determined by bounds and scale of the contents.
+class ContentsScalingLayer : public Layer {
+ public:
+ ContentsScalingLayer();
+ virtual ~ContentsScalingLayer();
+
+ virtual IntSize contentBounds() const OVERRIDE;
+ virtual float contentsScaleX() const OVERRIDE { return m_contentsScale; }
+ virtual float contentsScaleY() const OVERRIDE { return m_contentsScale; }
+ virtual void setContentsScale(float contentsScale) OVERRIDE;
+
+ private:
+ float m_contentsScale;
+};
+
+} // namespace cc
+
+#endif // CC_CONTENTS_SCALING_LAYER_H
« no previous file with comments | « cc/cc_tests.gyp ('k') | cc/contents_scaling_layer.cc » ('j') | cc/damage_tracker.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698