Disable StorageInfoProviderTest.* on Valgrind bots.
[chromium-blink-merge.git] / cc / contents_scaling_layer.cc
blob454b6e786e0085b8952c8a7d47243a680f47cbcf
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 #include "cc/contents_scaling_layer.h"
6 #include "ui/gfx/size_conversions.h"
8 namespace cc {
10 gfx::Size ContentsScalingLayer::computeContentBoundsForScale(float scaleX, float scaleY) const {
11 return gfx::ToCeiledSize(gfx::ScaleSize(bounds(), scaleX, scaleY));
14 ContentsScalingLayer::ContentsScalingLayer()
15 : m_contentsScale(1.0) {
18 ContentsScalingLayer::~ContentsScalingLayer() {
21 gfx::Size ContentsScalingLayer::contentBounds() const {
22 return computeContentBoundsForScale(contentsScaleX(), contentsScaleY());
25 float ContentsScalingLayer::contentsScaleX() const {
26 return m_contentsScale;
29 float ContentsScalingLayer::contentsScaleY() const {
30 return m_contentsScale;
33 void ContentsScalingLayer::setContentsScale(float contentsScale) {
34 if (m_contentsScale == contentsScale)
35 return;
36 m_contentsScale = contentsScale;
37 setNeedsDisplay();
40 } // namespace cc