OLD | NEW |
(Empty) | |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "cc/layer_tree_settings.h" |
| 6 |
| 7 #include <limits> |
| 8 |
| 9 #include "base/command_line.h" |
| 10 #include "base/logging.h" |
| 11 #include "base/string_number_conversions.h" |
| 12 #include "cc/switches.h" |
| 13 |
| 14 namespace cc { |
| 15 |
| 16 LayerTreeSettings::LayerTreeSettings() |
| 17 : acceleratePainting(false) |
| 18 , implSidePainting(false) |
| 19 , renderVSyncEnabled(true) |
| 20 , perTilePaintingEnabled(false) |
| 21 , partialSwapEnabled(false) |
| 22 , acceleratedAnimationEnabled(true) |
| 23 , pageScalePinchZoomEnabled(false) |
| 24 , backgroundColorInsteadOfCheckerboard(false) |
| 25 , showOverdrawInTracing(false) |
| 26 , refreshRate(0) |
| 27 , maxPartialTextureUpdates(std::numeric_limits<size_t>::max()) |
| 28 , numRasterThreads(1) |
| 29 , defaultTileSize(gfx::Size(256, 256)) |
| 30 , maxUntiledLayerSize(gfx::Size(512, 512)) |
| 31 , minimumOcclusionTrackingSize(gfx::Size(160, 160)) |
| 32 { |
| 33 // TODO(danakj): Move this to chromium when we don't go through the WebKit A
PI anymore. |
| 34 implSidePainting = CommandLine::ForCurrentProcess()->HasSwitch(cc::switches:
:kEnableImplSidePainting); |
| 35 partialSwapEnabled = CommandLine::ForCurrentProcess()->HasSwitch(switches::k
EnablePartialSwap); |
| 36 backgroundColorInsteadOfCheckerboard = CommandLine::ForCurrentProcess()->Has
Switch(switches::kBackgroundColorInsteadOfCheckerboard); |
| 37 showOverdrawInTracing = CommandLine::ForCurrentProcess()->HasSwitch(switches
::kTraceOverdraw); |
| 38 |
| 39 initialDebugState.showPropertyChangedRects = CommandLine::ForCurrentProcess(
)->HasSwitch(cc::switches::kShowPropertyChangedRects); |
| 40 initialDebugState.showSurfaceDamageRects = CommandLine::ForCurrentProcess()-
>HasSwitch(cc::switches::kShowSurfaceDamageRects); |
| 41 initialDebugState.showScreenSpaceRects = CommandLine::ForCurrentProcess()->H
asSwitch(cc::switches::kShowScreenSpaceRects); |
| 42 initialDebugState.showReplicaScreenSpaceRects = CommandLine::ForCurrentProce
ss()->HasSwitch(cc::switches::kShowReplicaScreenSpaceRects); |
| 43 initialDebugState.showOccludingRects = CommandLine::ForCurrentProcess()->Has
Switch(cc::switches::kShowOccludingRects); |
| 44 initialDebugState.showNonOccludingRects = CommandLine::ForCurrentProcess()->
HasSwitch(cc::switches::kShowNonOccludingRects); |
| 45 |
| 46 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 47 switches::kNumRasterThreads)) { |
| 48 const size_t kMaxRasterThreads = 64; |
| 49 std::string num_raster_threads = |
| 50 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 51 switches::kNumRasterThreads); |
| 52 int num_threads; |
| 53 if (base::StringToInt(num_raster_threads, &num_threads) && |
| 54 num_threads > 0 && num_threads <= kMaxRasterThreads) { |
| 55 numRasterThreads = num_threads; |
| 56 } else { |
| 57 LOG(WARNING) << "Bad number of raster threads: " << |
| 58 num_raster_threads; |
| 59 } |
| 60 } |
| 61 } |
| 62 |
| 63 LayerTreeSettings::~LayerTreeSettings() |
| 64 { |
| 65 } |
| 66 |
| 67 } // namespace cc |
OLD | NEW |