summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cc/cc.gyp2
-rw-r--r--cc/cc_tests.gyp1
-rw-r--r--cc/content_layer.cc3
-rw-r--r--cc/gl_renderer.cc6
-rw-r--r--cc/gl_renderer_unittest.cc5
-rw-r--r--cc/layer.cc3
-rw-r--r--cc/layer_impl.cc4
-rw-r--r--cc/layer_tree_host.cc16
-rw-r--r--cc/layer_tree_host.h6
-rw-r--r--cc/layer_tree_host_impl.cc31
-rw-r--r--cc/layer_tree_host_impl.h2
-rw-r--r--cc/layer_tree_host_impl_unittest.cc58
-rw-r--r--cc/layer_tree_host_unittest.cc1
-rw-r--r--cc/layer_unittest.cc11
-rw-r--r--cc/scheduler.h1
-rw-r--r--cc/scheduler_state_machine.cc1
-rw-r--r--cc/settings.cc110
-rw-r--r--cc/settings.h35
-rw-r--r--cc/software_renderer_unittest.cc2
-rw-r--r--cc/test/layer_tree_test_common.cc7
-rw-r--r--cc/test/test_common.h22
-rw-r--r--chrome/browser/chrome_content_browser_client.cc4
-rw-r--r--content/browser/renderer_host/render_process_host_impl.cc3
-rw-r--r--content/browser/web_contents/web_contents_impl.cc33
-rw-r--r--content/common/view_messages.h11
-rw-r--r--content/renderer/pepper/pepper_plugin_delegate_impl.cc3
-rw-r--r--ppapi/shared_impl/ppapi_preferences.cc5
-rw-r--r--webkit/compositor_bindings/web_compositor_support_impl.cc9
-rw-r--r--webkit/compositor_bindings/web_layer_tree_view_impl.cc3
-rw-r--r--webkit/glue/webpreferences.cc27
-rw-r--r--webkit/glue/webpreferences.h13
31 files changed, 122 insertions, 316 deletions
diff --git a/cc/cc.gyp b/cc/cc.gyp
index 62c54ad..e4ad51a 100644
--- a/cc/cc.gyp
+++ b/cc/cc.gyp
@@ -185,8 +185,6 @@
'scrollbar_layer.h',
'scrollbar_layer_impl.cc',
'scrollbar_layer_impl.h',
- 'settings.cc',
- 'settings.h',
'shader.cc',
'shader.h',
'shared_quad_state.cc',
diff --git a/cc/cc_tests.gyp b/cc/cc_tests.gyp
index cf2f214..e3c52b7 100644
--- a/cc/cc_tests.gyp
+++ b/cc/cc_tests.gyp
@@ -84,7 +84,6 @@
'test/render_pass_test_common.h',
'test/scheduler_test_common.cc',
'test/scheduler_test_common.h',
- 'test/test_common.h',
'test/tiled_layer_test_common.cc',
'test/tiled_layer_test_common.h',
],
diff --git a/cc/content_layer.cc b/cc/content_layer.cc
index 5f46896..b34ce10 100644
--- a/cc/content_layer.cc
+++ b/cc/content_layer.cc
@@ -11,7 +11,6 @@
#include "cc/content_layer_client.h"
#include "cc/layer_painter.h"
#include "cc/layer_tree_host.h"
-#include "cc/settings.h"
namespace cc {
@@ -87,7 +86,7 @@ void ContentLayer::createUpdaterIfNeeded()
scoped_ptr<LayerPainter> painter = ContentLayerPainter::create(m_client).PassAs<LayerPainter>();
if (layerTreeHost()->settings().acceleratePainting)
m_updater = SkPictureContentLayerUpdater::create(painter.Pass());
- else if (Settings::perTilePaintingEnabled())
+ else if (layerTreeHost()->settings().perTilePaintingEnabled)
m_updater = BitmapSkPictureContentLayerUpdater::create(painter.Pass());
else
m_updater = BitmapContentLayerUpdater::create(painter.Pass());
diff --git a/cc/gl_renderer.cc b/cc/gl_renderer.cc
index 8490d82..7256ae0 100644
--- a/cc/gl_renderer.cc
+++ b/cc/gl_renderer.cc
@@ -19,7 +19,6 @@
#include "cc/render_pass.h"
#include "cc/render_surface_filters.h"
#include "cc/scoped_resource.h"
-#include "cc/settings.h"
#include "cc/single_thread_proxy.h"
#include "cc/stream_video_draw_quad.h"
#include "cc/texture_draw_quad.h"
@@ -70,8 +69,7 @@ scoped_ptr<GLRenderer> GLRenderer::create(RendererClient* client, ResourceProvid
return renderer.Pass();
}
-GLRenderer::GLRenderer(RendererClient* client,
- ResourceProvider* resourceProvider)
+GLRenderer::GLRenderer(RendererClient* client, ResourceProvider* resourceProvider)
: DirectRenderer(client, resourceProvider)
, m_offscreenFramebufferId(0)
, m_sharedGeometryQuad(gfx::RectF(-0.5f, -0.5f, 1.0f, 1.0f))
@@ -107,7 +105,7 @@ bool GLRenderer::initialize()
m_capabilities.contextHasCachedFrontBuffer = extensions.count("GL_CHROMIUM_front_buffer_cached");
- m_capabilities.usingPartialSwap = Settings::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 (m_client->hasImplThread())
diff --git a/cc/gl_renderer_unittest.cc b/cc/gl_renderer_unittest.cc
index eb5f1fb..3d3f68a 100644
--- a/cc/gl_renderer_unittest.cc
+++ b/cc/gl_renderer_unittest.cc
@@ -7,10 +7,8 @@
#include "cc/draw_quad.h"
#include "cc/prioritized_resource_manager.h"
#include "cc/resource_provider.h"
-#include "cc/settings.h"
#include "cc/test/fake_web_compositor_output_surface.h"
#include "cc/test/fake_web_graphics_context_3d.h"
-#include "cc/test/test_common.h"
#include "cc/test/render_pass_test_common.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -138,7 +136,6 @@ protected:
FakeRendererClient m_mockClient;
scoped_ptr<ResourceProvider> m_resourceProvider;
FakeRendererGL m_renderer;
- ScopedSettings m_scopedSettings;
};
// Test GLRenderer discardFramebuffer functionality:
@@ -295,7 +292,6 @@ public:
// This test isn't using the same fixture as GLRendererTest, and you can't mix TEST() and TEST_F() with the same name, hence LRC2.
TEST(GLRendererTest2, initializationDoesNotMakeSynchronousCalls)
{
- ScopedSettings scopedSettings;
FakeRendererClient mockClient;
scoped_ptr<GraphicsContext> context(FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new ForbidSynchronousCallContext)));
scoped_ptr<ResourceProvider> resourceProvider(ResourceProvider::create(context.get()));
@@ -339,7 +335,6 @@ private:
TEST(GLRendererTest2, initializationWithQuicklyLostContextDoesNotAssert)
{
- ScopedSettings scopedSettings;
FakeRendererClient mockClient;
scoped_ptr<GraphicsContext> context(FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new LoseContextOnFirstGetContext)));
scoped_ptr<ResourceProvider> resourceProvider(ResourceProvider::create(context.get()));
diff --git a/cc/layer.cc b/cc/layer.cc
index 88390a0..8164ee9 100644
--- a/cc/layer.cc
+++ b/cc/layer.cc
@@ -9,7 +9,6 @@
#include "cc/layer_animation_controller.h"
#include "cc/layer_impl.h"
#include "cc/layer_tree_host.h"
-#include "cc/settings.h"
#include "third_party/skia/include/core/SkImageFilter.h"
#include "ui/gfx/rect_conversions.h"
#include <public/WebAnimationDelegate.h>
@@ -768,7 +767,7 @@ bool Layer::addAnimation(scoped_ptr <ActiveAnimation> animation)
if (!m_layerTreeHost)
return false;
- if (!Settings::acceleratedAnimationEnabled())
+ if (!m_layerTreeHost->settings().acceleratedAnimationEnabled)
return false;
m_layerAnimationController->addAnimation(animation.Pass());
diff --git a/cc/layer_impl.cc b/cc/layer_impl.cc
index 25a5fc5..ef4dee3 100644
--- a/cc/layer_impl.cc
+++ b/cc/layer_impl.cc
@@ -9,11 +9,11 @@
#include "cc/debug_border_draw_quad.h"
#include "cc/geometry.h"
#include "cc/layer_sorter.h"
+#include "cc/layer_tree_host_impl.h"
#include "cc/math_util.h"
#include "cc/proxy.h"
#include "cc/quad_sink.h"
#include "cc/scrollbar_animation_controller.h"
-#include "cc/settings.h"
#include "third_party/skia/include/core/SkImageFilter.h"
#include "ui/gfx/point_conversions.h"
#include "ui/gfx/rect_conversions.h"
@@ -234,7 +234,7 @@ InputHandlerClient::ScrollStatus LayerImpl::tryScroll(const gfx::PointF& screenS
bool LayerImpl::drawCheckerboardForMissingTiles() const
{
- return m_drawCheckerboardForMissingTiles && !Settings::backgroundColorInsteadOfCheckerboard();
+ return m_drawCheckerboardForMissingTiles && !m_layerTreeHostImpl->settings().backgroundColorInsteadOfCheckerboard;
}
gfx::Rect LayerImpl::layerRectToContentRect(const gfx::RectF& layerRect) const
diff --git a/cc/layer_tree_host.cc b/cc/layer_tree_host.cc
index b92e9ba..cc58a9f 100644
--- a/cc/layer_tree_host.cc
+++ b/cc/layer_tree_host.cc
@@ -20,7 +20,6 @@
#include "cc/math_util.h"
#include "cc/occlusion_tracker.h"
#include "cc/overdraw_metrics.h"
-#include "cc/settings.h"
#include "cc/single_thread_proxy.h"
#include "cc/switches.h"
#include "cc/thread.h"
@@ -47,6 +46,12 @@ LayerTreeSettings::LayerTreeSettings()
, showReplicaScreenSpaceRects(false)
, showOccludingRects(false)
, renderVSyncEnabled(true)
+ , perTilePaintingEnabled(false)
+ , partialSwapEnabled(false)
+ , acceleratedAnimationEnabled(true)
+ , pageScalePinchZoomEnabled(false)
+ , backgroundColorInsteadOfCheckerboard(false)
+ , showOverdrawInTracing(false)
, refreshRate(0)
, maxPartialTextureUpdates(std::numeric_limits<size_t>::max())
, defaultTileSize(gfx::Size(256, 256))
@@ -59,6 +64,9 @@ LayerTreeSettings::LayerTreeSettings()
showScreenSpaceRects = CommandLine::ForCurrentProcess()->HasSwitch(cc::switches::kShowScreenSpaceRects);
showReplicaScreenSpaceRects = CommandLine::ForCurrentProcess()->HasSwitch(cc::switches::kShowReplicaScreenSpaceRects);
showOccludingRects = CommandLine::ForCurrentProcess()->HasSwitch(cc::switches::kShowOccludingRects);
+ partialSwapEnabled = CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnablePartialSwap);
+ backgroundColorInsteadOfCheckerboard = CommandLine::ForCurrentProcess()->HasSwitch(switches::kBackgroundColorInsteadOfCheckerboard);
+ showOverdrawInTracing = CommandLine::ForCurrentProcess()->HasSwitch(switches::kTraceOverdraw);
}
LayerTreeSettings::~LayerTreeSettings()
@@ -545,7 +553,7 @@ void LayerTreeHost::updateLayers(Layer* rootLayer, ResourceUpdateQueue& queue)
LayerList updateList;
{
- if (Settings::pageScalePinchZoomEnabled()) {
+ if (m_settings.pageScalePinchZoomEnabled) {
Layer* rootScroll = findFirstScrollableLayer(rootLayer);
if (rootScroll)
rootScroll->setImplTransform(m_implTransform);
@@ -672,7 +680,7 @@ bool LayerTreeHost::paintLayerContents(const LayerList& renderSurfaceLayerList,
typedef LayerIterator<Layer, LayerList, RenderSurface, LayerIteratorActions::FrontToBack> LayerIteratorType;
bool needMoreUpdates = false;
- bool recordMetricsForFrame = Settings::traceOverdraw() && base::debug::TraceLog::GetInstance() && base::debug::TraceLog::GetInstance()->IsEnabled();
+ bool recordMetricsForFrame = m_settings.showOverdrawInTracing && base::debug::TraceLog::GetInstance() && base::debug::TraceLog::GetInstance()->IsEnabled();
OcclusionTracker occlusionTracker(m_rootLayer->renderSurface()->contentRect(), recordMetricsForFrame);
occlusionTracker.setMinimumTrackingSize(m_settings.minimumOcclusionTrackingSize);
@@ -803,7 +811,7 @@ void LayerTreeHost::setDeviceScaleFactor(float deviceScaleFactor)
void LayerTreeHost::animateLayers(base::TimeTicks time)
{
- if (!Settings::acceleratedAnimationEnabled() || !m_needsAnimateLayers)
+ if (!m_settings.acceleratedAnimationEnabled || !m_needsAnimateLayers)
return;
TRACE_EVENT0("cc", "LayerTreeHostImpl::animateLayers");
diff --git a/cc/layer_tree_host.h b/cc/layer_tree_host.h
index b81c7ca..63401c6 100644
--- a/cc/layer_tree_host.h
+++ b/cc/layer_tree_host.h
@@ -63,6 +63,12 @@ struct CC_EXPORT LayerTreeSettings {
bool showReplicaScreenSpaceRects;
bool showOccludingRects;
bool renderVSyncEnabled;
+ bool perTilePaintingEnabled;
+ bool partialSwapEnabled;
+ bool acceleratedAnimationEnabled;
+ bool pageScalePinchZoomEnabled;
+ bool backgroundColorInsteadOfCheckerboard;
+ bool showOverdrawInTracing;
double refreshRate;
size_t maxPartialTextureUpdates;
gfx::Size defaultTileSize;
diff --git a/cc/layer_tree_host_impl.cc b/cc/layer_tree_host_impl.cc
index 21207b1..0982469 100644
--- a/cc/layer_tree_host_impl.cc
+++ b/cc/layer_tree_host_impl.cc
@@ -28,7 +28,6 @@
#include "cc/rendering_stats.h"
#include "cc/scrollbar_animation_controller.h"
#include "cc/scrollbar_layer_impl.h"
-#include "cc/settings.h"
#include "cc/single_thread_proxy.h"
#include "cc/software_renderer.h"
#include "cc/texture_uploader.h"
@@ -133,14 +132,14 @@ gfx::Vector2dF PinchZoomViewport::applyScroll(const gfx::Vector2dF& delta)
return overflow;
}
-WebTransformationMatrix PinchZoomViewport::implTransform() const
+WebTransformationMatrix PinchZoomViewport::implTransform(bool pageScalePinchZoomEnabled) const
{
WebTransformationMatrix transform;
transform.scale(m_pageScaleDelta);
// If the pinch state is applied in the impl, then push it to the
// impl transform, otherwise the scale is handled by WebCore.
- if (Settings::pageScalePinchZoomEnabled()) {
+ if (pageScalePinchZoomEnabled) {
transform.scale(m_pageScaleFactor);
transform.translate(-m_pinchViewportScrollDelta.x(),
-m_pinchViewportScrollDelta.y());
@@ -295,7 +294,7 @@ void LayerTreeHostImpl::startPageScaleAnimation(gfx::Vector2d targetOffset, bool
gfx::Vector2dF scrollTotal = m_rootScrollLayerImpl->scrollOffset() + m_rootScrollLayerImpl->scrollDelta();
gfx::SizeF scaledContentSize = contentSize();
- if (!Settings::pageScalePinchZoomEnabled()) {
+ if (!m_settings.pageScalePinchZoomEnabled) {
scrollTotal.Scale(1 / m_pinchZoomViewport.pageScaleFactor());
scaledContentSize.Scale(1 / m_pinchZoomViewport.pageScaleFactor());
}
@@ -306,12 +305,12 @@ void LayerTreeHostImpl::startPageScaleAnimation(gfx::Vector2d targetOffset, bool
if (anchorPoint) {
gfx::Vector2dF anchor(targetOffset);
- if (!Settings::pageScalePinchZoomEnabled())
+ if (!m_settings.pageScalePinchZoomEnabled)
anchor.Scale(1 / pageScale);
m_pageScaleAnimation->zoomWithAnchor(anchor, pageScale, duration.InSecondsF());
} else {
gfx::Vector2dF scaledTargetOffset = targetOffset;
- if (!Settings::pageScalePinchZoomEnabled())
+ if (!m_settings.pageScalePinchZoomEnabled)
scaledTargetOffset.Scale(1 / pageScale);
m_pageScaleAnimation->zoomTo(scaledTargetOffset, pageScale, duration.InSecondsF());
}
@@ -384,7 +383,7 @@ bool LayerTreeHostImpl::calculateRenderPasses(FrameData& frame)
renderSurfaceLayer->renderSurface()->appendRenderPasses(frame);
}
- bool recordMetricsForFrame = Settings::traceOverdraw() && base::debug::TraceLog::GetInstance() && base::debug::TraceLog::GetInstance()->IsEnabled();
+ bool recordMetricsForFrame = m_settings.showOverdrawInTracing && base::debug::TraceLog::GetInstance() && base::debug::TraceLog::GetInstance()->IsEnabled();
OcclusionTrackerImpl occlusionTracker(m_rootLayerImpl->renderSurface()->contentRect(), recordMetricsForFrame);
occlusionTracker.setMinimumTrackingSize(m_settings.minimumOcclusionTrackingSize);
@@ -957,7 +956,7 @@ void LayerTreeHostImpl::setPageScaleFactorAndLimits(float pageScaleFactor, float
float pageScaleChange = pageScaleFactor / m_pinchZoomViewport.pageScaleFactor();
m_pinchZoomViewport.setPageScaleFactorAndLimits(pageScaleFactor, minPageScaleFactor, maxPageScaleFactor);
- if (!Settings::pageScalePinchZoomEnabled()) {
+ if (!m_settings.pageScalePinchZoomEnabled) {
if (pageScaleChange != 1)
adjustScrollsForPageScaleChange(m_rootScrollLayerImpl, pageScaleChange);
}
@@ -987,7 +986,7 @@ void LayerTreeHostImpl::updateMaxScrollOffset()
}
gfx::Size contentBounds = contentSize();
- if (Settings::pageScalePinchZoomEnabled()) {
+ if (m_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.
@@ -1237,12 +1236,12 @@ void LayerTreeHostImpl::pinchGestureUpdate(float magnifyDelta, gfx::Point anchor
m_previousPinchAnchor = anchor;
- if (Settings::pageScalePinchZoomEnabled()) {
+ if (m_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));
}
- gfx::Vector2dF scrollOverflow = Settings::pageScalePinchZoomEnabled() ? m_pinchZoomViewport.applyScroll(move) : move;
+ gfx::Vector2dF scrollOverflow = m_settings.pageScalePinchZoomEnabled ? m_pinchZoomViewport.applyScroll(move) : move;
m_rootScrollLayerImpl->scrollBy(scrollOverflow);
if (m_rootScrollLayerImpl->scrollbarAnimationController())
@@ -1265,7 +1264,7 @@ void LayerTreeHostImpl::pinchGestureEnd()
void LayerTreeHostImpl::computeDoubleTapZoomDeltas(ScrollAndScaleSet* scrollInfo)
{
gfx::Vector2dF scaledScrollOffset = m_pageScaleAnimation->targetScrollOffset();
- if (!Settings::pageScalePinchZoomEnabled())
+ if (!m_settings.pageScalePinchZoomEnabled)
scaledScrollOffset.Scale(m_pinchZoomViewport.pageScaleFactor());
makeScrollAndScaleSet(scrollInfo, ToFlooredVector2d(scaledScrollOffset), m_pageScaleAnimation->targetPageScaleFactor());
}
@@ -1343,7 +1342,7 @@ scoped_ptr<ScrollAndScaleSet> LayerTreeHostImpl::processScrollDeltas()
m_pinchZoomViewport.setSentPageScaleDelta(1);
// FIXME(aelias): Make pinch-zoom painting optimization compatible with
// compositor-side scaling.
- if (!Settings::pageScalePinchZoomEnabled() && m_pinchGestureActive)
+ if (!m_settings.pageScalePinchZoomEnabled && m_pinchGestureActive)
computePinchZoomDeltas(scrollInfo.get());
else if (m_pageScaleAnimation.get())
computeDoubleTapZoomDeltas(scrollInfo.get());
@@ -1359,7 +1358,7 @@ scoped_ptr<ScrollAndScaleSet> LayerTreeHostImpl::processScrollDeltas()
WebTransformationMatrix LayerTreeHostImpl::implTransform() const
{
- return m_pinchZoomViewport.implTransform();
+ return m_pinchZoomViewport.implTransform(m_settings.pageScalePinchZoomEnabled);
}
void LayerTreeHostImpl::setFullRootLayerDamage()
@@ -1382,7 +1381,7 @@ void LayerTreeHostImpl::animatePageScale(base::TimeTicks time)
setPageScaleDelta(m_pageScaleAnimation->pageScaleFactorAtTime(monotonicTime) / m_pinchZoomViewport.pageScaleFactor());
gfx::Vector2dF nextScroll = m_pageScaleAnimation->scrollOffsetAtTime(monotonicTime);
- if (!Settings::pageScalePinchZoomEnabled())
+ if (!m_settings.pageScalePinchZoomEnabled)
nextScroll.Scale(m_pinchZoomViewport.pageScaleFactor());
m_rootScrollLayerImpl->scrollBy(nextScroll - scrollTotal);
m_client->setNeedsRedrawOnImplThread();
@@ -1395,7 +1394,7 @@ void LayerTreeHostImpl::animatePageScale(base::TimeTicks time)
void LayerTreeHostImpl::animateLayers(base::TimeTicks monotonicTime, base::Time wallClockTime)
{
- if (!Settings::acceleratedAnimationEnabled() || !m_needsAnimateLayers || !m_rootLayerImpl)
+ if (!m_settings.acceleratedAnimationEnabled || !m_needsAnimateLayers || !m_rootLayerImpl)
return;
TRACE_EVENT0("cc", "LayerTreeHostImpl::animateLayers");
diff --git a/cc/layer_tree_host_impl.h b/cc/layer_tree_host_impl.h
index 8e59c62..1b64eb9 100644
--- a/cc/layer_tree_host_impl.h
+++ b/cc/layer_tree_host_impl.h
@@ -86,7 +86,7 @@ public:
// this constraint.
gfx::Vector2dF applyScroll(const gfx::Vector2dF&);
- WebKit::WebTransformationMatrix implTransform() const;
+ WebKit::WebTransformationMatrix implTransform(bool pageScalePinchZoomEnabled) const;
private:
float m_pageScaleFactor;
diff --git a/cc/layer_tree_host_impl_unittest.cc b/cc/layer_tree_host_impl_unittest.cc
index 9ac8970..c6aa8f4 100644
--- a/cc/layer_tree_host_impl_unittest.cc
+++ b/cc/layer_tree_host_impl_unittest.cc
@@ -21,7 +21,6 @@
#include "cc/render_pass_draw_quad.h"
#include "cc/scrollbar_geometry_fixed_thumb.h"
#include "cc/scrollbar_layer_impl.h"
-#include "cc/settings.h"
#include "cc/single_thread_proxy.h"
#include "cc/solid_color_draw_quad.h"
#include "cc/test/animation_test_common.h"
@@ -32,7 +31,6 @@
#include "cc/test/geometry_test_utils.h"
#include "cc/test/layer_test_common.h"
#include "cc/test/render_pass_test_common.h"
-#include "cc/test/test_common.h"
#include "cc/texture_draw_quad.h"
#include "cc/texture_layer_impl.h"
#include "cc/tile_draw_quad.h"
@@ -62,9 +60,9 @@ namespace cc {
namespace {
// This test is parametrized to run all tests with the
-// Settings::pageScalePinchZoomEnabled field enabled and disabled.
+// m_settings.pageScalePinchZoomEnabled field enabled and disabled.
class LayerTreeHostImplTest : public testing::TestWithParam<bool>,
- public LayerTreeHostImplClient {
+ public LayerTreeHostImplClient {
public:
LayerTreeHostImplTest()
: m_proxy(scoped_ptr<Thread>(NULL))
@@ -80,9 +78,9 @@ public:
virtual void SetUp()
{
- Settings::setPageScalePinchZoomEnabled(GetParam());
LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size();
+ settings.pageScalePinchZoomEnabled = GetParam();
m_hostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
m_hostImpl->initializeRenderer(createContext());
@@ -107,10 +105,9 @@ public:
scoped_ptr<LayerTreeHostImpl> createLayerTreeHost(bool partialSwap, scoped_ptr<GraphicsContext> graphicsContext, scoped_ptr<LayerImpl> root)
{
- Settings::setPartialSwapEnabled(partialSwap);
-
LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size();
+ settings.partialSwapEnabled = partialSwap;
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
@@ -204,7 +201,6 @@ protected:
bool m_didRequestCommit;
bool m_didRequestRedraw;
bool m_reduceMemoryResult;
- ScopedSettings m_scopedSettings;
};
class FakeWebGraphicsContext3DMakeCurrentFails : public FakeWebGraphicsContext3D {
@@ -528,7 +524,7 @@ TEST_P(LayerTreeHostImplTest, maxScrollOffsetChangedByDeviceScaleFactor)
TEST_P(LayerTreeHostImplTest, implPinchZoom)
{
// This test is specific to the page-scale based pinch zoom.
- if (!Settings::pageScalePinchZoomEnabled())
+ if (!m_hostImpl->settings().pageScalePinchZoomEnabled)
return;
setupScrollAndContentsLayers(gfx::Size(100, 100));
@@ -591,7 +587,7 @@ TEST_P(LayerTreeHostImplTest, pinchGesture)
LayerImpl* scrollLayer = m_hostImpl->rootScrollLayer();
DCHECK(scrollLayer);
- const float minPageScale = Settings::pageScalePinchZoomEnabled() ? 1 : 0.5;
+ const float minPageScale = m_hostImpl->settings().pageScalePinchZoomEnabled ? 1 : 0.5;
const float maxPageScale = 4;
const WebTransformationMatrix identityScaleTransform;
@@ -642,7 +638,7 @@ TEST_P(LayerTreeHostImplTest, pinchGesture)
scoped_ptr<ScrollAndScaleSet> scrollInfo = m_hostImpl->processScrollDeltas();
EXPECT_EQ(scrollInfo->pageScaleDelta, minPageScale);
- if (!Settings::pageScalePinchZoomEnabled()) {
+ if (!m_hostImpl->settings().pageScalePinchZoomEnabled) {
// Pushed to (0,0) via clamping against contents layer size.
expectContains(*scrollInfo, scrollLayer->id(), gfx::Vector2d(-50, -50));
} else {
@@ -730,7 +726,7 @@ TEST_P(LayerTreeHostImplTest, inhibitScrollAndPageScaleUpdatesWhilePinchZooming)
LayerImpl* scrollLayer = m_hostImpl->rootScrollLayer();
DCHECK(scrollLayer);
- const float minPageScale = Settings::pageScalePinchZoomEnabled() ? 1 : 0.5;
+ const float minPageScale = m_hostImpl->settings().pageScalePinchZoomEnabled ? 1 : 0.5;
const float maxPageScale = 4;
// Pinch zoom in.
@@ -751,7 +747,7 @@ TEST_P(LayerTreeHostImplTest, inhibitScrollAndPageScaleUpdatesWhilePinchZooming)
m_hostImpl->pinchGestureEnd();
scrollInfo = m_hostImpl->processScrollDeltas();
EXPECT_EQ(scrollInfo->pageScaleDelta, zoomInDelta);
- if (!Settings::pageScalePinchZoomEnabled()) {
+ if (!m_hostImpl->settings().pageScalePinchZoomEnabled) {
expectContains(*scrollInfo, scrollLayer->id(), gfx::Vector2d(25, 25));
} else {
EXPECT_TRUE(scrollInfo->scrolls.empty());
@@ -769,7 +765,7 @@ TEST_P(LayerTreeHostImplTest, inhibitScrollAndPageScaleUpdatesWhilePinchZooming)
// Since we are pinch zooming out, we should get an update to zoom all
// the way out to the minimum page scale.
scoped_ptr<ScrollAndScaleSet> scrollInfo = m_hostImpl->processScrollDeltas();
- if (!Settings::pageScalePinchZoomEnabled()) {
+ if (!m_hostImpl->settings().pageScalePinchZoomEnabled) {
EXPECT_EQ(scrollInfo->pageScaleDelta, minPageScale);
expectContains(*scrollInfo, scrollLayer->id(), gfx::Vector2d(0, 0));
} else {
@@ -780,7 +776,7 @@ TEST_P(LayerTreeHostImplTest, inhibitScrollAndPageScaleUpdatesWhilePinchZooming)
// Once the gesture ends, we get the final scroll and page scale values.
m_hostImpl->pinchGestureEnd();
scrollInfo = m_hostImpl->processScrollDeltas();
- if (Settings::pageScalePinchZoomEnabled()) {
+ if (m_hostImpl->settings().pageScalePinchZoomEnabled) {
EXPECT_EQ(scrollInfo->pageScaleDelta, minPageScale);
expectContains(*scrollInfo, scrollLayer->id(), gfx::Vector2d(25, 25));
} else {
@@ -809,7 +805,7 @@ TEST_P(LayerTreeHostImplTest, inhibitScrollAndPageScaleUpdatesWhileAnimatingPage
const float pageScaleDelta = 2;
gfx::Vector2d target(25, 25);
gfx::Vector2d scaledTarget = target;
- if (!Settings::pageScalePinchZoomEnabled())
+ if (!m_hostImpl->settings().pageScalePinchZoomEnabled)
scaledTarget = gfx::Vector2d(12, 12);
m_hostImpl->setPageScaleFactorAndLimits(1, minPageScale, maxPageScale);
@@ -1199,7 +1195,7 @@ TEST_P(LayerTreeHostImplTest, scrollRootAndChangePageScaleOnMainThread)
// Set new page scale from main thread.
m_hostImpl->setPageScaleFactorAndLimits(pageScale, pageScale, pageScale);
- if (!Settings::pageScalePinchZoomEnabled()) {
+ if (!m_hostImpl->settings().pageScalePinchZoomEnabled) {
// The scale should apply to the scroll delta.
expectedScrollDelta = gfx::ToFlooredVector2d(gfx::ScaleVector2d(expectedScrollDelta, pageScale));
}
@@ -1322,7 +1318,7 @@ TEST_P(LayerTreeHostImplTest, scrollChildAndChangePageScaleOnMainThread)
m_hostImpl->updateRootScrollLayerImplTransform();
- if (!Settings::pageScalePinchZoomEnabled()) {
+ if (!m_hostImpl->settings().pageScalePinchZoomEnabled) {
// The scale should apply to the scroll delta.
expectedScrollDelta = gfx::ToFlooredVector2d(gfx::ScaleVector2d(expectedScrollDelta, pageScale));
}
@@ -1986,7 +1982,7 @@ TEST_P(LayerTreeHostImplTest, partialSwapReceivesDamageRect)
// This test creates its own LayerTreeHostImpl, so
// that we can force partial swap enabled.
LayerTreeSettings settings;
- Settings::setPartialSwapEnabled(true);
+ settings.partialSwapEnabled = true;
scoped_ptr<LayerTreeHostImpl> layerTreeHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
layerTreeHostImpl->initializeRenderer(outputSurface.Pass());
layerTreeHostImpl->setViewportSize(gfx::Size(500, 500), gfx::Size(500, 500));
@@ -2269,11 +2265,10 @@ public:
static scoped_ptr<LayerTreeHostImpl> setupLayersForOpacity(bool partialSwap, LayerTreeHostImplClient* client, Proxy* proxy)
{
- Settings::setPartialSwapEnabled(partialSwap);
-
scoped_ptr<GraphicsContext> context = FakeWebCompositorOutputSurface::create(scoped_ptr<WebKit::WebGraphicsContext3D>(new PartialSwapContext)).PassAs<GraphicsContext>();
LayerTreeSettings settings;
+ settings.partialSwapEnabled = partialSwap;
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, client, proxy);
myHostImpl->initializeRenderer(context.Pass());
myHostImpl->setViewportSize(gfx::Size(100, 100), gfx::Size(100, 100));
@@ -3079,10 +3074,9 @@ public:
TEST_P(LayerTreeHostImplTest, textureCachingWithClipping)
{
- Settings::setPartialSwapEnabled(true);
-
LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size();
+ settings.partialSwapEnabled = true;
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
LayerImpl* rootPtr;
@@ -3176,8 +3170,6 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithClipping)
TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusion)
{
- Settings::setPartialSwapEnabled(false);
-
LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size();
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
@@ -3292,8 +3284,6 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusion)
TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionEarlyOut)
{
- Settings::setPartialSwapEnabled(false);
-
LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size();
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
@@ -3408,8 +3398,6 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionEarlyOut)
TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionExternalOverInternal)
{
- Settings::setPartialSwapEnabled(false);
-
LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size();
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
@@ -3497,8 +3485,6 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionExternalOverInternal)
TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionExternalNotAligned)
{
- Settings::setPartialSwapEnabled(false);
-
LayerTreeSettings settings;
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
@@ -3571,10 +3557,9 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionExternalNotAligned)
TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionPartialSwap)
{
- Settings::setPartialSwapEnabled(true);
-
LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size();
+ settings.partialSwapEnabled = true;
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
// Layers are structure as follows:
@@ -3684,8 +3669,6 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionPartialSwap)
TEST_P(LayerTreeHostImplTest, textureCachingWithScissor)
{
- Settings::setPartialSwapEnabled(false);
-
LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size();
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
@@ -3791,10 +3774,9 @@ TEST_P(LayerTreeHostImplTest, textureCachingWithScissor)
TEST_P(LayerTreeHostImplTest, surfaceTextureCaching)
{
- Settings::setPartialSwapEnabled(true);
-
LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size();
+ settings.partialSwapEnabled = true;
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
LayerImpl* rootPtr;
@@ -3952,8 +3934,6 @@ TEST_P(LayerTreeHostImplTest, surfaceTextureCaching)
TEST_P(LayerTreeHostImplTest, surfaceTextureCachingNoPartialSwap)
{
- Settings::setPartialSwapEnabled(false);
-
LayerTreeSettings settings;
settings.minimumOcclusionTrackingSize = gfx::Size();
scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(settings, this, &m_proxy);
diff --git a/cc/layer_tree_host_unittest.cc b/cc/layer_tree_host_unittest.cc
index e5729d0..034c789 100644
--- a/cc/layer_tree_host_unittest.cc
+++ b/cc/layer_tree_host_unittest.cc
@@ -9,7 +9,6 @@
#include "cc/content_layer_client.h"
#include "cc/graphics_context.h"
#include "cc/layer_tree_host_impl.h"
-#include "cc/settings.h"
#include "cc/single_thread_proxy.h"
#include "cc/test/fake_content_layer_client.h"
#include "cc/test/fake_web_compositor_output_surface.h"
diff --git a/cc/layer_unittest.cc b/cc/layer_unittest.cc
index 1ce8dec..885bbbd 100644
--- a/cc/layer_unittest.cc
+++ b/cc/layer_unittest.cc
@@ -8,12 +8,10 @@
#include "cc/layer_impl.h"
#include "cc/layer_painter.h"
#include "cc/layer_tree_host.h"
-#include "cc/settings.h"
#include "cc/single_thread_proxy.h"
#include "cc/thread.h"
#include "cc/test/fake_layer_tree_host_client.h"
#include "cc/test/geometry_test_utils.h"
-#include "cc/test/test_common.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include <public/WebTransformationMatrix.h>
@@ -568,15 +566,15 @@ class FakeLayerImplTreeHost : public LayerTreeHost {
public:
static scoped_ptr<FakeLayerImplTreeHost> create()
{
- scoped_ptr<FakeLayerImplTreeHost> host(new FakeLayerImplTreeHost);
+ scoped_ptr<FakeLayerImplTreeHost> host(new FakeLayerImplTreeHost(LayerTreeSettings()));
// The initialize call will fail, since our client doesn't provide a valid GraphicsContext3D, but it doesn't matter in the tests that use this fake so ignore the return value.
host->initialize(scoped_ptr<Thread>(NULL));
return host.Pass();
}
private:
- FakeLayerImplTreeHost()
- : LayerTreeHost(&m_client, LayerTreeSettings())
+ FakeLayerImplTreeHost(const LayerTreeSettings& settings)
+ : LayerTreeHost(&m_client, settings)
{
}
@@ -776,9 +774,6 @@ TEST(LayerLayerTreeHostTest, 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.
- ScopedSettings scopedSettings;
- Settings::setAcceleratedAnimationEnabled(true);
-
scoped_refptr<Layer> layer = Layer::create();
// Case 1: without a layerTreeHost, the animation should not be accepted.
diff --git a/cc/scheduler.h b/cc/scheduler.h
index 5617a01..ffe03cf 100644
--- a/cc/scheduler.h
+++ b/cc/scheduler.h
@@ -10,6 +10,7 @@
#include "base/time.h"
#include "cc/cc_export.h"
#include "cc/frame_rate_controller.h"
+#include "cc/layer_tree_host.h"
#include "cc/scheduler_state_machine.h"
namespace cc {
diff --git a/cc/scheduler_state_machine.cc b/cc/scheduler_state_machine.cc
index 256bbe0..7b2ce7b 100644
--- a/cc/scheduler_state_machine.cc
+++ b/cc/scheduler_state_machine.cc
@@ -6,7 +6,6 @@
#include "base/logging.h"
#include "base/stringprintf.h"
-#include "cc/settings.h"
namespace cc {
diff --git a/cc/settings.cc b/cc/settings.cc
deleted file mode 100644
index e4bb0b0..0000000
--- a/cc/settings.cc
+++ /dev/null
@@ -1,110 +0,0 @@
-// 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.
-
-#include "base/command_line.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;
-static bool s_backgroundColorInsteadOfCheckerboard = false;
-static bool s_traceOverdraw = 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_backgroundColorInsteadOfCheckerboard = CommandLine::ForCurrentProcess()->HasSwitch(cc::switches::kBackgroundColorInsteadOfCheckerboard);
- s_traceOverdraw = CommandLine::ForCurrentProcess()->HasSwitch(cc::switches::kTraceOverdraw);
-}
-
-}
-
-namespace cc {
-
-bool Settings::perTilePaintingEnabled()
-{
- if (!s_settingsInitialized)
- reset();
- return s_perTilePaintingEnabled;
-}
-
-bool Settings::partialSwapEnabled()
-{
- if (!s_settingsInitialized)
- reset();
- return s_partialSwapEnabled;
-}
-
-bool Settings::acceleratedAnimationEnabled()
-{
- if (!s_settingsInitialized)
- reset();
- return s_acceleratedAnimationEnabled;
-}
-
-bool Settings::pageScalePinchZoomEnabled()
-{
- if (!s_settingsInitialized)
- reset();
- return s_pageScalePinchZoomEnabled;
-}
-
-bool Settings::backgroundColorInsteadOfCheckerboard()
-{
- if (!s_settingsInitialized)
- reset();
- return s_backgroundColorInsteadOfCheckerboard;
-}
-
-bool Settings::traceOverdraw()
-{
- if (!s_settingsInitialized)
- reset();
- return s_traceOverdraw;
-}
-
-void Settings::resetForTest()
-{
- reset();
-}
-
-void Settings::setPartialSwapEnabled(bool enabled)
-{
- if (!s_settingsInitialized)
- reset();
- s_partialSwapEnabled = enabled;
-}
-
-void Settings::setPerTilePaintingEnabled(bool enabled)
-{
- if (!s_settingsInitialized)
- reset();
- s_partialSwapEnabled = enabled;
-}
-
-void Settings::setAcceleratedAnimationEnabled(bool enabled)
-{
- if (!s_settingsInitialized)
- reset();
- s_acceleratedAnimationEnabled = enabled;
-}
-
-void Settings::setPageScalePinchZoomEnabled(bool enabled)
-{
- if (!s_settingsInitialized)
- reset();
- s_pageScalePinchZoomEnabled = enabled;
-}
-
-} // namespace cc
diff --git a/cc/settings.h b/cc/settings.h
deleted file mode 100644
index df59660..0000000
--- a/cc/settings.h
+++ /dev/null
@@ -1,35 +0,0 @@
-// 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_SETTINGS_H_
-#define CC_SETTINGS_H_
-
-#include "cc/cc_export.h"
-
-namespace cc {
-
-// This file is for settings that apply to all compositors. Add settings to
-// LayerTreeSettings if a ui and renderer compositor might not want the same
-// setting.
-
-class CC_EXPORT Settings {
-public:
- static bool perTilePaintingEnabled();
- static bool partialSwapEnabled();
- static bool acceleratedAnimationEnabled();
- static bool pageScalePinchZoomEnabled();
- static bool backgroundColorInsteadOfCheckerboard();
- static bool traceOverdraw();
-
- static void setPartialSwapEnabled(bool);
- static void setPerTilePaintingEnabled(bool);
- static void setAcceleratedAnimationEnabled(bool);
- static void setPageScalePinchZoomEnabled(bool);
-
- static void resetForTest();
-};
-
-} // namespace cc
-
-#endif // CC_SETTINGS_H_
diff --git a/cc/software_renderer_unittest.cc b/cc/software_renderer_unittest.cc
index bdcff11..bc61b75 100644
--- a/cc/software_renderer_unittest.cc
+++ b/cc/software_renderer_unittest.cc
@@ -7,14 +7,12 @@
#include "cc/quad_sink.h"
#include "cc/render_pass.h"
#include "cc/render_pass_draw_quad.h"
-#include "cc/settings.h"
#include "cc/solid_color_draw_quad.h"
#include "cc/test/animation_test_common.h"
#include "cc/test/fake_web_compositor_output_surface.h"
#include "cc/test/fake_web_compositor_software_output_device.h"
#include "cc/test/geometry_test_utils.h"
#include "cc/test/render_pass_test_common.h"
-#include "cc/test/test_common.h"
#include "cc/tile_draw_quad.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
diff --git a/cc/test/layer_tree_test_common.cc b/cc/test/layer_tree_test_common.cc
index 1c26647..8be9cf9 100644
--- a/cc/test/layer_tree_test_common.cc
+++ b/cc/test/layer_tree_test_common.cc
@@ -13,14 +13,12 @@
#include "cc/layer_impl.h"
#include "cc/layer_tree_host_impl.h"
#include "cc/scoped_thread_proxy.h"
-#include "cc/settings.h"
#include "cc/single_thread_proxy.h"
#include "cc/thread_impl.h"
#include "cc/test/animation_test_common.h"
#include "cc/test/fake_web_compositor_output_surface.h"
#include "cc/test/fake_web_graphics_context_3d.h"
#include "cc/test/occlusion_tracker_test_common.h"
-#include "cc/test/test_common.h"
#include "cc/test/tiled_layer_test_common.h"
#include "cc/timing_function.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -33,7 +31,6 @@ using cc::LayerTreeHostImplClient;
using cc::LayerTreeSettings;
using cc::Proxy;
using cc::ScopedThreadProxy;
-using cc::Settings;
using namespace WebKit;
@@ -504,10 +501,6 @@ void ThreadedTest::dispatchDidAddAnimation()
void ThreadedTest::runTest(bool threaded)
{
- // For these tests, we will enable threaded animations.
- ScopedSettings scopedSettings;
- Settings::setAcceleratedAnimationEnabled(true);
-
if (threaded) {
m_implThread.reset(new base::Thread("ThreadedTest"));
ASSERT_TRUE(m_implThread->Start());
diff --git a/cc/test/test_common.h b/cc/test/test_common.h
deleted file mode 100644
index eea843f..0000000
--- a/cc/test/test_common.h
+++ /dev/null
@@ -1,22 +0,0 @@
-// 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_TEST_TEST_COMMON_H_
-#define CC_TEST_TEST_COMMON_H_
-
-#include "cc/settings.h"
-
-namespace WebKitTests {
-
-// If you have a test that modifies or uses global settings, keep an instance
-// of this class to ensure that you start and end with a clean slate.
-class ScopedSettings {
-public:
- ScopedSettings() { cc::Settings::resetForTest(); }
- ~ScopedSettings() { cc::Settings::resetForTest(); }
-};
-
-} // namespace WebKitTests
-
-#endif // CC_TEST_TEST_COMMON_H_
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index d49daf8..df60369 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -1654,10 +1654,6 @@ void ChromeContentBrowserClient::OverrideWebkitPrefs(
// See http://crbug.com/96005 and http://crbug.com/96006
web_prefs->force_compositing_mode = false;
web_prefs->accelerated_compositing_enabled = false;
- web_prefs->accelerated_2d_canvas_enabled = false;
- web_prefs->accelerated_video_enabled = false;
- web_prefs->accelerated_painting_enabled = false;
- web_prefs->accelerated_plugins_enabled = false;
}
#if defined(FILE_MANAGER_EXTENSION)
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 785ad98..6ae5b1a 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -860,10 +860,7 @@ void RenderProcessHostImpl::PropagateBrowserCommandLineToRenderer(
switches::kVModule,
switches::kWebCoreLogChannels,
cc::switches::kBackgroundColorInsteadOfCheckerboard,
- cc::switches::kDisableThreadedAnimation,
cc::switches::kEnablePartialSwap,
- cc::switches::kEnablePerTilePainting,
- cc::switches::kEnablePinchInCompositor,
cc::switches::kShowPropertyChangedRects,
cc::switches::kShowSurfaceDamageRects,
cc::switches::kShowScreenSpaceRects,
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index a650045..0ef81c6 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -511,12 +511,12 @@ WebPreferences WebContentsImpl::GetWebkitPrefs(RenderViewHost* rvh,
prefs.accelerated_filters_enabled =
GpuProcessHost::gpu_enabled() &&
command_line.HasSwitch(switches::kEnableAcceleratedFilters);
- prefs.accelerated_layers_enabled =
- prefs.accelerated_animation_enabled =
+ prefs.accelerated_compositing_for_3d_transforms_enabled =
+ prefs.accelerated_compositing_for_animation_enabled =
!command_line.HasSwitch(switches::kDisableAcceleratedLayers);
- prefs.accelerated_plugins_enabled =
+ prefs.accelerated_compositing_for_plugins_enabled =
!command_line.HasSwitch(switches::kDisableAcceleratedPlugins);
- prefs.accelerated_video_enabled =
+ prefs.accelerated_compositing_for_video_enabled =
!command_line.HasSwitch(switches::kDisableAcceleratedVideo);
prefs.fullscreen_enabled =
!command_line.HasSwitch(switches::kDisableFullScreen);
@@ -571,19 +571,19 @@ WebPreferences WebContentsImpl::GetWebkitPrefs(RenderViewHost* rvh,
if (blacklist_type & GPU_FEATURE_TYPE_MULTISAMPLING)
prefs.gl_multisampling_enabled = false;
if (blacklist_type & GPU_FEATURE_TYPE_3D_CSS) {
- prefs.accelerated_layers_enabled = false;
- prefs.accelerated_animation_enabled = false;
+ prefs.accelerated_compositing_for_3d_transforms_enabled = false;
+ prefs.accelerated_compositing_for_animation_enabled = false;
}
if (blacklist_type & GPU_FEATURE_TYPE_ACCELERATED_VIDEO)
- prefs.accelerated_video_enabled = false;
+ prefs.accelerated_compositing_for_video_enabled = false;
// Accelerated video and animation are slower than regular when using a
// software 3d rasterizer. 3D CSS may also be too slow to be worthwhile.
if (gpu_data_manager->ShouldUseSoftwareRendering()) {
- prefs.accelerated_video_enabled = false;
- prefs.accelerated_animation_enabled = false;
- prefs.accelerated_layers_enabled = false;
- prefs.accelerated_plugins_enabled = false;
+ prefs.accelerated_compositing_for_video_enabled = false;
+ prefs.accelerated_compositing_for_animation_enabled = false;
+ prefs.accelerated_compositing_for_3d_transforms_enabled = false;
+ prefs.accelerated_compositing_for_plugins_enabled = false;
}
}
@@ -623,9 +623,17 @@ WebPreferences WebContentsImpl::GetWebkitPrefs(RenderViewHost* rvh,
if (gfx::Screen::GetNativeScreen()->IsDIPEnabled()) {
// Only apply when using DIP coordinate system as this setting interferes
// with fixed layout mode.
+ // TODO(danakj): Fixed layout mode is going away, so turn this on always.
prefs.apply_default_device_scale_factor_in_compositor = true;
}
+ prefs.apply_page_scale_factor_in_compositor =
+ command_line.HasSwitch(cc::switches::kEnablePinchInCompositor);
+ prefs.per_tile_painting_enabled =
+ command_line.HasSwitch(cc::switches::kEnablePerTilePainting);
+ prefs.accelerated_compositing_for_animation_enabled =
+ !command_line.HasSwitch(cc::switches::kDisableThreadedAnimation);
+
prefs.fixed_position_creates_stacking_context = !command_line.HasSwitch(
switches::kDisableFixedPositionCreatesStackingContext);
@@ -634,9 +642,6 @@ WebPreferences WebContentsImpl::GetWebkitPrefs(RenderViewHost* rvh,
prefs.number_of_cpu_cores = base::SysInfo::NumberOfProcessors();
- prefs.apply_page_scale_factor_in_compositor =
- command_line.HasSwitch(cc::switches::kEnablePinchInCompositor);
-
prefs.deferred_image_decoding_enabled =
command_line.HasSwitch(switches::kEnableDeferredImageDecoding);
diff --git a/content/common/view_messages.h b/content/common/view_messages.h
index a5ba46b..5bc1079 100644
--- a/content/common/view_messages.h
+++ b/content/common/view_messages.h
@@ -141,6 +141,9 @@ IPC_STRUCT_TRAITS_BEGIN(webkit_glue::WebPreferences)
IPC_STRUCT_TRAITS_MEMBER(default_font_size)
IPC_STRUCT_TRAITS_MEMBER(default_fixed_font_size)
IPC_STRUCT_TRAITS_MEMBER(apply_default_device_scale_factor_in_compositor)
+ IPC_STRUCT_TRAITS_MEMBER(apply_page_scale_factor_in_compositor)
+ IPC_STRUCT_TRAITS_MEMBER(per_tile_painting_enabled)
+ IPC_STRUCT_TRAITS_MEMBER(accelerated_animation_enabled)
IPC_STRUCT_TRAITS_MEMBER(minimum_font_size)
IPC_STRUCT_TRAITS_MEMBER(minimum_logical_font_size)
IPC_STRUCT_TRAITS_MEMBER(default_encoding)
@@ -198,10 +201,10 @@ IPC_STRUCT_TRAITS_BEGIN(webkit_glue::WebPreferences)
IPC_STRUCT_TRAITS_MEMBER(accelerated_painting_enabled)
IPC_STRUCT_TRAITS_MEMBER(accelerated_filters_enabled)
IPC_STRUCT_TRAITS_MEMBER(gesture_tap_highlight_enabled)
- IPC_STRUCT_TRAITS_MEMBER(accelerated_plugins_enabled)
- IPC_STRUCT_TRAITS_MEMBER(accelerated_layers_enabled)
- IPC_STRUCT_TRAITS_MEMBER(accelerated_animation_enabled)
- IPC_STRUCT_TRAITS_MEMBER(accelerated_video_enabled)
+ IPC_STRUCT_TRAITS_MEMBER(accelerated_compositing_for_plugins_enabled)
+ IPC_STRUCT_TRAITS_MEMBER(accelerated_compositing_for_3d_transforms_enabled)
+ IPC_STRUCT_TRAITS_MEMBER(accelerated_compositing_for_animation_enabled)
+ IPC_STRUCT_TRAITS_MEMBER(accelerated_compositing_for_video_enabled)
IPC_STRUCT_TRAITS_MEMBER(memory_info_enabled)
IPC_STRUCT_TRAITS_MEMBER(fullscreen_enabled)
IPC_STRUCT_TRAITS_MEMBER(allow_displaying_insecure_content)
diff --git a/content/renderer/pepper/pepper_plugin_delegate_impl.cc b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
index a776020..219b2e3 100644
--- a/content/renderer/pepper/pepper_plugin_delegate_impl.cc
+++ b/content/renderer/pepper/pepper_plugin_delegate_impl.cc
@@ -808,7 +808,8 @@ webkit::ppapi::PluginDelegate::PlatformContext3D*
// If accelerated compositing of plugins is disabled, fail to create a 3D
// context, because it won't be visible. This allows graceful fallback in the
// modules.
- if (!render_view_->webkit_preferences().accelerated_plugins_enabled)
+ const webkit_glue::WebPreferences& prefs = render_view_->webkit_preferences();
+ if (!prefs.accelerated_compositing_for_plugins_enabled)
return NULL;
return new PlatformContext3DImpl(this);
#else
diff --git a/ppapi/shared_impl/ppapi_preferences.cc b/ppapi/shared_impl/ppapi_preferences.cc
index c7bb0cb..3a2bffa 100644
--- a/ppapi/shared_impl/ppapi_preferences.cc
+++ b/ppapi/shared_impl/ppapi_preferences.cc
@@ -25,9 +25,10 @@ Preferences::Preferences(const webkit_glue::WebPreferences& prefs)
is_3d_supported(prefs.flash_3d_enabled),
is_stage3d_supported(prefs.flash_stage3d_enabled),
// This determines both if webgl is supported (experimental_webgl_enabled)
- // and if it runs in hardware (accelerated_plugins_enabled)
+ // and if it runs in hardware
+ // (accelerated_compositing_for_plugins_enabled)
is_webgl_supported(prefs.experimental_webgl_enabled &&
- prefs.accelerated_plugins_enabled) {
+ prefs.accelerated_compositing_for_plugins_enabled) {
}
Preferences::~Preferences() {
diff --git a/webkit/compositor_bindings/web_compositor_support_impl.cc b/webkit/compositor_bindings/web_compositor_support_impl.cc
index 48af47e..33cf0fc 100644
--- a/webkit/compositor_bindings/web_compositor_support_impl.cc
+++ b/webkit/compositor_bindings/web_compositor_support_impl.cc
@@ -7,7 +7,6 @@
#include "base/debug/trace_event.h"
#include "base/memory/scoped_ptr.h"
#include "base/message_loop_proxy.h"
-#include "cc/settings.h"
#include "cc/thread_impl.h"
#include "webkit/compositor_bindings/web_animation_impl.h"
#include "webkit/compositor_bindings/web_content_layer_impl.h"
@@ -80,19 +79,19 @@ void WebCompositorSupportImpl::shutdown() {
}
void WebCompositorSupportImpl::setPerTilePaintingEnabled(bool enabled) {
- cc::Settings::setPerTilePaintingEnabled(enabled);
+ NOTREACHED();
}
void WebCompositorSupportImpl::setPartialSwapEnabled(bool enabled) {
- cc::Settings::setPartialSwapEnabled(enabled);
+ NOTREACHED();
}
void WebCompositorSupportImpl::setAcceleratedAnimationEnabled(bool enabled) {
- cc::Settings::setAcceleratedAnimationEnabled(enabled);
+ NOTREACHED();
}
void WebCompositorSupportImpl::setPageScalePinchZoomEnabled(bool enabled) {
- cc::Settings::setPageScalePinchZoomEnabled(enabled);
+ NOTREACHED();
}
WebLayerTreeView* WebCompositorSupportImpl::createLayerTreeView(
diff --git a/webkit/compositor_bindings/web_layer_tree_view_impl.cc b/webkit/compositor_bindings/web_layer_tree_view_impl.cc
index f51d04e..ffb0f9d 100644
--- a/webkit/compositor_bindings/web_layer_tree_view_impl.cc
+++ b/webkit/compositor_bindings/web_layer_tree_view_impl.cc
@@ -39,6 +39,9 @@ bool WebLayerTreeViewImpl::initialize(const WebLayerTreeView::Settings& webSetti
settings.showPlatformLayerTree = webSettings.showPlatformLayerTree;
settings.showPaintRects = webSettings.showPaintRects;
settings.renderVSyncEnabled = webSettings.renderVSyncEnabled;
+ settings.perTilePaintingEnabled = webSettings.perTilePaintingEnabled;
+ settings.acceleratedAnimationEnabled = webSettings.acceleratedAnimationEnabled;
+ settings.pageScalePinchZoomEnabled = webSettings.pageScalePinchZoomEnabled;
settings.refreshRate = webSettings.refreshRate;
settings.defaultTileSize = webSettings.defaultTileSize;
settings.maxUntiledLayerSize = webSettings.maxUntiledLayerSize;
diff --git a/webkit/glue/webpreferences.cc b/webkit/glue/webpreferences.cc
index 09e41b2..5f6c20b 100644
--- a/webkit/glue/webpreferences.cc
+++ b/webkit/glue/webpreferences.cc
@@ -37,6 +37,9 @@ WebPreferences::WebPreferences()
minimum_logical_font_size(6),
default_encoding("ISO-8859-1"),
apply_default_device_scale_factor_in_compositor(false),
+ apply_page_scale_factor_in_compositor(false),
+ per_tile_painting_enabled(false),
+ accelerated_animation_enabled(false),
javascript_enabled(true),
web_security_enabled(true),
javascript_can_open_windows_automatically(true),
@@ -86,15 +89,15 @@ WebPreferences::WebPreferences()
accelerated_compositing_enabled(false),
force_compositing_mode(false),
fixed_position_compositing_enabled(false),
- accelerated_layers_enabled(false),
- accelerated_animation_enabled(false),
- accelerated_video_enabled(false),
+ accelerated_compositing_for_3d_transforms_enabled(false),
+ accelerated_compositing_for_animation_enabled(false),
+ accelerated_compositing_for_video_enabled(false),
accelerated_2d_canvas_enabled(false),
deferred_2d_canvas_enabled(false),
accelerated_painting_enabled(false),
accelerated_filters_enabled(false),
gesture_tap_highlight_enabled(false),
- accelerated_plugins_enabled(false),
+ accelerated_compositing_for_plugins_enabled(false),
memory_info_enabled(false),
fullscreen_enabled(false),
allow_displaying_insecure_content(true),
@@ -117,8 +120,7 @@ WebPreferences::WebPreferences()
sync_xhr_in_documents_enabled(true),
deferred_image_decoding_enabled(false),
number_of_cpu_cores(1),
- cookie_enabled(true),
- apply_page_scale_factor_in_compositor(false)
+ cookie_enabled(true)
#if defined(OS_ANDROID)
,
text_autosizing_enabled(true),
@@ -254,6 +256,8 @@ void WebPreferences::Apply(WebView* web_view) const {
apply_default_device_scale_factor_in_compositor);
settings->setApplyPageScaleFactorInCompositor(
apply_page_scale_factor_in_compositor);
+ settings->setPerTilePaintingEnabled(per_tile_painting_enabled);
+ settings->setAcceleratedAnimationEnabled(accelerated_animation_enabled);
settings->setJavaScriptEnabled(javascript_enabled);
settings->setWebSecurityEnabled(web_security_enabled);
settings->setJavaScriptCanOpenWindowsAutomatically(
@@ -375,15 +379,15 @@ void WebPreferences::Apply(WebView* web_view) const {
// Enabling accelerated layers from the command line enabled accelerated
// 3D CSS, Video, and Animations.
settings->setAcceleratedCompositingFor3DTransformsEnabled(
- accelerated_layers_enabled);
+ accelerated_compositing_for_3d_transforms_enabled);
settings->setAcceleratedCompositingForVideoEnabled(
- accelerated_video_enabled);
+ accelerated_compositing_for_video_enabled);
settings->setAcceleratedCompositingForAnimationEnabled(
- accelerated_animation_enabled);
+ accelerated_compositing_for_animation_enabled);
// Enabling accelerated plugins if specified from the command line.
settings->setAcceleratedCompositingForPluginsEnabled(
- accelerated_plugins_enabled);
+ accelerated_compositing_for_plugins_enabled);
// WebGL and accelerated 2D canvas are always gpu composited.
settings->setAcceleratedCompositingForCanvasEnabled(
@@ -431,9 +435,6 @@ void WebPreferences::Apply(WebView* web_view) const {
settings->setFixedPositionCreatesStackingContext(
fixed_position_creates_stacking_context);
- settings->setApplyPageScaleFactorInCompositor(
- apply_page_scale_factor_in_compositor);
-
settings->setDeferredImageDecodingEnabled(deferred_image_decoding_enabled);
#if defined(OS_ANDROID)
diff --git a/webkit/glue/webpreferences.h b/webkit/glue/webpreferences.h
index 1e51332..ac21c8f 100644
--- a/webkit/glue/webpreferences.h
+++ b/webkit/glue/webpreferences.h
@@ -48,6 +48,9 @@ struct WEBKIT_GLUE_EXPORT WebPreferences {
int minimum_logical_font_size;
std::string default_encoding;
bool apply_default_device_scale_factor_in_compositor;
+ bool apply_page_scale_factor_in_compositor;
+ bool per_tile_painting_enabled;
+ bool accelerated_animation_enabled;
bool javascript_enabled;
bool web_security_enabled;
bool javascript_can_open_windows_automatically;
@@ -104,15 +107,15 @@ struct WEBKIT_GLUE_EXPORT WebPreferences {
bool accelerated_compositing_enabled;
bool force_compositing_mode;
bool fixed_position_compositing_enabled;
- bool accelerated_layers_enabled;
- bool accelerated_animation_enabled;
- bool accelerated_video_enabled;
+ bool accelerated_compositing_for_3d_transforms_enabled;
+ bool accelerated_compositing_for_animation_enabled;
+ bool accelerated_compositing_for_video_enabled;
bool accelerated_2d_canvas_enabled;
bool deferred_2d_canvas_enabled;
bool accelerated_painting_enabled;
bool accelerated_filters_enabled;
bool gesture_tap_highlight_enabled;
- bool accelerated_plugins_enabled;
+ bool accelerated_compositing_for_plugins_enabled;
bool memory_info_enabled;
bool fullscreen_enabled;
bool allow_displaying_insecure_content;
@@ -143,8 +146,6 @@ struct WEBKIT_GLUE_EXPORT WebPreferences {
// without raising a DOM security exception.
bool cookie_enabled;
- bool apply_page_scale_factor_in_compositor;
-
#if defined(OS_ANDROID)
bool text_autosizing_enabled;
float font_scale_factor;