| Index: blimp/client/compositor/blimp_layer_tree_settings.cc
|
| diff --git a/blimp/client/compositor/blimp_layer_tree_settings.cc b/blimp/client/compositor/blimp_layer_tree_settings.cc
|
| index 159c323c94e3ee952c30ba3691a38e491aaef409..05b3a0cd0f6a1594f363232df40336772df26e70 100644
|
| --- a/blimp/client/compositor/blimp_layer_tree_settings.cc
|
| +++ b/blimp/client/compositor/blimp_layer_tree_settings.cc
|
| @@ -12,44 +12,9 @@
|
| #include "base/sys_info.h"
|
| #include "cc/base/switches.h"
|
| #include "cc/trees/layer_tree_settings.h"
|
| -#include "content/public/common/content_switches.h"
|
| #include "third_party/skia/include/core/SkColor.h"
|
| #include "ui/gfx/buffer_types.h"
|
| #include "ui/gl/gl_switches.h"
|
| -#include "ui/native_theme/native_theme_switches.h"
|
| -
|
| -namespace {
|
| -
|
| -bool GetSwitchValueAsInt(const base::CommandLine& command_line,
|
| - const std::string& switch_string,
|
| - int min_value,
|
| - int max_value,
|
| - int* result) {
|
| - std::string string_value = command_line.GetSwitchValueASCII(switch_string);
|
| - int int_value;
|
| - if (base::StringToInt(string_value, &int_value) && int_value >= min_value &&
|
| - int_value <= max_value) {
|
| - *result = int_value;
|
| - return true;
|
| - } else {
|
| - return false;
|
| - }
|
| -}
|
| -
|
| -void StringToUintVector(const std::string& str, std::vector<unsigned>* vector) {
|
| - DCHECK(vector->empty());
|
| - std::vector<std::string> pieces =
|
| - base::SplitString(str, ",", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL);
|
| - DCHECK_EQ(pieces.size(), static_cast<size_t>(gfx::BufferFormat::LAST) + 1);
|
| - for (size_t i = 0; i < pieces.size(); ++i) {
|
| - unsigned number = 0;
|
| - bool succeed = base::StringToUint(pieces[i], &number);
|
| - DCHECK(succeed);
|
| - vector->push_back(number);
|
| - }
|
| -}
|
| -
|
| -} // namespace
|
|
|
| namespace blimp {
|
|
|
| @@ -57,154 +22,37 @@ namespace blimp {
|
| // Much of this will either have to be pulled from the server or refactored to
|
| // share the settings from render_widget_compositor.cc.
|
| void PopulateCommonLayerTreeSettings(cc::LayerTreeSettings* settings) {
|
| - const base::CommandLine& cmd = *base::CommandLine::ForCurrentProcess();
|
| // For web contents, layer transforms should scale up the contents of layers
|
| // to keep content always crisp when possible.
|
| settings->layer_transforms_should_scale_layer_contents = true;
|
|
|
| - if (cmd.HasSwitch(switches::kDisableGpuVsync)) {
|
| - std::string display_vsync_string =
|
| - cmd.GetSwitchValueASCII(switches::kDisableGpuVsync);
|
| - if (display_vsync_string == "gpu") {
|
| - settings->renderer_settings.disable_display_vsync = true;
|
| - } else if (display_vsync_string == "beginframe") {
|
| - settings->wait_for_beginframe_interval = false;
|
| - } else {
|
| - settings->renderer_settings.disable_display_vsync = true;
|
| - settings->wait_for_beginframe_interval = false;
|
| - }
|
| - }
|
| - settings->main_frame_before_activation_enabled =
|
| - cmd.HasSwitch(cc::switches::kEnableMainFrameBeforeActivation) &&
|
| - !cmd.HasSwitch(cc::switches::kDisableMainFrameBeforeActivation);
|
| - settings->accelerated_animation_enabled =
|
| - !cmd.HasSwitch(cc::switches::kDisableThreadedAnimation);
|
| -
|
| + settings->main_frame_before_activation_enabled = false;
|
| + settings->accelerated_animation_enabled = true;
|
| settings->default_tile_size = gfx::Size(256, 256);
|
| - if (cmd.HasSwitch(switches::kDefaultTileWidth)) {
|
| - int tile_width = 0;
|
| - GetSwitchValueAsInt(cmd, switches::kDefaultTileWidth, 1,
|
| - std::numeric_limits<int>::max(), &tile_width);
|
| - settings->default_tile_size.set_width(tile_width);
|
| - }
|
| - if (cmd.HasSwitch(switches::kDefaultTileHeight)) {
|
| - int tile_height = 0;
|
| - GetSwitchValueAsInt(cmd, switches::kDefaultTileHeight, 1,
|
| - std::numeric_limits<int>::max(), &tile_height);
|
| - settings->default_tile_size.set_height(tile_height);
|
| - }
|
| -
|
| - int max_untiled_layer_width = settings->max_untiled_layer_size.width();
|
| - if (cmd.HasSwitch(switches::kMaxUntiledLayerWidth)) {
|
| - GetSwitchValueAsInt(cmd, switches::kMaxUntiledLayerWidth, 1,
|
| - std::numeric_limits<int>::max(),
|
| - &max_untiled_layer_width);
|
| - }
|
| - int max_untiled_layer_height = settings->max_untiled_layer_size.height();
|
| - if (cmd.HasSwitch(switches::kMaxUntiledLayerHeight)) {
|
| - GetSwitchValueAsInt(cmd, switches::kMaxUntiledLayerHeight, 1,
|
| - std::numeric_limits<int>::max(),
|
| - &max_untiled_layer_height);
|
| - }
|
| -
|
| - settings->max_untiled_layer_size =
|
| - gfx::Size(max_untiled_layer_width, max_untiled_layer_height);
|
| -
|
| settings->gpu_rasterization_msaa_sample_count = 0;
|
| - if (cmd.HasSwitch(switches::kGpuRasterizationMSAASampleCount)) {
|
| - GetSwitchValueAsInt(cmd, switches::kGpuRasterizationMSAASampleCount, 0,
|
| - std::numeric_limits<int>::max(),
|
| - &settings->gpu_rasterization_msaa_sample_count);
|
| - }
|
| -
|
| - settings->gpu_rasterization_forced =
|
| - cmd.HasSwitch(switches::kForceGpuRasterization);
|
| - settings->gpu_rasterization_enabled =
|
| - cmd.HasSwitch(switches::kEnableGpuRasterization);
|
| -
|
| + settings->gpu_rasterization_forced = false;
|
| + settings->gpu_rasterization_enabled = false;
|
| settings->can_use_lcd_text = false;
|
| - settings->use_distance_field_text =
|
| - cmd.HasSwitch(switches::kEnableDistanceFieldText);
|
| -
|
| + settings->use_distance_field_text = false;
|
| #if defined(OS_MACOSX)
|
| - settings->use_zero_copy = !cmd.HasSwitch(switches::kDisableZeroCopy);
|
| + settings->use_zero_copy = true;
|
| #else
|
| - settings->use_zero_copy = cmd.HasSwitch(switches::kEnableZeroCopy);
|
| + settings->use_zero_copy = false;
|
| #endif
|
| -
|
| settings->enable_elastic_overscroll = false;
|
| -
|
| - if (cmd.HasSwitch(switches::kContentImageTextureTarget)) {
|
| - settings->use_image_texture_targets.clear();
|
| - StringToUintVector(
|
| - cmd.GetSwitchValueASCII(switches::kContentImageTextureTarget),
|
| - &settings->use_image_texture_targets);
|
| - }
|
| -
|
| settings->image_decode_tasks_enabled = false;
|
| - if (cmd.HasSwitch(switches::kNumRasterThreads)) {
|
| - int num_raster_threads = 0;
|
| - GetSwitchValueAsInt(cmd, switches::kNumRasterThreads, 0,
|
| - std::numeric_limits<int>::max(), &num_raster_threads);
|
| - settings->image_decode_tasks_enabled = num_raster_threads > 1;
|
| - }
|
| -
|
| - if (cmd.HasSwitch(cc::switches::kTopControlsShowThreshold)) {
|
| - std::string top_threshold_str =
|
| - cmd.GetSwitchValueASCII(cc::switches::kTopControlsShowThreshold);
|
| - double show_threshold;
|
| - if (base::StringToDouble(top_threshold_str, &show_threshold) &&
|
| - show_threshold >= 0.f && show_threshold <= 1.f)
|
| - settings->top_controls_show_threshold = show_threshold;
|
| - }
|
| -
|
| - if (cmd.HasSwitch(cc::switches::kTopControlsHideThreshold)) {
|
| - std::string top_threshold_str =
|
| - cmd.GetSwitchValueASCII(cc::switches::kTopControlsHideThreshold);
|
| - double hide_threshold;
|
| - if (base::StringToDouble(top_threshold_str, &hide_threshold) &&
|
| - hide_threshold >= 0.f && hide_threshold <= 1.f)
|
| - settings->top_controls_hide_threshold = hide_threshold;
|
| - }
|
| -
|
| - settings->verify_property_trees =
|
| - cmd.HasSwitch(cc::switches::kEnablePropertyTreeVerification);
|
| - settings->renderer_settings.allow_antialiasing &=
|
| - !cmd.HasSwitch(cc::switches::kDisableCompositedAntialiasing);
|
| + settings->verify_property_trees = false;
|
| settings->single_thread_proxy_scheduler = false;
|
| -
|
| - // These flags should be mirrored by UI versions in ui/compositor/.
|
| - settings->initial_debug_state.show_debug_borders =
|
| - cmd.HasSwitch(cc::switches::kShowCompositedLayerBorders);
|
| - settings->initial_debug_state.show_fps_counter =
|
| - cmd.HasSwitch(cc::switches::kShowFPSCounter);
|
| - settings->initial_debug_state.show_layer_animation_bounds_rects =
|
| - cmd.HasSwitch(cc::switches::kShowLayerAnimationBounds);
|
| - settings->initial_debug_state.show_paint_rects =
|
| - cmd.HasSwitch(switches::kShowPaintRects);
|
| - settings->initial_debug_state.show_property_changed_rects =
|
| - cmd.HasSwitch(cc::switches::kShowPropertyChangedRects);
|
| - settings->initial_debug_state.show_surface_damage_rects =
|
| - cmd.HasSwitch(cc::switches::kShowSurfaceDamageRects);
|
| - settings->initial_debug_state.show_screen_space_rects =
|
| - cmd.HasSwitch(cc::switches::kShowScreenSpaceRects);
|
| - settings->initial_debug_state.show_replica_screen_space_rects =
|
| - cmd.HasSwitch(cc::switches::kShowReplicaScreenSpaceRects);
|
| -
|
| - settings->initial_debug_state.SetRecordRenderingStats(
|
| - cmd.HasSwitch(cc::switches::kEnableGpuBenchmarking));
|
| -
|
| - if (cmd.HasSwitch(cc::switches::kSlowDownRasterScaleFactor)) {
|
| - const int kMinSlowDownScaleFactor = 0;
|
| - const int kMaxSlowDownScaleFactor = INT_MAX;
|
| - GetSwitchValueAsInt(
|
| - cmd, cc::switches::kSlowDownRasterScaleFactor, kMinSlowDownScaleFactor,
|
| - kMaxSlowDownScaleFactor,
|
| - &settings->initial_debug_state.slow_down_raster_scale_factor);
|
| - }
|
| -
|
| - settings->strict_layer_property_change_checking =
|
| - cmd.HasSwitch(cc::switches::kStrictLayerPropertyChangeChecking);
|
| + settings->initial_debug_state.show_debug_borders = false;
|
| + settings->initial_debug_state.show_fps_counter = false;
|
| + settings->initial_debug_state.show_layer_animation_bounds_rects = false;
|
| + settings->initial_debug_state.show_paint_rects = false;
|
| + settings->initial_debug_state.show_property_changed_rects = false;
|
| + settings->initial_debug_state.show_surface_damage_rects = false;
|
| + settings->initial_debug_state.show_screen_space_rects = false;
|
| + settings->initial_debug_state.show_replica_screen_space_rects = false;
|
| + settings->initial_debug_state.SetRecordRenderingStats(false);
|
| + settings->strict_layer_property_change_checking = false;
|
|
|
| #if defined(OS_ANDROID)
|
| if (base::SysInfo::IsLowEndDevice())
|
| @@ -241,13 +89,8 @@ void PopulateCommonLayerTreeSettings(cc::LayerTreeSettings* settings) {
|
| // settings->use_external_begin_frame_source = true;
|
|
|
| #elif !defined(OS_MACOSX)
|
| - if (ui::IsOverlayScrollbarEnabled()) {
|
| - settings->scrollbar_animator = cc::LayerTreeSettings::THINNING;
|
| - settings->solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128);
|
| - } else {
|
| - settings->scrollbar_animator = cc::LayerTreeSettings::LINEAR_FADE;
|
| - settings->solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128);
|
| - }
|
| + settings->scrollbar_animator = cc::LayerTreeSettings::LINEAR_FADE;
|
| + settings->solid_color_scrollbar_color = SkColorSetARGB(128, 128, 128, 128);
|
| settings->scrollbar_fade_delay_ms = 500;
|
| settings->scrollbar_fade_resize_delay_ms = 500;
|
| settings->scrollbar_fade_duration_ms = 300;
|
| @@ -258,13 +101,6 @@ void PopulateCommonLayerTreeSettings(cc::LayerTreeSettings* settings) {
|
| // TODO(dtrainor): Update this since https://crrev.com/1267603004 landed.
|
| // settings->scrollbar_show_scale_threshold = 1.05f;
|
| #endif
|
| -
|
| - if (cmd.HasSwitch(switches::kEnableLowResTiling))
|
| - settings->create_low_res_tiling = true;
|
| - if (cmd.HasSwitch(switches::kDisableLowResTiling))
|
| - settings->create_low_res_tiling = false;
|
| - if (cmd.HasSwitch(cc::switches::kEnableBeginFrameScheduling))
|
| - settings->use_external_begin_frame_source = true;
|
| }
|
|
|
| } // namespace blimp
|
|
|