summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraelias@chromium.org <aelias@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-19 03:39:37 +0000
committeraelias@chromium.org <aelias@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-19 03:39:37 +0000
commit65bfd9976b93353a62da4946206448a0e4dd0ba1 (patch)
treea0237b4901796ab7e74caad09baadf90b64ce613
parent789ad9876d1e731046b0bf648f43bbe1ac0836c1 (diff)
downloadchromium_src-65bfd9976b93353a62da4946206448a0e4dd0ba1.zip
chromium_src-65bfd9976b93353a62da4946206448a0e4dd0ba1.tar.gz
chromium_src-65bfd9976b93353a62da4946206448a0e4dd0ba1.tar.bz2
Move CC switches to cc/switches.h.
This moves these switches to their appropriate place, and sets them all directly from command-line flags there. I deleted the WebCompositor setter methods, but setters are still needed in CCSettings for unit tests. BUG= Review URL: https://chromiumcodereview.appspot.com/11186039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162921 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--cc/content_layer.cc2
-rw-r--r--cc/gl_renderer.cc2
-rw-r--r--cc/layer.cc2
-rw-r--r--cc/layer_impl.cc2
-rw-r--r--cc/layer_tree_host.cc4
-rw-r--r--cc/layer_tree_host_impl.cc16
-rw-r--r--cc/layer_tree_host_impl_unittest.cc56
-rw-r--r--cc/layer_unittest.cc5
-rw-r--r--cc/settings.cc100
-rw-r--r--cc/settings.h15
-rw-r--r--cc/switches.cc18
-rw-r--r--cc/switches.h6
-rw-r--r--cc/test/test_common.h6
-rw-r--r--cc/threaded_unittest.cc5
-rw-r--r--chrome/DEPS1
-rw-r--r--chrome/browser/about_flags.cc5
-rw-r--r--chrome/browser/chromeos/login/login_utils.cc6
-rw-r--r--chrome/browser/ui/webui/gpu_internals_ui.cc3
-rw-r--r--content/DEPS2
-rw-r--r--content/browser/renderer_host/render_process_host_impl.cc10
-rw-r--r--content/browser/web_contents/web_contents_impl.cc3
-rw-r--r--content/public/common/content_switches.cc13
-rw-r--r--content/public/common/content_switches.h5
-rw-r--r--content/renderer/render_thread_impl.cc8
-rw-r--r--content/renderer/render_view_impl.cc3
-rw-r--r--webkit/compositor_bindings/web_compositor_impl.cc25
-rw-r--r--webkit/compositor_bindings/web_compositor_support_impl.cc9
27 files changed, 184 insertions, 148 deletions
diff --git a/cc/content_layer.cc b/cc/content_layer.cc
index 6de4dff..f99e2d3 100644
--- a/cc/content_layer.cc
+++ b/cc/content_layer.cc
@@ -90,7 +90,7 @@ void ContentLayerChromium::createTextureUpdaterIfNeeded()
scoped_ptr<LayerPainterChromium> painter = ContentLayerPainter::create(m_client).PassAs<LayerPainterChromium>();
if (layerTreeHost()->settings().acceleratePainting)
m_textureUpdater = FrameBufferSkPictureCanvasLayerTextureUpdater::create(painter.Pass());
- else if (CCSettings::perTilePaintingEnabled())
+ else if (Settings::perTilePaintingEnabled())
m_textureUpdater = BitmapSkPictureCanvasLayerTextureUpdater::create(painter.Pass());
else
m_textureUpdater = BitmapCanvasLayerTextureUpdater::create(painter.Pass());
diff --git a/cc/gl_renderer.cc b/cc/gl_renderer.cc
index 6f60483..7f2ea51 100644
--- a/cc/gl_renderer.cc
+++ b/cc/gl_renderer.cc
@@ -104,7 +104,7 @@ bool CCRendererGL::initialize()
m_capabilities.contextHasCachedFrontBuffer = extensions.count("GL_CHROMIUM_front_buffer_cached");
- m_capabilities.usingPartialSwap = CCSettings::partialSwapEnabled() && extensions.count("GL_CHROMIUM_post_sub_buffer");
+ m_capabilities.usingPartialSwap = Settings::partialSwapEnabled() && extensions.count("GL_CHROMIUM_post_sub_buffer");
// Use the swapBuffers callback only with the threaded proxy.
if (CCProxy::hasImplThread())
diff --git a/cc/layer.cc b/cc/layer.cc
index 85a5221..2f53b09 100644
--- a/cc/layer.cc
+++ b/cc/layer.cc
@@ -707,7 +707,7 @@ bool LayerChromium::addAnimation(scoped_ptr <CCActiveAnimation> animation)
if (!m_layerTreeHost)
return false;
- if (!CCSettings::acceleratedAnimationEnabled())
+ if (!Settings::acceleratedAnimationEnabled())
return false;
m_layerAnimationController->addAnimation(animation.Pass());
diff --git a/cc/layer_impl.cc b/cc/layer_impl.cc
index d58ab74..3ee5405 100644
--- a/cc/layer_impl.cc
+++ b/cc/layer_impl.cc
@@ -227,7 +227,7 @@ CCInputHandlerClient::ScrollStatus CCLayerImpl::tryScroll(const IntPoint& viewpo
bool CCLayerImpl::drawCheckerboardForMissingTiles() const
{
- return m_drawCheckerboardForMissingTiles && !CCSettings::backgroundColorInsteadOfCheckerboard();
+ return m_drawCheckerboardForMissingTiles && !Settings::backgroundColorInsteadOfCheckerboard();
}
IntRect CCLayerImpl::layerRectToContentRect(const WebKit::WebRect& layerRect)
diff --git a/cc/layer_tree_host.cc b/cc/layer_tree_host.cc
index f7cdfbe..b19e969 100644
--- a/cc/layer_tree_host.cc
+++ b/cc/layer_tree_host.cc
@@ -546,7 +546,7 @@ void CCLayerTreeHost::updateLayers(LayerChromium* rootLayer, CCTextureUpdateQueu
LayerList updateList;
{
- if (CCSettings::pageScalePinchZoomEnabled()) {
+ if (Settings::pageScalePinchZoomEnabled()) {
LayerChromium* rootScroll = findFirstScrollableLayer(rootLayer);
if (rootScroll)
rootScroll->setImplTransform(m_implTransform);
@@ -777,7 +777,7 @@ void CCLayerTreeHost::setDeviceScaleFactor(float deviceScaleFactor)
void CCLayerTreeHost::animateLayers(double monotonicTime)
{
- if (!CCSettings::acceleratedAnimationEnabled() || !m_needsAnimateLayers)
+ if (!Settings::acceleratedAnimationEnabled() || !m_needsAnimateLayers)
return;
TRACE_EVENT0("cc", "CCLayerTreeHostImpl::animateLayers");
diff --git a/cc/layer_tree_host_impl.cc b/cc/layer_tree_host_impl.cc
index 44add6a..ed10d6d 100644
--- a/cc/layer_tree_host_impl.cc
+++ b/cc/layer_tree_host_impl.cc
@@ -147,7 +147,7 @@ WebTransformationMatrix CCPinchZoomViewport::implTransform() const
// If the pinch state is applied in the impl, then push it to the
// impl transform, otherwise the scale is handled by WebCore.
- if (CCSettings::pageScalePinchZoomEnabled()) {
+ if (Settings::pageScalePinchZoomEnabled()) {
transform.scale(m_pageScaleFactor);
transform.translate(-m_pinchViewportScrollDelta.x(),
-m_pinchViewportScrollDelta.y());
@@ -440,7 +440,7 @@ bool CCLayerTreeHostImpl::calculateRenderPasses(FrameData& frame)
if (appendQuadsData.hadMissingTiles) {
bool layerHasAnimatingTransform = it->screenSpaceTransformIsAnimating() || it->drawTransformIsAnimating();
- if (layerHasAnimatingTransform || CCSettings::jankInsteadOfCheckerboard())
+ if (layerHasAnimatingTransform || Settings::jankInsteadOfCheckerboard())
drawFrame = false;
}
@@ -934,7 +934,7 @@ void CCLayerTreeHostImpl::setPageScaleFactorAndLimits(float pageScaleFactor, flo
float pageScaleChange = pageScaleFactor / m_pinchZoomViewport.pageScaleFactor();
m_pinchZoomViewport.setPageScaleFactorAndLimits(pageScaleFactor, minPageScaleFactor, maxPageScaleFactor);
- if (!CCSettings::pageScalePinchZoomEnabled()) {
+ if (!Settings::pageScalePinchZoomEnabled()) {
if (pageScaleChange != 1)
adjustScrollsForPageScaleChange(m_rootScrollLayerImpl, pageScaleChange);
}
@@ -966,7 +966,7 @@ void CCLayerTreeHostImpl::updateMaxScrollPosition()
}
IntSize contentBounds = contentSize();
- if (CCSettings::pageScalePinchZoomEnabled()) {
+ if (Settings::pageScalePinchZoomEnabled()) {
// Pinch with pageScale scrolls entirely in layout space. contentSize
// returns the bounds including the page scale factor, so calculate the
// pre page-scale layout size here.
@@ -1202,12 +1202,12 @@ void CCLayerTreeHostImpl::pinchGestureUpdate(float magnifyDelta,
m_previousPinchAnchor = anchor;
- if (CCSettings::pageScalePinchZoomEnabled()) {
+ if (Settings::pageScalePinchZoomEnabled()) {
// Compute the application of the delta with respect to the current page zoom of the page.
move.scale(1 / (m_pinchZoomViewport.pageScaleFactor() * m_deviceScaleFactor));
}
- FloatSize scrollOverflow = CCSettings::pageScalePinchZoomEnabled() ? m_pinchZoomViewport.applyScroll(move) : move;
+ FloatSize scrollOverflow = Settings::pageScalePinchZoomEnabled() ? m_pinchZoomViewport.applyScroll(move) : move;
m_rootScrollLayerImpl->scrollBy(roundedIntSize(scrollOverflow));
if (m_rootScrollLayerImpl->scrollbarAnimationController())
@@ -1308,7 +1308,7 @@ scoped_ptr<CCScrollAndScaleSet> CCLayerTreeHostImpl::processScrollDeltas()
m_pinchZoomViewport.setSentPageScaleDelta(1);
// FIXME(aelias): Make these painting optimizations compatible with
// compositor-side scaling.
- if (!CCSettings::pageScalePinchZoomEnabled()) {
+ if (!Settings::pageScalePinchZoomEnabled()) {
if (m_pinchGestureActive)
computePinchZoomDeltas(scrollInfo.get());
else if (m_pageScaleAnimation.get())
@@ -1359,7 +1359,7 @@ void CCLayerTreeHostImpl::animatePageScale(double monotonicTime)
void CCLayerTreeHostImpl::animateLayers(double monotonicTime, double wallClockTime)
{
- if (!CCSettings::acceleratedAnimationEnabled() || !m_needsAnimateLayers || !m_rootLayerImpl)
+ if (!Settings::acceleratedAnimationEnabled() || !m_needsAnimateLayers || !m_rootLayerImpl)
return;
TRACE_EVENT0("cc", "CCLayerTreeHostImpl::animateLayers");
diff --git a/cc/layer_tree_host_impl_unittest.cc b/cc/layer_tree_host_impl_unittest.cc
index b3ee684..30b5aafe 100644
--- a/cc/layer_tree_host_impl_unittest.cc
+++ b/cc/layer_tree_host_impl_unittest.cc
@@ -16,7 +16,6 @@
#include "CCRendererGL.h"
#include "CCScrollbarGeometryFixedThumb.h"
#include "CCScrollbarLayerImpl.h"
-#include "CCSettings.h"
#include "CCSingleThreadProxy.h"
#include "CCSolidColorDrawQuad.h"
#include "CCTextureDrawQuad.h"
@@ -24,6 +23,7 @@
#include "CCTileDrawQuad.h"
#include "CCTiledLayerImpl.h"
#include "CCVideoLayerImpl.h"
+#include "base/command_line.h"
#include "base/hash_tables.h"
#include "cc/test/animation_test_common.h"
#include "cc/test/fake_web_compositor_output_surface.h"
@@ -33,6 +33,7 @@
#include "cc/test/layer_test_common.h"
#include "cc/test/render_pass_test_common.h"
#include "cc/test/test_common.h"
+#include "cc/settings.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include <public/WebVideoFrame.h>
@@ -52,7 +53,7 @@ using ::testing::_;
namespace {
// This test is parametrized to run all tests with the
-// CCSettings::pageScalePinchZoomEnabled field enabled and disabled.
+// Settings::pageScalePinchZoomEnabled field enabled and disabled.
class CCLayerTreeHostImplTest : public testing::TestWithParam<bool>,
public CCLayerTreeHostImplClient {
public:
@@ -66,7 +67,7 @@ public:
virtual void SetUp()
{
- CCSettings::setPageScalePinchZoomEnabled(GetParam());
+ Settings::setPageScalePinchZoomEnabled(GetParam());
CCLayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = IntSize();
@@ -77,7 +78,6 @@ public:
virtual void TearDown()
{
- CCSettings::reset();
}
virtual void didLoseContextOnImplThread() OVERRIDE { }
@@ -93,7 +93,7 @@ public:
scoped_ptr<CCLayerTreeHostImpl> createLayerTreeHost(bool partialSwap, scoped_ptr<CCGraphicsContext> graphicsContext, scoped_ptr<CCLayerImpl> root)
{
- CCSettings::setPartialSwapEnabled(partialSwap);
+ Settings::setPartialSwapEnabled(partialSwap);
CCLayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = IntSize();
@@ -482,7 +482,7 @@ TEST_P(CCLayerTreeHostImplTest, maxScrollPositionChangedByDeviceScaleFactor)
TEST_P(CCLayerTreeHostImplTest, implPinchZoom)
{
// This test is specific to the page-scale based pinch zoom.
- if (!CCSettings::pageScalePinchZoomEnabled())
+ if (!Settings::pageScalePinchZoomEnabled())
return;
setupScrollAndContentsLayers(IntSize(100, 100));
@@ -545,7 +545,7 @@ TEST_P(CCLayerTreeHostImplTest, pinchGesture)
CCLayerImpl* scrollLayer = m_hostImpl->rootScrollLayer();
DCHECK(scrollLayer);
- const float minPageScale = CCSettings::pageScalePinchZoomEnabled() ? 1 : 0.5;
+ const float minPageScale = Settings::pageScalePinchZoomEnabled() ? 1 : 0.5;
const float maxPageScale = 4;
const WebTransformationMatrix identityScaleTransform;
@@ -596,7 +596,7 @@ TEST_P(CCLayerTreeHostImplTest, pinchGesture)
scoped_ptr<CCScrollAndScaleSet> scrollInfo = m_hostImpl->processScrollDeltas();
EXPECT_EQ(scrollInfo->pageScaleDelta, minPageScale);
- if (!CCSettings::pageScalePinchZoomEnabled()) {
+ if (!Settings::pageScalePinchZoomEnabled()) {
// Pushed to (0,0) via clamping against contents layer size.
expectContains(*scrollInfo, scrollLayer->id(), IntSize(-50, -50));
} else {
@@ -632,7 +632,7 @@ TEST_P(CCLayerTreeHostImplTest, pageScaleAnimation)
CCLayerImpl* scrollLayer = m_hostImpl->rootScrollLayer();
DCHECK(scrollLayer);
- const float minPageScale = CCSettings::pageScalePinchZoomEnabled() ? 1 : 0.5;
+ const float minPageScale = Settings::pageScalePinchZoomEnabled() ? 1 : 0.5;
const float maxPageScale = 4;
const double startTime = 1;
const double duration = 0.1;
@@ -684,7 +684,7 @@ TEST_P(CCLayerTreeHostImplTest, inhibitScrollAndPageScaleUpdatesWhilePinchZoomin
CCLayerImpl* scrollLayer = m_hostImpl->rootScrollLayer();
DCHECK(scrollLayer);
- const float minPageScale = CCSettings::pageScalePinchZoomEnabled() ? 1 : 0.5;
+ const float minPageScale = Settings::pageScalePinchZoomEnabled() ? 1 : 0.5;
const float maxPageScale = 4;
// Pinch zoom in.
@@ -705,7 +705,7 @@ TEST_P(CCLayerTreeHostImplTest, inhibitScrollAndPageScaleUpdatesWhilePinchZoomin
m_hostImpl->pinchGestureEnd();
scrollInfo = m_hostImpl->processScrollDeltas();
EXPECT_EQ(scrollInfo->pageScaleDelta, zoomInDelta);
- if (!CCSettings::pageScalePinchZoomEnabled()) {
+ if (!Settings::pageScalePinchZoomEnabled()) {
expectContains(*scrollInfo, scrollLayer->id(), IntSize(25, 25));
} else {
EXPECT_TRUE(scrollInfo->scrolls.isEmpty());
@@ -723,7 +723,7 @@ TEST_P(CCLayerTreeHostImplTest, inhibitScrollAndPageScaleUpdatesWhilePinchZoomin
// Since we are pinch zooming out, we should get an update to zoom all
// the way out to the minimum page scale.
scoped_ptr<CCScrollAndScaleSet> scrollInfo = m_hostImpl->processScrollDeltas();
- if (!CCSettings::pageScalePinchZoomEnabled()) {
+ if (!Settings::pageScalePinchZoomEnabled()) {
EXPECT_EQ(scrollInfo->pageScaleDelta, minPageScale);
expectContains(*scrollInfo, scrollLayer->id(), IntSize(0, 0));
} else {
@@ -734,7 +734,7 @@ TEST_P(CCLayerTreeHostImplTest, inhibitScrollAndPageScaleUpdatesWhilePinchZoomin
// Once the gesture ends, we get the final scroll and page scale values.
m_hostImpl->pinchGestureEnd();
scrollInfo = m_hostImpl->processScrollDeltas();
- if (CCSettings::pageScalePinchZoomEnabled()) {
+ if (Settings::pageScalePinchZoomEnabled()) {
EXPECT_EQ(scrollInfo->pageScaleDelta, minPageScale);
expectContains(*scrollInfo, scrollLayer->id(), IntSize(25, 25));
} else {
@@ -753,7 +753,7 @@ TEST_P(CCLayerTreeHostImplTest, inhibitScrollAndPageScaleUpdatesWhileAnimatingPa
CCLayerImpl* scrollLayer = m_hostImpl->rootScrollLayer();
DCHECK(scrollLayer);
- const float minPageScale = CCSettings::pageScalePinchZoomEnabled() ? 1 : 0.5;
+ const float minPageScale = Settings::pageScalePinchZoomEnabled() ? 1 : 0.5;
const float maxPageScale = 4;
const double startTime = 1;
const double duration = 0.1;
@@ -770,7 +770,7 @@ TEST_P(CCLayerTreeHostImplTest, inhibitScrollAndPageScaleUpdatesWhileAnimatingPa
m_hostImpl->animate(halfwayThroughAnimation, halfwayThroughAnimation);
scoped_ptr<CCScrollAndScaleSet> scrollInfo = m_hostImpl->processScrollDeltas();
- if (!CCSettings::pageScalePinchZoomEnabled()) {
+ if (!Settings::pageScalePinchZoomEnabled()) {
EXPECT_EQ(scrollInfo->pageScaleDelta, pageScaleDelta);
expectContains(*scrollInfo, scrollLayer->id(), IntSize(25, 25));
} else {
@@ -1154,7 +1154,7 @@ TEST_P(CCLayerTreeHostImplTest, scrollRootAndChangePageScaleOnMainThread)
// Set new page scale from main thread.
m_hostImpl->setPageScaleFactorAndLimits(pageScale, pageScale, pageScale);
- if (!CCSettings::pageScalePinchZoomEnabled()) {
+ if (!Settings::pageScalePinchZoomEnabled()) {
// The scale should apply to the scroll delta.
expectedScrollDelta.scale(pageScale);
}
@@ -1277,7 +1277,7 @@ TEST_P(CCLayerTreeHostImplTest, scrollChildAndChangePageScaleOnMainThread)
m_hostImpl->updateRootScrollLayerImplTransform();
- if (!CCSettings::pageScalePinchZoomEnabled()) {
+ if (!Settings::pageScalePinchZoomEnabled()) {
// The scale should apply to the scroll delta.
expectedScrollDelta.scale(pageScale);
}
@@ -1940,7 +1940,7 @@ TEST_P(CCLayerTreeHostImplTest, partialSwapReceivesDamageRect)
// This test creates its own CCLayerTreeHostImpl, so
// that we can force partial swap enabled.
CCLayerTreeSettings settings;
- CCSettings::setPartialSwapEnabled(true);
+ Settings::setPartialSwapEnabled(true);
scoped_ptr<CCLayerTreeHostImpl> layerTreeHostImpl = CCLayerTreeHostImpl::create(settings, this);
layerTreeHostImpl->initializeRenderer(ccContext.Pass());
layerTreeHostImpl->setViewportSize(IntSize(500, 500), IntSize(500, 500));
@@ -2223,7 +2223,7 @@ public:
static scoped_ptr<CCLayerTreeHostImpl> setupLayersForOpacity(bool partialSwap, CCLayerTreeHostImplClient* client)
{
- CCSettings::setPartialSwapEnabled(partialSwap);
+ Settings::setPartialSwapEnabled(partialSwap);
scoped_ptr<CCGraphicsContext> context = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<CCGraphicsContext>();
@@ -2988,7 +2988,7 @@ public:
TEST_P(CCLayerTreeHostImplTest, textureCachingWithClipping)
{
- CCSettings::setPartialSwapEnabled(true);
+ Settings::setPartialSwapEnabled(true);
CCLayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = IntSize();
@@ -3085,7 +3085,7 @@ TEST_P(CCLayerTreeHostImplTest, textureCachingWithClipping)
TEST_P(CCLayerTreeHostImplTest, textureCachingWithOcclusion)
{
- CCSettings::setPartialSwapEnabled(false);
+ Settings::setPartialSwapEnabled(false);
CCLayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = IntSize();
@@ -3201,7 +3201,7 @@ TEST_P(CCLayerTreeHostImplTest, textureCachingWithOcclusion)
TEST_P(CCLayerTreeHostImplTest, textureCachingWithOcclusionEarlyOut)
{
- CCSettings::setPartialSwapEnabled(false);
+ Settings::setPartialSwapEnabled(false);
CCLayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = IntSize();
@@ -3317,7 +3317,7 @@ TEST_P(CCLayerTreeHostImplTest, textureCachingWithOcclusionEarlyOut)
TEST_P(CCLayerTreeHostImplTest, textureCachingWithOcclusionExternalOverInternal)
{
- CCSettings::setPartialSwapEnabled(false);
+ Settings::setPartialSwapEnabled(false);
CCLayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = IntSize();
@@ -3406,7 +3406,7 @@ TEST_P(CCLayerTreeHostImplTest, textureCachingWithOcclusionExternalOverInternal)
TEST_P(CCLayerTreeHostImplTest, textureCachingWithOcclusionExternalNotAligned)
{
- CCSettings::setPartialSwapEnabled(false);
+ Settings::setPartialSwapEnabled(false);
CCLayerTreeSettings settings;
scoped_ptr<CCLayerTreeHostImpl> myHostImpl = CCLayerTreeHostImpl::create(settings, this);
@@ -3480,7 +3480,7 @@ TEST_P(CCLayerTreeHostImplTest, textureCachingWithOcclusionExternalNotAligned)
TEST_P(CCLayerTreeHostImplTest, textureCachingWithOcclusionPartialSwap)
{
- CCSettings::setPartialSwapEnabled(true);
+ Settings::setPartialSwapEnabled(true);
CCLayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = IntSize();
@@ -3593,7 +3593,7 @@ TEST_P(CCLayerTreeHostImplTest, textureCachingWithOcclusionPartialSwap)
TEST_P(CCLayerTreeHostImplTest, textureCachingWithScissor)
{
- CCSettings::setPartialSwapEnabled(false);
+ Settings::setPartialSwapEnabled(false);
CCLayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = IntSize();
@@ -3700,7 +3700,7 @@ TEST_P(CCLayerTreeHostImplTest, textureCachingWithScissor)
TEST_P(CCLayerTreeHostImplTest, surfaceTextureCaching)
{
- CCSettings::setPartialSwapEnabled(true);
+ Settings::setPartialSwapEnabled(true);
CCLayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = IntSize();
@@ -3861,7 +3861,7 @@ TEST_P(CCLayerTreeHostImplTest, surfaceTextureCaching)
TEST_P(CCLayerTreeHostImplTest, surfaceTextureCachingNoPartialSwap)
{
- CCSettings::setPartialSwapEnabled(false);
+ Settings::setPartialSwapEnabled(false);
CCLayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = IntSize();
diff --git a/cc/layer_unittest.cc b/cc/layer_unittest.cc
index d10d891..f9da0aa 100644
--- a/cc/layer_unittest.cc
+++ b/cc/layer_unittest.cc
@@ -14,6 +14,8 @@
#include "cc/test/fake_layer_tree_host_client.h"
#include "cc/test/geometry_test_utils.h"
#include "cc/test/web_compositor_initializer.h"
+#include "cc/test/test_common.h"
+#include "cc/settings.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include <public/WebTransformationMatrix.h>
@@ -806,7 +808,8 @@ TEST(LayerChromiumLayerTreeHostTest, shouldNotAddAnimationWithoutLayerTreeHost)
// layers cannot actually animate yet. So, to prevent violating this WebCore assumption,
// the animation should not be accepted if the layer doesn't already have a layerTreeHost.
- WebKit::Platform::current()->compositorSupport()->setAcceleratedAnimationEnabled(true);
+ CCScopedSettings scopedSettings;
+ Settings::setAcceleratedAnimationEnabled(true);
WebCompositorInitializer compositorInitializer(0);
scoped_refptr<LayerChromium> layer = LayerChromium::create();
diff --git a/cc/settings.cc b/cc/settings.cc
index cfdc258..5954704 100644
--- a/cc/settings.cc
+++ b/cc/settings.cc
@@ -5,46 +5,108 @@
#include "config.h"
#include "base/command_line.h"
-#include "CCSettings.h"
+#include "cc/settings.h"
#include "cc/switches.h"
namespace {
+static bool s_settingsInitialized = false;
+
static bool s_perTilePaintingEnabled = false;
static bool s_partialSwapEnabled = false;
static bool s_acceleratedAnimationEnabled = false;
static bool s_pageScalePinchZoomEnabled = false;
-} // namespace
+static bool s_jankInsteadOfCheckerboard = false;
+static bool s_backgroundColorInsteadOfCheckerboard = false;
+
+void reset()
+{
+ s_settingsInitialized = true;
+
+ s_perTilePaintingEnabled = CommandLine::ForCurrentProcess()->HasSwitch(cc::switches::kEnablePerTilePainting);
+ s_partialSwapEnabled = CommandLine::ForCurrentProcess()->HasSwitch(cc::switches::kEnablePartialSwap);
+ s_acceleratedAnimationEnabled = CommandLine::ForCurrentProcess()->HasSwitch(cc::switches::kDisableThreadedAnimation);
+ s_pageScalePinchZoomEnabled = CommandLine::ForCurrentProcess()->HasSwitch(cc::switches::kEnablePinchInCompositor);
+ s_jankInsteadOfCheckerboard = CommandLine::ForCurrentProcess()->HasSwitch(cc::switches::kJankInsteadOfCheckerboard);
+ s_backgroundColorInsteadOfCheckerboard = CommandLine::ForCurrentProcess()->HasSwitch(cc::switches::kBackgroundColorInsteadOfCheckerboard);
+}
+
+}
namespace cc {
-bool CCSettings::perTilePaintingEnabled() { return s_perTilePaintingEnabled; }
-void CCSettings::setPerTilePaintingEnabled(bool enabled) { s_perTilePaintingEnabled = enabled; }
+bool Settings::perTilePaintingEnabled()
+{
+ if (!s_settingsInitialized)
+ reset();
+ return s_perTilePaintingEnabled;
+}
-bool CCSettings::partialSwapEnabled() { return s_partialSwapEnabled; }
-void CCSettings::setPartialSwapEnabled(bool enabled) { s_partialSwapEnabled = enabled; }
+bool Settings::partialSwapEnabled()
+{
+ if (!s_settingsInitialized)
+ reset();
+ return s_partialSwapEnabled;
+}
-bool CCSettings::acceleratedAnimationEnabled() { return s_acceleratedAnimationEnabled; }
-void CCSettings::setAcceleratedAnimationEnabled(bool enabled) { s_acceleratedAnimationEnabled = enabled; }
+bool Settings::acceleratedAnimationEnabled()
+{
+ if (!s_settingsInitialized)
+ reset();
+ return s_acceleratedAnimationEnabled;
+}
-bool CCSettings::pageScalePinchZoomEnabled() { return s_pageScalePinchZoomEnabled; }
-void CCSettings::setPageScalePinchZoomEnabled(bool enabled) { s_pageScalePinchZoomEnabled = enabled; }
+bool Settings::pageScalePinchZoomEnabled()
+{
+ if (!s_settingsInitialized)
+ reset();
+ return s_pageScalePinchZoomEnabled;
+}
+
+bool Settings::jankInsteadOfCheckerboard()
+{
+ if (!s_settingsInitialized)
+ reset();
+ return s_jankInsteadOfCheckerboard;
+}
+
+bool Settings::backgroundColorInsteadOfCheckerboard()
+{
+ if (!s_settingsInitialized)
+ reset();
+ return s_backgroundColorInsteadOfCheckerboard;
+}
+
+void Settings::resetForTest()
+{
+ reset();
+}
+
+void Settings::setPartialSwapEnabled(bool enabled)
+{
+ if (!s_settingsInitialized)
+ reset();
+ s_partialSwapEnabled = enabled;
+}
-bool CCSettings::jankInsteadOfCheckerboard()
+void Settings::setPerTilePaintingEnabled(bool enabled)
{
- return CommandLine::ForCurrentProcess()->HasSwitch(switches::kJankInsteadOfCheckerboard);
+ if (!s_settingsInitialized)
+ reset();
+ s_partialSwapEnabled = enabled;
}
-bool CCSettings::backgroundColorInsteadOfCheckerboard()
+void Settings::setAcceleratedAnimationEnabled(bool enabled)
{
- return CommandLine::ForCurrentProcess()->HasSwitch(switches::kBackgroundColorInsteadOfCheckerboard);
+ if (!s_settingsInitialized)
+ reset();
+ s_acceleratedAnimationEnabled = enabled;
}
-void CCSettings::reset()
+void Settings::setPageScalePinchZoomEnabled(bool enabled)
{
- s_perTilePaintingEnabled = false;
- s_partialSwapEnabled = false;
- s_acceleratedAnimationEnabled = false;
- s_pageScalePinchZoomEnabled = false;
+ if (!s_settingsInitialized)
+ reset();
+ s_pageScalePinchZoomEnabled = enabled;
}
} // namespace cc
diff --git a/cc/settings.h b/cc/settings.h
index cde48ca..c606652 100644
--- a/cc/settings.h
+++ b/cc/settings.h
@@ -5,7 +5,7 @@
#ifndef CCSettings_h
#define CCSettings_h
-#include "IntSize.h"
+#include "webkit/glue/webkit_glue_export.h"
namespace cc {
@@ -13,28 +13,23 @@ namespace cc {
// CCLayerTreeSettings if a ui and renderer compositor might not want the same
// setting.
-class CCSettings {
+class Settings {
public:
static bool perTilePaintingEnabled();
static bool partialSwapEnabled();
static bool acceleratedAnimationEnabled();
static bool pageScalePinchZoomEnabled();
-
static bool jankInsteadOfCheckerboard();
static bool backgroundColorInsteadOfCheckerboard();
- // These setters should only be used on the main thread before the layer
- // renderer is initialized.
- static void setPerTilePaintingEnabled(bool);
static void setPartialSwapEnabled(bool);
+ static void setPerTilePaintingEnabled(bool);
static void setAcceleratedAnimationEnabled(bool);
static void setPageScalePinchZoomEnabled(bool);
- // These settings are meant to be set only once, and only read thereafter.
- // This function is only for resetting settings in tests.
- static void reset();
+ static void resetForTest();
};
} // namespace cc
-#endif // CCSettings_h
+#endif // Settings_h
diff --git a/cc/switches.cc b/cc/switches.cc
index e9e0a77..86409fd 100644
--- a/cc/switches.cc
+++ b/cc/switches.cc
@@ -7,14 +7,24 @@
namespace cc {
namespace switches {
-// When threaded compositing is turned on, wait until the entire frame has
-// content (i.e. jank) instead of showing checkerboards for missing content.
-const char kJankInsteadOfCheckerboard[] = "jank-instead-of-checkerboard";
-
// On platforms where checkerboards are used, prefer background colors instead
// of checkerboards.
const char kBackgroundColorInsteadOfCheckerboard[] =
"background-color-instead-of-checkerboard";
+const char kDisableThreadedAnimation[] = "disable-threaded-animation";
+
+const char kEnablePartialSwap[] = "enable-partial-swap";
+
+const char kEnablePerTilePainting[] = "enable-per-tile-painting";
+
+// Enables an alternative pinch-zoom gesture support, via the threaded
+// compositor.
+const char kEnablePinchInCompositor[] = "enable-pinch-in-compositor";
+
+// When threaded compositing is turned on, wait until the entire frame has
+// content (i.e. jank) instead of showing checkerboards for missing content.
+const char kJankInsteadOfCheckerboard[] = "jank-instead-of-checkerboard";
+
} // namespace switches
} // namespace cc
diff --git a/cc/switches.h b/cc/switches.h
index cb05156..f42839b 100644
--- a/cc/switches.h
+++ b/cc/switches.h
@@ -15,8 +15,12 @@
namespace cc {
namespace switches {
-WEBKIT_GLUE_EXPORT extern const char kJankInsteadOfCheckerboard[];
WEBKIT_GLUE_EXPORT extern const char kBackgroundColorInsteadOfCheckerboard[];
+WEBKIT_GLUE_EXPORT extern const char kDisableThreadedAnimation[];
+WEBKIT_GLUE_EXPORT extern const char kEnablePartialSwap[];
+WEBKIT_GLUE_EXPORT extern const char kEnablePerTilePainting[];
+WEBKIT_GLUE_EXPORT extern const char kEnablePinchInCompositor[];
+WEBKIT_GLUE_EXPORT extern const char kJankInsteadOfCheckerboard[];
} // namespace switches
} // namespace cc
diff --git a/cc/test/test_common.h b/cc/test/test_common.h
index c748744..572a5c9 100644
--- a/cc/test/test_common.h
+++ b/cc/test/test_common.h
@@ -5,7 +5,7 @@
#ifndef CCTestCommon_h
#define CCTestCommon_h
-#include "CCSettings.h"
+#include "cc/settings.h"
namespace WebKitTests {
@@ -13,8 +13,8 @@ namespace WebKitTests {
// of this class to ensure that you start and end with a clean slate.
class CCScopedSettings {
public:
- CCScopedSettings() { cc::CCSettings::reset(); }
- ~CCScopedSettings() { cc::CCSettings::reset(); }
+ CCScopedSettings() { cc::Settings::resetForTest(); }
+ ~CCScopedSettings() { cc::Settings::resetForTest(); }
};
} // namespace WebKitTests
diff --git a/cc/threaded_unittest.cc b/cc/threaded_unittest.cc
index 6a323a9..9a5b2b8 100644
--- a/cc/threaded_unittest.cc
+++ b/cc/threaded_unittest.cc
@@ -24,6 +24,8 @@
#include "cc/test/fake_web_graphics_context_3d.h"
#include "cc/test/occlusion_tracker_test_common.h"
#include "cc/test/tiled_layer_test_common.h"
+#include "cc/test/test_common.h"
+#include "cc/settings.h"
#include "testing/gmock/include/gmock/gmock.h"
#include <public/Platform.h>
#include <public/WebCompositorSupport.h>
@@ -526,7 +528,8 @@ void CCThreadedTest::dispatchDidAddAnimation()
void CCThreadedTest::runTest(bool threaded)
{
// For these tests, we will enable threaded animations.
- Platform::current()->compositorSupport()->setAcceleratedAnimationEnabled(true);
+ CCScopedSettings scopedSettings;
+ Settings::setAcceleratedAnimationEnabled(true);
if (threaded) {
m_webThread.reset(WebKit::Platform::current()->createThread("CCThreadedTest"));
diff --git a/chrome/DEPS b/chrome/DEPS
index 2aa4f16..f055620 100644
--- a/chrome/DEPS
+++ b/chrome/DEPS
@@ -1,5 +1,6 @@
include_rules = [
"+ash",
+ "+cc",
"+crypto",
"+gpu",
"+jni",
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index fef0984..e3bfdab 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -14,6 +14,7 @@
#include "base/string_number_conversions.h"
#include "base/utf_string_conversions.h"
#include "base/values.h"
+#include "cc/switches.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/prefs/scoped_user_pref_update.h"
#include "chrome/common/chrome_content_client.h"
@@ -310,7 +311,7 @@ const Experiment kExperiments[] = {
IDS_FLAGS_DISABLE_THREADED_ANIMATION_NAME,
IDS_FLAGS_DISABLE_THREADED_ANIMATION_DESCRIPTION,
kOsAll,
- SINGLE_VALUE_TYPE(switches::kDisableThreadedAnimation)
+ SINGLE_VALUE_TYPE(cc::switches::kDisableThreadedAnimation)
},
{
"composited-layer-borders",
@@ -618,7 +619,7 @@ const Experiment kExperiments[] = {
#else
0,
#endif
- SINGLE_VALUE_TYPE(switches::kEnablePerTilePainting)
+ SINGLE_VALUE_TYPE(cc::switches::kEnablePerTilePainting)
},
{
"enable-javascript-harmony",
diff --git a/chrome/browser/chromeos/login/login_utils.cc b/chrome/browser/chromeos/login/login_utils.cc
index f1e346c..02119a0 100644
--- a/chrome/browser/chromeos/login/login_utils.cc
+++ b/chrome/browser/chromeos/login/login_utils.cc
@@ -24,6 +24,7 @@
#include "base/threading/thread_restrictions.h"
#include "base/time.h"
#include "base/utf_string_conversions.h"
+#include "cc/switches.h"
#include "chrome/browser/api/prefs/pref_member.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_shutdown.h"
@@ -756,12 +757,10 @@ std::string LoginUtilsImpl::GetOffTheRecordCommandLine(
::switches::kDisableOobeAnimation,
::switches::kDisableSeccompFilterSandbox,
::switches::kDisableSeccompSandbox,
- ::switches::kDisableThreadedAnimation,
::switches::kEnableBrowserTextSubpixelPositioning,
::switches::kEnableCompositingForFixedPosition,
::switches::kEnableGView,
::switches::kEnableLogging,
- ::switches::kEnablePartialSwap,
::switches::kEnableUIReleaseFrontSurface,
::switches::kEnablePinch,
::switches::kEnableGestureTapHighlight,
@@ -792,6 +791,9 @@ std::string LoginUtilsImpl::GetOffTheRecordCommandLine(
ash::switches::kAuraLegacyPowerButton,
ash::switches::kAuraNoShadows,
ash::switches::kAshDisablePanelFitting,
+ cc::switches::kDisableThreadedAnimation,
+ cc::switches::kEnablePartialSwap,
+ cc::switches::kEnablePinchInCompositor,
::switches::kUIEnablePartialSwap,
::switches::kUIPrioritizeInGpuProcess,
#if defined(USE_CRAS)
diff --git a/chrome/browser/ui/webui/gpu_internals_ui.cc b/chrome/browser/ui/webui/gpu_internals_ui.cc
index e7e9f60..1d5892f 100644
--- a/chrome/browser/ui/webui/gpu_internals_ui.cc
+++ b/chrome/browser/ui/webui/gpu_internals_ui.cc
@@ -17,6 +17,7 @@
#include "base/stringprintf.h"
#include "base/sys_info.h"
#include "base/values.h"
+#include "cc/switches.h"
#include "chrome/browser/crash_upload_list.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/webui/chrome_url_data_manager.h"
@@ -238,7 +239,7 @@ Value* GetFeatureStatus() {
"css_animation",
flags & (content::GPU_FEATURE_TYPE_ACCELERATED_COMPOSITING |
content::GPU_FEATURE_TYPE_3D_CSS),
- command_line.HasSwitch(switches::kDisableThreadedAnimation) ||
+ command_line.HasSwitch(cc::switches::kDisableThreadedAnimation) ||
command_line.HasSwitch(switches::kDisableAcceleratedCompositing) ||
command_line.HasSwitch(switches::kDisableAcceleratedLayers),
"Accelerated CSS animation has been disabled at the command line.",
diff --git a/content/DEPS b/content/DEPS
index 7600e654..e63c902 100644
--- a/content/DEPS
+++ b/content/DEPS
@@ -1,6 +1,8 @@
# Do NOT add chrome to the list below. We shouldn't be including files from
# src/chrome in src/content.
include_rules = [
+ "+cc",
+
"+crypto",
# The subdirectories in content/ will manually allow their own include
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 329140c..8973a65 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -785,7 +785,6 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
switches::kDisableSharedWorkers,
switches::kDisableSpeechInput,
switches::kEnableScriptedSpeech,
- switches::kDisableThreadedAnimation,
#if defined(OS_ANDROID)
switches::kEnableWebAudio,
#else
@@ -807,8 +806,6 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
switches::kEnableLogging,
switches::kDisableMediaSource,
switches::kDisableWebMediaPlayerMS,
- switches::kEnablePartialSwap,
- switches::kEnablePerTilePainting,
switches::kEnableRendererSideMixing,
switches::kEnableStrictSiteIsolation,
switches::kDisableFullScreen,
@@ -816,7 +813,6 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
switches::kEnablePreparsedJsCaching,
switches::kEnablePruneGpuCommandBuffers,
switches::kEnablePinch,
- switches::kEnablePinchInCompositor,
#if defined(OS_MACOSX)
// Allow this to be set when invoking the browser and relayed along.
switches::kEnableSandboxLogging,
@@ -864,8 +860,12 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
switches::kVideoThreads,
switches::kVModule,
switches::kWebCoreLogChannels,
- cc::switches::kJankInsteadOfCheckerboard,
cc::switches::kBackgroundColorInsteadOfCheckerboard,
+ cc::switches::kDisableThreadedAnimation,
+ cc::switches::kEnablePartialSwap,
+ cc::switches::kEnablePerTilePainting,
+ cc::switches::kEnablePinchInCompositor,
+ cc::switches::kJankInsteadOfCheckerboard,
};
renderer_cmd->CopySwitchesFrom(browser_cmd, kSwitchNames,
arraysize(kSwitchNames));
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index b13778c..c09ad4d 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -15,6 +15,7 @@
#include "base/sys_info.h"
#include "base/time.h"
#include "base/utf_string_conversions.h"
+#include "cc/switches.h"
#include "content/browser/browser_plugin/browser_plugin_embedder.h"
#include "content/browser/browser_plugin/browser_plugin_guest.h"
#include "content/browser/browser_plugin/old/old_browser_plugin_host.h"
@@ -683,7 +684,7 @@ WebPreferences WebContentsImpl::GetWebkitPrefs(RenderViewHost* rvh,
prefs.number_of_cpu_cores = base::SysInfo::NumberOfProcessors();
prefs.apply_page_scale_factor_in_compositor =
- command_line.HasSwitch(switches::kEnablePinchInCompositor);
+ command_line.HasSwitch(cc::switches::kEnablePinchInCompositor);
content::GetContentClient()->browser()->OverrideWebkitPrefs(rvh, url, &prefs);
diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc
index 1c5b759..9b894a6 100644
--- a/content/public/common/content_switches.cc
+++ b/content/public/common/content_switches.cc
@@ -209,9 +209,6 @@ const char kEnableScriptedSpeech[] = "enable-scripted-speech";
// Specifies the request key for the continuous speech recognition webservice.
const char kSpeechRecognitionWebserviceKey[] = "speech-service-key";
-// Disables animation on the compositor thread.
-const char kDisableThreadedAnimation[] = "disable-threaded-animation";
-
#if defined(OS_ANDROID)
// Enable web audio API.
const char kEnableWebAudio[] = "enable-webaudio";
@@ -318,9 +315,6 @@ const char kEnableDeprecatedPeerConnection[] =
// assumed to be sRGB.
const char kEnableMonitorProfile[] = "enable-monitor-profile";
-// Enables partial swaps in the WK compositor on platforms that support it.
-const char kEnablePartialSwap[] = "enable-partial-swap";
-
// Enables UI releasing handle to front surface for background tabs on platforms
// that support it.
const char kEnableUIReleaseFrontSurface[] = "enable-ui-release-front-surface";
@@ -328,10 +322,6 @@ const char kEnableUIReleaseFrontSurface[] = "enable-ui-release-front-surface";
// Enables touch-screen pinch gestures.
const char kEnablePinch[] = "enable-pinch";
-// Enables an alternative pinch-zoom gesture support, via the threaded
-// compositor.
-const char kEnablePinchInCompositor[] = "enable-pinch-in-compositor";
-
// Enable caching of pre-parsed JS script data. See http://crbug.com/32407.
const char kEnablePreparsedJsCaching[] = "enable-preparsed-js-caching";
@@ -724,9 +714,6 @@ const char kScrollPixels[] = "scroll-pixels";
const char kUseSystemSSL[] = "use-system-ssl";
#endif
-// Enable per-tile page painting.
-const char kEnablePerTilePainting[] = "enable-per-tile-painting";
-
// Disables the use of a 3D software rasterizer.
const char kDisableSoftwareRasterizer[] = "disable-software-rasterizer";
diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h
index 4de3819..5251e6e 100644
--- a/content/public/common/content_switches.h
+++ b/content/public/common/content_switches.h
@@ -78,7 +78,6 @@ extern const char kDisableSiteSpecificQuirks[];
CONTENT_EXPORT extern const char kDisableSpeechInput[];
CONTENT_EXPORT extern const char kEnableScriptedSpeech[];
extern const char kSpeechRecognitionWebserviceKey[];
-CONTENT_EXPORT extern const char kDisableThreadedAnimation[];
#if defined(OS_ANDROID)
CONTENT_EXPORT extern const char kEnableWebAudio[];
#else
@@ -110,10 +109,8 @@ extern const char kDisableMediaSource[];
extern const char kDisableWebMediaPlayerMS[];
extern const char kEnableDeprecatedPeerConnection[];
extern const char kEnableMonitorProfile[];
-extern const char kEnablePartialSwap[];
extern const char kEnableUIReleaseFrontSurface[];
extern const char kEnablePinch[];
-CONTENT_EXPORT extern const char kEnablePinchInCompositor[];
extern const char kEnablePreparsedJsCaching[];
CONTENT_EXPORT extern const char kEnablePrivilegedWebGLExtensions[];
extern const char kEnablePruneGpuCommandBuffers[];
@@ -236,8 +233,6 @@ extern const char kScrollPixels[];
extern const char kUseSystemSSL[];
#endif
-extern const char kEnablePerTilePainting[];
-
#if defined(USE_AURA)
CONTENT_EXPORT extern const char kFlingTapSuppressMaxDown[];
CONTENT_EXPORT extern const char kFlingTapSuppressMaxGap[];
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index 57af88c..bba9240 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -570,14 +570,6 @@ void RenderThreadImpl::EnsureWebKitInitialized() {
WebKit::WebCompositorSupport* compositor_support =
WebKit::Platform::current()->compositorSupport();
const CommandLine& command_line = *CommandLine::ForCurrentProcess();
- compositor_support->setAcceleratedAnimationEnabled(
- !command_line.HasSwitch(switches::kDisableThreadedAnimation));
- compositor_support->setPerTilePaintingEnabled(
- command_line.HasSwitch(switches::kEnablePerTilePainting));
- compositor_support->setPartialSwapEnabled(
- command_line.HasSwitch(switches::kEnablePartialSwap));
- compositor_support->setPageScalePinchZoomEnabled(
- command_line.HasSwitch(switches::kEnablePinchInCompositor));
// TODO(fsamuel): Guests don't currently support threaded compositing.
// This should go away with the new design of the browser plugin.
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 0730868..7d8db32 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -28,6 +28,7 @@
#include "base/sys_string_conversions.h"
#include "base/time.h"
#include "base/utf_string_conversions.h"
+#include "cc/switches.h"
#include "content/common/appcache/appcache_dispatcher.h"
#include "content/common/child_thread.h"
#include "content/common/clipboard_messages.h"
@@ -3204,7 +3205,7 @@ void RenderViewImpl::ProcessAcceleratedPinchZoomFlags(
bool enable_pinch = enable_viewport ||
command_line.HasSwitch(switches::kEnablePinch);
bool enable_pinch_in_compositor =
- command_line.HasSwitch(switches::kEnablePinchInCompositor);
+ command_line.HasSwitch(cc::switches::kEnablePinchInCompositor);
if (!enable_pinch &&
webview()->isAcceleratedCompositingActive() &&
diff --git a/webkit/compositor_bindings/web_compositor_impl.cc b/webkit/compositor_bindings/web_compositor_impl.cc
index e57615b..fedf1bc 100644
--- a/webkit/compositor_bindings/web_compositor_impl.cc
+++ b/webkit/compositor_bindings/web_compositor_impl.cc
@@ -38,31 +38,6 @@ bool WebCompositor::isThreadingEnabled()
void WebCompositor::shutdown()
{
WebCompositorImpl::shutdown();
- CCSettings::reset();
-}
-
-void WebCompositor::setPerTilePaintingEnabled(bool enabled)
-{
- ASSERT(!WebCompositorImpl::initialized());
- CCSettings::setPerTilePaintingEnabled(enabled);
-}
-
-void WebCompositor::setPartialSwapEnabled(bool enabled)
-{
- ASSERT(!WebCompositorImpl::initialized());
- CCSettings::setPartialSwapEnabled(enabled);
-}
-
-void WebCompositor::setAcceleratedAnimationEnabled(bool enabled)
-{
- ASSERT(!WebCompositorImpl::initialized());
- CCSettings::setAcceleratedAnimationEnabled(enabled);
-}
-
-void WebCompositor::setPageScalePinchZoomEnabled(bool enabled)
-{
- ASSERT(!WebCompositorImpl::initialized());
- CCSettings::setPageScalePinchZoomEnabled(enabled);
}
void WebCompositorImpl::initialize(WebThread* implThread)
diff --git a/webkit/compositor_bindings/web_compositor_support_impl.cc b/webkit/compositor_bindings/web_compositor_support_impl.cc
index fb938a5..32a1840 100644
--- a/webkit/compositor_bindings/web_compositor_support_impl.cc
+++ b/webkit/compositor_bindings/web_compositor_support_impl.cc
@@ -6,6 +6,7 @@
#include "webkit/compositor_bindings/web_compositor_support_impl.h"
#include "base/memory/scoped_ptr.h"
+#include "cc/settings.h"
#include "webkit/compositor_bindings/web_animation_impl.h"
#include "webkit/compositor_bindings/web_compositor_impl.h"
#include "webkit/compositor_bindings/web_content_layer_impl.h"
@@ -67,19 +68,19 @@ void WebCompositorSupportImpl::shutdown() {
}
void WebCompositorSupportImpl::setPerTilePaintingEnabled(bool enabled) {
- WebCompositorImpl::setPerTilePaintingEnabled(enabled);
+ cc::Settings::setPerTilePaintingEnabled(enabled);
}
void WebCompositorSupportImpl::setPartialSwapEnabled(bool enabled) {
- WebCompositorImpl::setPartialSwapEnabled(enabled);
+ cc::Settings::setPartialSwapEnabled(enabled);
}
void WebCompositorSupportImpl::setAcceleratedAnimationEnabled(bool enabled) {
- WebCompositorImpl::setAcceleratedAnimationEnabled(enabled);
+ cc::Settings::setAcceleratedAnimationEnabled(enabled);
}
void WebCompositorSupportImpl::setPageScalePinchZoomEnabled(bool enabled) {
- WebCompositorImpl::setPageScalePinchZoomEnabled(enabled);
+ cc::Settings::setPageScalePinchZoomEnabled(enabled);
}
WebLayerTreeView* WebCompositorSupportImpl::createLayerTreeView(