Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(284)

Side by Side Diff: cc/trees/layer_tree_settings.cc

Issue 2021433005: cc: Make LayerTreeSettings have in-member initialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/trees/layer_tree_settings.h" 5 #include "cc/trees/layer_tree_settings.h"
6 6
7 #include <GLES2/gl2.h>
8 #include <stddef.h>
9 #include <limits>
10
11 #include "base/command_line.h"
12 #include "base/logging.h"
13 #include "base/strings/string_number_conversions.h"
14 #include "cc/proto/gfx_conversions.h" 7 #include "cc/proto/gfx_conversions.h"
15 #include "cc/proto/gpu_conversions.h"
16 #include "cc/proto/layer_tree_settings.pb.h" 8 #include "cc/proto/layer_tree_settings.pb.h"
17 #include "ui/gfx/buffer_types.h"
18 9
19 namespace cc { 10 namespace cc {
20 11
21 namespace { 12 namespace {
22 13
23 proto::LayerTreeSettings_ScrollbarAnimator 14 proto::LayerTreeSettings_ScrollbarAnimator
24 LayerTreeSettingsScrollbarAnimatorToProto( 15 LayerTreeSettingsScrollbarAnimatorToProto(
25 const LayerTreeSettings::ScrollbarAnimator& animator) { 16 const LayerTreeSettings::ScrollbarAnimator& animator) {
26 switch (animator) { 17 switch (animator) {
27 case LayerTreeSettings::ScrollbarAnimator::NO_ANIMATOR: 18 case LayerTreeSettings::ScrollbarAnimator::NO_ANIMATOR:
(...skipping 19 matching lines...) Expand all
47 return LayerTreeSettings::ScrollbarAnimator::THINNING; 38 return LayerTreeSettings::ScrollbarAnimator::THINNING;
48 case proto::LayerTreeSettings_ScrollbarAnimator_UNKNOWN: 39 case proto::LayerTreeSettings_ScrollbarAnimator_UNKNOWN:
49 NOTREACHED() << "proto::LayerTreeSettings_ScrollbarAnimator_UNKNOWN"; 40 NOTREACHED() << "proto::LayerTreeSettings_ScrollbarAnimator_UNKNOWN";
50 return LayerTreeSettings::ScrollbarAnimator::NO_ANIMATOR; 41 return LayerTreeSettings::ScrollbarAnimator::NO_ANIMATOR;
51 } 42 }
52 return LayerTreeSettings::ScrollbarAnimator::NO_ANIMATOR; 43 return LayerTreeSettings::ScrollbarAnimator::NO_ANIMATOR;
53 } 44 }
54 45
55 } // namespace 46 } // namespace
56 47
57 LayerTreeSettings::LayerTreeSettings() 48 LayerTreeSettings::LayerTreeSettings() = default;
58 : single_thread_proxy_scheduler(true),
59 use_external_begin_frame_source(false),
60 use_output_surface_begin_frame_source(false),
61 main_frame_before_activation_enabled(false),
62 using_synchronous_renderer_compositor(false),
63 can_use_lcd_text(true),
64 use_distance_field_text(false),
65 gpu_rasterization_enabled(false),
66 gpu_rasterization_forced(false),
67 async_worker_context_enabled(false),
68 gpu_rasterization_msaa_sample_count(0),
69 gpu_rasterization_skewport_target_time_in_seconds(0.2f),
70 create_low_res_tiling(false),
71 scrollbar_animator(NO_ANIMATOR),
72 scrollbar_fade_delay_ms(0),
73 scrollbar_fade_resize_delay_ms(0),
74 scrollbar_fade_duration_ms(0),
75 solid_color_scrollbar_color(SK_ColorWHITE),
76 timeout_and_draw_when_animation_checkerboards(true),
77 layer_transforms_should_scale_layer_contents(false),
78 layers_always_allowed_lcd_text(false),
79 minimum_contents_scale(0.0625f),
80 low_res_contents_scale_factor(0.25f),
81 top_controls_show_threshold(0.5f),
82 top_controls_hide_threshold(0.5f),
83 background_animation_rate(1.0),
84 default_tile_size(gfx::Size(256, 256)),
85 max_untiled_layer_size(gfx::Size(512, 512)),
86 minimum_occlusion_tracking_size(gfx::Size(160, 160)),
87 // 3000 pixels should give sufficient area for prepainting.
88 tiling_interest_area_padding(3000),
89 skewport_target_time_in_seconds(1.0f),
90 skewport_extrapolation_limit_in_screen_pixels(2000),
91 max_memory_for_prepaint_percentage(100),
92 use_zero_copy(false),
93 use_partial_raster(false),
94 enable_elastic_overscroll(false),
95 use_image_texture_targets(
96 static_cast<size_t>(gfx::BufferFormat::LAST) + 1,
97 GL_TEXTURE_2D),
98 ignore_root_layer_flings(false),
99 scheduled_raster_task_limit(32),
100 use_occlusion_for_tile_prioritization(false),
101 verify_clip_tree_calculations(false),
102 image_decode_tasks_enabled(false),
103 wait_for_beginframe_interval(true),
104 abort_commit_before_output_surface_creation(true),
105 use_mouse_wheel_gestures(false),
106 use_layer_lists(false),
107 max_staging_buffer_usage_in_bytes(32 * 1024 * 1024),
108 memory_policy_(64 * 1024 * 1024,
109 gpu::MemoryAllocation::CUTOFF_ALLOW_EVERYTHING,
110 ManagedMemoryPolicy::kDefaultNumResourcesLimit),
111 gpu_decoded_image_budget_bytes(96 * 1024 * 1024),
112 software_decoded_image_budget_bytes(128 * 1024 * 1024),
113 use_cached_picture_raster(true) {}
114
115 LayerTreeSettings::LayerTreeSettings(const LayerTreeSettings& other) = default; 49 LayerTreeSettings::LayerTreeSettings(const LayerTreeSettings& other) = default;
116 50 LayerTreeSettings::~LayerTreeSettings() = default;
117 LayerTreeSettings::~LayerTreeSettings() {}
118 51
119 bool LayerTreeSettings::operator==(const LayerTreeSettings& other) const { 52 bool LayerTreeSettings::operator==(const LayerTreeSettings& other) const {
120 return renderer_settings == other.renderer_settings && 53 return renderer_settings == other.renderer_settings &&
121 single_thread_proxy_scheduler == other.single_thread_proxy_scheduler && 54 single_thread_proxy_scheduler == other.single_thread_proxy_scheduler &&
122 use_external_begin_frame_source == 55 use_external_begin_frame_source ==
123 other.use_external_begin_frame_source && 56 other.use_external_begin_frame_source &&
124 main_frame_before_activation_enabled == 57 main_frame_before_activation_enabled ==
125 other.main_frame_before_activation_enabled && 58 other.main_frame_before_activation_enabled &&
126 using_synchronous_renderer_compositor == 59 using_synchronous_renderer_compositor ==
127 other.using_synchronous_renderer_compositor && 60 other.using_synchronous_renderer_compositor &&
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 using_synchronous_renderer_compositor; 251 using_synchronous_renderer_compositor;
319 scheduler_settings.throttle_frame_production = wait_for_beginframe_interval; 252 scheduler_settings.throttle_frame_production = wait_for_beginframe_interval;
320 scheduler_settings.background_frame_interval = 253 scheduler_settings.background_frame_interval =
321 base::TimeDelta::FromSecondsD(1.0 / background_animation_rate); 254 base::TimeDelta::FromSecondsD(1.0 / background_animation_rate);
322 scheduler_settings.abort_commit_before_output_surface_creation = 255 scheduler_settings.abort_commit_before_output_surface_creation =
323 abort_commit_before_output_surface_creation; 256 abort_commit_before_output_surface_creation;
324 return scheduler_settings; 257 return scheduler_settings;
325 } 258 }
326 259
327 } // namespace cc 260 } // namespace cc
OLDNEW
« cc/trees/layer_tree_settings.h ('K') | « cc/trees/layer_tree_settings.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698