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

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: header 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
« no previous file with comments | « cc/trees/layer_tree_settings.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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" 9 #include "third_party/khronos/GLES2/gl2.h"
18 10
19 namespace cc { 11 namespace cc {
20 12
21 namespace { 13 namespace {
22 14
23 proto::LayerTreeSettings_ScrollbarAnimator 15 proto::LayerTreeSettings_ScrollbarAnimator
24 LayerTreeSettingsScrollbarAnimatorToProto( 16 LayerTreeSettingsScrollbarAnimatorToProto(
25 const LayerTreeSettings::ScrollbarAnimator& animator) { 17 const LayerTreeSettings::ScrollbarAnimator& animator) {
26 switch (animator) { 18 switch (animator) {
27 case LayerTreeSettings::ScrollbarAnimator::NO_ANIMATOR: 19 case LayerTreeSettings::ScrollbarAnimator::NO_ANIMATOR:
(...skipping 20 matching lines...) Expand all
48 case proto::LayerTreeSettings_ScrollbarAnimator_UNKNOWN: 40 case proto::LayerTreeSettings_ScrollbarAnimator_UNKNOWN:
49 NOTREACHED() << "proto::LayerTreeSettings_ScrollbarAnimator_UNKNOWN"; 41 NOTREACHED() << "proto::LayerTreeSettings_ScrollbarAnimator_UNKNOWN";
50 return LayerTreeSettings::ScrollbarAnimator::NO_ANIMATOR; 42 return LayerTreeSettings::ScrollbarAnimator::NO_ANIMATOR;
51 } 43 }
52 return LayerTreeSettings::ScrollbarAnimator::NO_ANIMATOR; 44 return LayerTreeSettings::ScrollbarAnimator::NO_ANIMATOR;
53 } 45 }
54 46
55 } // namespace 47 } // namespace
56 48
57 LayerTreeSettings::LayerTreeSettings() 49 LayerTreeSettings::LayerTreeSettings()
58 : single_thread_proxy_scheduler(true), 50 : default_tile_size(gfx::Size(256, 256)),
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)), 51 max_untiled_layer_size(gfx::Size(512, 512)),
86 minimum_occlusion_tracking_size(gfx::Size(160, 160)), 52 minimum_occlusion_tracking_size(gfx::Size(160, 160)),
87 // 3000 pixels should give sufficient area for prepainting.
88 // Note this value is specified with an ideal contents scale in mind. That
89 // is, the ideal tiling would use this value as the padding.
90 // TODO(vmpstr): Figure out a better number that doesn't depend on scale.
91 tiling_interest_area_padding(3000),
92 skewport_target_time_in_seconds(1.0f),
93 skewport_extrapolation_limit_in_screen_pixels(2000),
94 max_memory_for_prepaint_percentage(100),
95 use_zero_copy(false),
96 use_partial_raster(false),
97 enable_elastic_overscroll(false),
98 use_image_texture_targets( 53 use_image_texture_targets(
99 static_cast<size_t>(gfx::BufferFormat::LAST) + 1, 54 static_cast<size_t>(gfx::BufferFormat::LAST) + 1,
100 GL_TEXTURE_2D), 55 GL_TEXTURE_2D),
101 ignore_root_layer_flings(false),
102 scheduled_raster_task_limit(32),
103 use_occlusion_for_tile_prioritization(false),
104 verify_clip_tree_calculations(false),
105 image_decode_tasks_enabled(false),
106 wait_for_beginframe_interval(true),
107 abort_commit_before_output_surface_creation(true),
108 use_mouse_wheel_gestures(false),
109 use_layer_lists(false),
110 max_staging_buffer_usage_in_bytes(32 * 1024 * 1024),
111 memory_policy_(64 * 1024 * 1024, 56 memory_policy_(64 * 1024 * 1024,
112 gpu::MemoryAllocation::CUTOFF_ALLOW_EVERYTHING, 57 gpu::MemoryAllocation::CUTOFF_ALLOW_EVERYTHING,
113 ManagedMemoryPolicy::kDefaultNumResourcesLimit), 58 ManagedMemoryPolicy::kDefaultNumResourcesLimit) {}
114 gpu_decoded_image_budget_bytes(96 * 1024 * 1024),
115 software_decoded_image_budget_bytes(128 * 1024 * 1024),
116 use_cached_picture_raster(true) {}
117 59
118 LayerTreeSettings::LayerTreeSettings(const LayerTreeSettings& other) = default; 60 LayerTreeSettings::LayerTreeSettings(const LayerTreeSettings& other) = default;
119 61 LayerTreeSettings::~LayerTreeSettings() = default;
120 LayerTreeSettings::~LayerTreeSettings() {}
121 62
122 bool LayerTreeSettings::operator==(const LayerTreeSettings& other) const { 63 bool LayerTreeSettings::operator==(const LayerTreeSettings& other) const {
123 return renderer_settings == other.renderer_settings && 64 return renderer_settings == other.renderer_settings &&
124 single_thread_proxy_scheduler == other.single_thread_proxy_scheduler && 65 single_thread_proxy_scheduler == other.single_thread_proxy_scheduler &&
125 use_external_begin_frame_source == 66 use_external_begin_frame_source ==
126 other.use_external_begin_frame_source && 67 other.use_external_begin_frame_source &&
127 main_frame_before_activation_enabled == 68 main_frame_before_activation_enabled ==
128 other.main_frame_before_activation_enabled && 69 other.main_frame_before_activation_enabled &&
129 using_synchronous_renderer_compositor == 70 using_synchronous_renderer_compositor ==
130 other.using_synchronous_renderer_compositor && 71 other.using_synchronous_renderer_compositor &&
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 using_synchronous_renderer_compositor; 262 using_synchronous_renderer_compositor;
322 scheduler_settings.throttle_frame_production = wait_for_beginframe_interval; 263 scheduler_settings.throttle_frame_production = wait_for_beginframe_interval;
323 scheduler_settings.background_frame_interval = 264 scheduler_settings.background_frame_interval =
324 base::TimeDelta::FromSecondsD(1.0 / background_animation_rate); 265 base::TimeDelta::FromSecondsD(1.0 / background_animation_rate);
325 scheduler_settings.abort_commit_before_output_surface_creation = 266 scheduler_settings.abort_commit_before_output_surface_creation =
326 abort_commit_before_output_surface_creation; 267 abort_commit_before_output_surface_creation;
327 return scheduler_settings; 268 return scheduler_settings;
328 } 269 }
329 270
330 } // namespace cc 271 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_settings.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698