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 #include "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "CCSettings.h" | 7 #include "CCSettings.h" |
8 | 8 |
| 9 #include "base/command_line.h" |
| 10 #include "content/public/common/content_switches.h" |
| 11 |
9 namespace { | 12 namespace { |
10 static bool s_perTilePaintingEnabled = false; | 13 static bool s_perTilePaintingEnabled = false; |
11 static bool s_partialSwapEnabled = false; | 14 static bool s_partialSwapEnabled = false; |
12 static bool s_acceleratedAnimationEnabled = false; | 15 static bool s_acceleratedAnimationEnabled = false; |
| 16 static bool s_pageScalePinchZoomEnabled = false; |
13 } // namespace | 17 } // namespace |
14 | 18 |
15 namespace cc { | 19 namespace cc { |
16 | 20 |
17 bool CCSettings::perTilePaintingEnabled() { return s_perTilePaintingEnabled; } | 21 bool CCSettings::perTilePaintingEnabled() { return s_perTilePaintingEnabled; } |
18 void CCSettings::setPerTilePaintingEnabled(bool enabled) { s_perTilePaintingEnab
led = enabled; } | 22 void CCSettings::setPerTilePaintingEnabled(bool enabled) { s_perTilePaintingEnab
led = enabled; } |
19 | 23 |
20 bool CCSettings::partialSwapEnabled() { return s_partialSwapEnabled; } | 24 bool CCSettings::partialSwapEnabled() { return s_partialSwapEnabled; } |
21 void CCSettings::setPartialSwapEnabled(bool enabled) { s_partialSwapEnabled = en
abled; } | 25 void CCSettings::setPartialSwapEnabled(bool enabled) { s_partialSwapEnabled = en
abled; } |
22 | 26 |
23 bool CCSettings::acceleratedAnimationEnabled() { return s_acceleratedAnimationEn
abled; } | 27 bool CCSettings::acceleratedAnimationEnabled() { return s_acceleratedAnimationEn
abled; } |
24 void CCSettings::setAcceleratedAnimationEnabled(bool enabled) { s_acceleratedAni
mationEnabled = enabled; } | 28 void CCSettings::setAcceleratedAnimationEnabled(bool enabled) { s_acceleratedAni
mationEnabled = enabled; } |
25 | 29 |
| 30 bool CCSettings::pageScalePinchZoomEnabled() |
| 31 { |
| 32 return s_pageScalePinchZoomEnabled || CommandLine::ForCurrentProcess()->HasS
witch( |
| 33 switches::kEnablePinchInCompositor); |
| 34 } |
| 35 void CCSettings::setPageScalePinchZoomEnabled(bool enabled) { s_pageScalePinchZo
omEnabled = enabled; } |
| 36 |
26 void CCSettings::reset() | 37 void CCSettings::reset() |
27 { | 38 { |
28 s_perTilePaintingEnabled = false; | 39 s_perTilePaintingEnabled = false; |
29 s_partialSwapEnabled = false; | 40 s_partialSwapEnabled = false; |
30 s_acceleratedAnimationEnabled = false; | 41 s_acceleratedAnimationEnabled = false; |
| 42 s_pageScalePinchZoomEnabled = false; |
31 } | 43 } |
32 | 44 |
33 } // namespace cc | 45 } // namespace cc |
OLD | NEW |