Chromium Code Reviews| Index: cc/layer_tree_host.cc |
| diff --git a/cc/layer_tree_host.cc b/cc/layer_tree_host.cc |
| index a186ed0ca2c7dde89d5f7ec52f7d83da1764d6b4..7a29490cd757f3471d6127dac620f46a91ca2820 100644 |
| --- a/cc/layer_tree_host.cc |
| +++ b/cc/layer_tree_host.cc |
| @@ -4,6 +4,7 @@ |
| #include "cc/layer_tree_host.h" |
| +#include "base/command_line.h" |
| #include "base/debug/trace_event.h" |
| #include "base/message_loop.h" |
| #include "cc/font_atlas.h" |
| @@ -19,8 +20,8 @@ |
| #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" |
| #include "cc/thread_proxy.h" |
| #include "cc/tree_synchronizer.h" |
| @@ -45,12 +46,24 @@ LayerTreeSettings::LayerTreeSettings() |
| , showReplicaScreenSpaceRects(false) |
| , showOccludingRects(false) |
| , renderVSyncEnabled(true) |
| + , perTilePaintingEnabled(false) |
| + , partialSwapEnabled(false) |
| + , acceleratedAnimationEnabled(false) |
| + , pageScalePinchZoomEnabled(false) |
| + , jankInsteadOfCheckerboard(false) |
| + , backgroundColorInsteadOfCheckerboard(false) |
| + , showOverdrawInTracing(false) |
| , refreshRate(0) |
| , maxPartialTextureUpdates(std::numeric_limits<size_t>::max()) |
| , defaultTileSize(gfx::Size(256, 256)) |
| , maxUntiledLayerSize(gfx::Size(512, 512)) |
| , minimumOcclusionTrackingSize(gfx::Size(160, 160)) |
| { |
| + // TODO(danakj): Move these to chromium after we stop going through the WebKit API. |
|
danakj
2012/11/13 02:33:08
Should I move these over to web_layer_tree_view_im
danakj
2012/11/13 02:35:12
Oh, nevermind. I see that the UI also creates its
|
| + partialSwapEnabled = CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnablePartialSwap); |
| + jankInsteadOfCheckerboard = CommandLine::ForCurrentProcess()->HasSwitch(switches::kJankInsteadOfCheckerboard); |
| + backgroundColorInsteadOfCheckerboard = CommandLine::ForCurrentProcess()->HasSwitch(switches::kBackgroundColorInsteadOfCheckerboard); |
| + showOverdrawInTracing = CommandLine::ForCurrentProcess()->HasSwitch(switches::kTraceOverdraw); |
| } |
| LayerTreeSettings::~LayerTreeSettings() |
| @@ -539,7 +552,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); |
| @@ -666,7 +679,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); |
| @@ -797,7 +810,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"); |