File: renderer_settings.h

package info (click to toggle)
chromium 139.0.7258.127-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 6,122,068 kB
  • sloc: cpp: 35,100,771; ansic: 7,163,530; javascript: 4,103,002; python: 1,436,920; asm: 946,517; xml: 746,709; pascal: 187,653; perl: 88,691; sh: 88,436; objc: 79,953; sql: 51,488; cs: 44,583; fortran: 24,137; makefile: 22,147; tcl: 15,277; php: 13,980; yacc: 8,984; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (100 lines) | stat: -rw-r--r-- 3,790 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_VIZ_COMMON_DISPLAY_RENDERER_SETTINGS_H_
#define COMPONENTS_VIZ_COMMON_DISPLAY_RENDERER_SETTINGS_H_

#include <stddef.h>

#include <vector>

#include "build/build_config.h"
#include "components/viz/common/display/overlay_strategy.h"
#include "components/viz/common/viz_common_export.h"
#include "ui/display/types/display_constants.h"
#include "ui/gfx/color_space.h"
#include "ui/gfx/geometry/size.h"

namespace viz {

class VIZ_COMMON_EXPORT RendererSettings {
 public:
  RendererSettings();
  RendererSettings(const RendererSettings& other);
  ~RendererSettings();

  bool allow_antialiasing = true;
  bool force_antialiasing = false;
  bool force_blending_with_shaders = false;
  bool partial_swap_enabled = false;
  bool should_clear_root_render_pass = true;
  bool release_overlay_resources_after_gpu_query = false;
  bool dont_round_texture_sizes_for_pixel_tests = false;
  int highp_threshold_min = 0;
  bool auto_resize_output_surface = true;
  bool requires_alpha_channel = false;
  bool disable_render_pass_bypassing = false;
  // Force render pass backings to allocate shared images without the scanout
  // usage. The render pass backing will still claim the backing is scanout.
  bool force_non_scanout_backing_for_pixel_tests = false;

  int slow_down_compositing_scale_factor = 1;

  struct VIZ_COMMON_EXPORT OcclusionCullerSettings {
    // The maximum number of occluding rects to track during occlusion culling.
    int maximum_occluder_complexity = 10;
    // The maximum number (exclusive) of quads one draw quad may be split into
    // during occlusion culling. e.g. an L-shaped visible region split into two
    // quads
    int quad_split_limit = 5;
    // The minimum number of fragments that would not be drawn if a quads was
    // split into multiple quads during occlusion culling.
    int minimum_fragments_reduced = 128 * 128;
    // The minimum visible quad size to be considered an occluder.
    int occluder_minium_visible_quad_size = 32 * 32;
    // If true, complex occluders are generated for quads with rounded corners,
    bool generate_complex_occluder_for_rounded_corners = false;
    // The minimum size of quads with rounded corners to qualify for generating
    // complex occluders.
    int minumum_quad_size_with_rounded_corners = 128 * 128;
  };

  OcclusionCullerSettings occlusion_culler_settings;

#if BUILDFLAG(IS_ANDROID)
  // The screen size at renderer creation time.
  gfx::Size initial_screen_size = gfx::Size(0, 0);

  gfx::ColorSpace color_space;
#endif

#if BUILDFLAG(IS_OZONE)
  // A list of overlay strategies that should be tried. If the list is empty
  // then overlays aren't supported.
  std::vector<OverlayStrategy> overlay_strategies;
#endif
#if BUILDFLAG(IS_MAC)
  // CGDirectDisplayID for the screen on which the browser is currently
  // displayed.
  int64_t display_id = display::kInvalidDisplayId;
#endif
};

// This is a set of debug flags that can be changed at runtime, so that we can
// trigger developer features. (The above RendererSettings cannot be changed in
// viz after initialization.) It has a single instance in viz (basically a
// singleton, owned by FrameSinkManagerImpl), while other objects keep a
// reference to it. On the host size the single instance is owned by
// HostFrameSinkManager.
struct VIZ_COMMON_EXPORT DebugRendererSettings {
  bool tint_composited_content = false;
  bool tint_composited_content_modulate = false;
  bool show_overdraw_feedback = false;
  bool show_dc_layer_debug_borders = false;
  bool show_aggregated_damage = false;
};

}  // namespace viz

#endif  // COMPONENTS_VIZ_COMMON_DISPLAY_RENDERER_SETTINGS_H_