OLD | NEW |
---|---|
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/layer_tree_settings.h" | 5 #include "cc/layer_tree_settings.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 18 matching lines...) Expand all Loading... | |
29 , useLinearFadeScrollbarAnimator(false) | 29 , useLinearFadeScrollbarAnimator(false) |
30 , minimumContentsScale(0.0625f) | 30 , minimumContentsScale(0.0625f) |
31 , lowResContentsScaleFactor(0.125f) | 31 , lowResContentsScaleFactor(0.125f) |
32 , refreshRate(0) | 32 , refreshRate(0) |
33 , maxPartialTextureUpdates(std::numeric_limits<size_t>::max()) | 33 , maxPartialTextureUpdates(std::numeric_limits<size_t>::max()) |
34 , numRasterThreads(1) | 34 , numRasterThreads(1) |
35 , defaultTileSize(gfx::Size(256, 256)) | 35 , defaultTileSize(gfx::Size(256, 256)) |
36 , maxUntiledLayerSize(gfx::Size(512, 512)) | 36 , maxUntiledLayerSize(gfx::Size(512, 512)) |
37 , minimumOcclusionTrackingSize(gfx::Size(160, 160)) | 37 , minimumOcclusionTrackingSize(gfx::Size(160, 160)) |
38 { | 38 { |
39 // TODO(danakj): Move this to chromium when we don't go through the WebKit A PI anymore. | |
40 compositorFrameMessage = CommandLine::ForCurrentProcess()->HasSwitch(cc::swi tches::kEnableCompositorFrameMessage); | |
41 partialSwapEnabled = CommandLine::ForCurrentProcess()->HasSwitch(switches::k EnablePartialSwap); | |
42 backgroundColorInsteadOfCheckerboard = CommandLine::ForCurrentProcess()->Has Switch(switches::kBackgroundColorInsteadOfCheckerboard); | |
43 showOverdrawInTracing = CommandLine::ForCurrentProcess()->HasSwitch(switches ::kTraceOverdraw); | |
44 | |
45 // TODO(alokp): Remove this hard-coded setting. | 39 // TODO(alokp): Remove this hard-coded setting. |
46 // Platforms that need to disable LCD text must explicitly set this value. | 40 // Platforms that need to disable LCD text must explicitly set this value. |
47 #if defined(OS_ANDROID) | 41 #if defined(OS_ANDROID) |
48 canUseLCDText = false; | 42 canUseLCDText = false; |
49 #endif | 43 #endif |
50 | 44 |
51 #if defined(OS_ANDROID) | 45 #if defined(OS_ANDROID) |
52 // TODO(danakj): Move this out to the android code. | 46 // TODO(danakj): Move this out to the android code. |
53 maxPartialTextureUpdates = 0; | 47 maxPartialTextureUpdates = 0; |
54 #endif | 48 #endif |
55 | 49 |
56 #if defined(OS_ANDROID) | 50 #if defined(OS_ANDROID) |
57 // TODO(danakj): Move this out to the android code. | 51 // TODO(danakj): Move this out to the android code. |
58 useLinearFadeScrollbarAnimator = true; | 52 useLinearFadeScrollbarAnimator = true; |
59 #endif | 53 #endif |
60 | 54 |
61 initialDebugState.showPropertyChangedRects = CommandLine::ForCurrentProcess( )->HasSwitch(cc::switches::kShowPropertyChangedRects); | 55 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
62 initialDebugState.showSurfaceDamageRects = CommandLine::ForCurrentProcess()- >HasSwitch(cc::switches::kShowSurfaceDamageRects); | |
63 initialDebugState.showScreenSpaceRects = CommandLine::ForCurrentProcess()->H asSwitch(cc::switches::kShowScreenSpaceRects); | |
64 initialDebugState.showReplicaScreenSpaceRects = CommandLine::ForCurrentProce ss()->HasSwitch(cc::switches::kShowReplicaScreenSpaceRects); | |
65 initialDebugState.showOccludingRects = CommandLine::ForCurrentProcess()->Has Switch(cc::switches::kShowOccludingRects); | |
66 initialDebugState.showNonOccludingRects = CommandLine::ForCurrentProcess()-> HasSwitch(cc::switches::kShowNonOccludingRects); | |
67 | 56 |
68 if (CommandLine::ForCurrentProcess()->HasSwitch( | 57 // TODO(danakj): Move this to chromium when we don't go through the WebKit A PI anymore. |
nduca
2013/01/15 01:54:54
i'm confused about the code movement here, whats t
brianderson
2013/01/15 02:01:56
I should undo this. At some point, I was adding a
| |
58 compositorFrameMessage = command_line->HasSwitch(cc::switches::kEnableCompos itorFrameMessage); | |
59 partialSwapEnabled = command_line->HasSwitch(switches::kEnablePartialSwap); | |
60 backgroundColorInsteadOfCheckerboard = command_line->HasSwitch(switches::kBa ckgroundColorInsteadOfCheckerboard); | |
61 showOverdrawInTracing = command_line->HasSwitch(switches::kTraceOverdraw); | |
62 | |
63 initialDebugState.showPropertyChangedRects = command_line->HasSwitch(cc::swi tches::kShowPropertyChangedRects); | |
64 initialDebugState.showSurfaceDamageRects = command_line->HasSwitch(cc::switc hes::kShowSurfaceDamageRects); | |
65 initialDebugState.showScreenSpaceRects = command_line->HasSwitch(cc::switche s::kShowScreenSpaceRects); | |
66 initialDebugState.showReplicaScreenSpaceRects = command_line->HasSwitch(cc:: switches::kShowReplicaScreenSpaceRects); | |
67 initialDebugState.showOccludingRects = command_line->HasSwitch(cc::switches: :kShowOccludingRects); | |
68 initialDebugState.showNonOccludingRects = command_line->HasSwitch(cc::switch es::kShowNonOccludingRects); | |
69 | |
70 if (command_line->HasSwitch( | |
69 switches::kNumRasterThreads)) { | 71 switches::kNumRasterThreads)) { |
70 const size_t kMaxRasterThreads = 64; | 72 const size_t kMaxRasterThreads = 64; |
71 std::string num_raster_threads = | 73 std::string num_raster_threads = |
72 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 74 command_line->GetSwitchValueASCII( |
73 switches::kNumRasterThreads); | 75 switches::kNumRasterThreads); |
74 int num_threads; | 76 int num_threads; |
75 if (base::StringToInt(num_raster_threads, &num_threads) && | 77 if (base::StringToInt(num_raster_threads, &num_threads) && |
76 num_threads > 0 && num_threads <= kMaxRasterThreads) { | 78 num_threads > 0 && num_threads <= kMaxRasterThreads) { |
77 numRasterThreads = num_threads; | 79 numRasterThreads = num_threads; |
78 } else { | 80 } else { |
79 LOG(WARNING) << "Bad number of raster threads: " << | 81 LOG(WARNING) << "Bad number of raster threads: " << |
80 num_raster_threads; | 82 num_raster_threads; |
81 } | 83 } |
82 } | 84 } |
83 } | 85 } |
84 | 86 |
85 LayerTreeSettings::~LayerTreeSettings() | 87 LayerTreeSettings::~LayerTreeSettings() |
86 { | 88 { |
87 } | 89 } |
88 | 90 |
89 } // namespace cc | 91 } // namespace cc |
OLD | NEW |