Landing Recent QUIC changes until 8/19/2015 17:00 UTC.
[chromium-blink-merge.git] / cc / trees / layer_tree_settings.cc
blob177741b11d6e68c223fe4e8945157839f4e74dbc
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.
5 #include "cc/trees/layer_tree_settings.h"
7 #include <GLES2/gl2.h>
8 #include <limits>
10 #include "base/command_line.h"
11 #include "base/logging.h"
12 #include "base/strings/string_number_conversions.h"
13 #include "ui/gfx/buffer_types.h"
15 namespace cc {
17 LayerSettings::LayerSettings() : use_compositor_animation_timelines(false) {
20 LayerSettings::~LayerSettings() {
23 LayerTreeSettings::LayerTreeSettings()
24 : single_thread_proxy_scheduler(true),
25 use_external_begin_frame_source(false),
26 main_frame_before_activation_enabled(false),
27 using_synchronous_renderer_compositor(false),
28 accelerated_animation_enabled(true),
29 can_use_lcd_text(true),
30 use_distance_field_text(false),
31 gpu_rasterization_enabled(false),
32 gpu_rasterization_forced(false),
33 gpu_rasterization_msaa_sample_count(0),
34 gpu_rasterization_skewport_target_time_in_seconds(0.2f),
35 create_low_res_tiling(false),
36 scrollbar_animator(NO_ANIMATOR),
37 scrollbar_fade_delay_ms(0),
38 scrollbar_fade_resize_delay_ms(0),
39 scrollbar_fade_duration_ms(0),
40 solid_color_scrollbar_color(SK_ColorWHITE),
41 timeout_and_draw_when_animation_checkerboards(true),
42 layer_transforms_should_scale_layer_contents(false),
43 layers_always_allowed_lcd_text(false),
44 minimum_contents_scale(0.0625f),
45 low_res_contents_scale_factor(0.25f),
46 top_controls_show_threshold(0.5f),
47 top_controls_hide_threshold(0.5f),
48 background_animation_rate(1.0),
49 max_partial_texture_updates(std::numeric_limits<size_t>::max()),
50 default_tile_size(gfx::Size(256, 256)),
51 max_untiled_layer_size(gfx::Size(512, 512)),
52 default_tile_grid_size(gfx::Size(256, 256)),
53 minimum_occlusion_tracking_size(gfx::Size(160, 160)),
54 // 3000 pixels should give sufficient area for prepainting.
55 tiling_interest_area_padding(3000),
56 skewport_target_time_in_seconds(1.0f),
57 skewport_extrapolation_limit_in_content_pixels(2000),
58 max_memory_for_prepaint_percentage(100),
59 strict_layer_property_change_checking(false),
60 use_one_copy(true),
61 use_zero_copy(false),
62 use_persistent_map_for_gpu_memory_buffers(false),
63 enable_elastic_overscroll(false),
64 use_image_texture_targets(
65 static_cast<size_t>(gfx::BufferFormat::LAST) + 1,
66 GL_TEXTURE_2D),
67 ignore_root_layer_flings(false),
68 scheduled_raster_task_limit(32),
69 use_occlusion_for_tile_prioritization(false),
70 record_full_layer(false),
71 use_display_lists(false),
72 verify_property_trees(false),
73 gather_pixel_refs(false),
74 use_compositor_animation_timelines(false),
75 invert_viewport_scroll_order(false),
76 wait_for_beginframe_interval(true),
77 max_staging_buffers(32) {}
79 LayerTreeSettings::~LayerTreeSettings() {}
81 SchedulerSettings LayerTreeSettings::ToSchedulerSettings() const {
82 SchedulerSettings scheduler_settings;
83 scheduler_settings.use_external_begin_frame_source =
84 use_external_begin_frame_source;
85 scheduler_settings.main_frame_before_activation_enabled =
86 main_frame_before_activation_enabled;
87 scheduler_settings.timeout_and_draw_when_animation_checkerboards =
88 timeout_and_draw_when_animation_checkerboards;
89 scheduler_settings.using_synchronous_renderer_compositor =
90 using_synchronous_renderer_compositor;
91 scheduler_settings.throttle_frame_production = wait_for_beginframe_interval;
92 scheduler_settings.background_frame_interval =
93 base::TimeDelta::FromSecondsD(1.0 / background_animation_rate);
94 return scheduler_settings;
97 } // namespace cc