| Romain Guy | 51769a6 | 2010-07-23 00:28:00 -0700 | [diff] [blame] | 1 | /* | 
|  | 2 | * Copyright (C) 2010 The Android Open Source Project | 
|  | 3 | * | 
|  | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); | 
|  | 5 | * you may not use this file except in compliance with the License. | 
|  | 6 | * You may obtain a copy of the License at | 
|  | 7 | * | 
|  | 8 | *      http://www.apache.org/licenses/LICENSE-2.0 | 
|  | 9 | * | 
|  | 10 | * Unless required by applicable law or agreed to in writing, software | 
|  | 11 | * distributed under the License is distributed on an "AS IS" BASIS, | 
|  | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 
|  | 13 | * See the License for the specific language governing permissions and | 
|  | 14 | * limitations under the License. | 
|  | 15 | */ | 
|  | 16 |  | 
| Romain Guy | 5b3b352 | 2010-10-27 18:57:51 -0700 | [diff] [blame] | 17 | #ifndef ANDROID_HWUI_PROPERTIES_H | 
|  | 18 | #define ANDROID_HWUI_PROPERTIES_H | 
| Romain Guy | 51769a6 | 2010-07-23 00:28:00 -0700 | [diff] [blame] | 19 |  | 
| John Reck | 938e884 | 2017-08-24 13:41:59 -0700 | [diff] [blame] | 20 | #include <cutils/compiler.h> | 
| Romain Guy | fb8b763 | 2010-08-23 21:05:08 -0700 | [diff] [blame] | 21 |  | 
| Romain Guy | 51769a6 | 2010-07-23 00:28:00 -0700 | [diff] [blame] | 22 | /** | 
| Chris Craik | 5e00c7c | 2016-07-06 16:10:09 -0700 | [diff] [blame] | 23 | * This file contains the list of system properties used to configure libhwui. | 
| Romain Guy | 51769a6 | 2010-07-23 00:28:00 -0700 | [diff] [blame] | 24 | */ | 
|  | 25 |  | 
| Chris Craik | 2507c34 | 2015-05-04 14:36:49 -0700 | [diff] [blame] | 26 | namespace android { | 
|  | 27 | namespace uirenderer { | 
|  | 28 |  | 
| Romain Guy | cf51a41 | 2013-04-08 19:40:31 -0700 | [diff] [blame] | 29 | /////////////////////////////////////////////////////////////////////////////// | 
|  | 30 | // Compile-time properties | 
|  | 31 | /////////////////////////////////////////////////////////////////////////////// | 
|  | 32 |  | 
| Romain Guy | 28d8ff6 | 2011-08-22 14:01:34 -0700 | [diff] [blame] | 33 | // Textures used by layers must have dimensions multiples of this number | 
|  | 34 | #define LAYER_SIZE 64 | 
|  | 35 |  | 
| Romain Guy | 8d4aeb7 | 2013-02-12 16:08:55 -0800 | [diff] [blame] | 36 | // Defines the size in bits of the stencil buffer for the framebuffer | 
| Romain Guy | ada4d53 | 2012-02-02 17:31:16 -0800 | [diff] [blame] | 37 | // Note: Only 1 bit is required for clipping but more bits are required | 
| Romain Guy | 8d4aeb7 | 2013-02-12 16:08:55 -0800 | [diff] [blame] | 38 | // to properly implement overdraw debugging | 
| Romain Guy | 7c450aa | 2012-09-21 19:15:00 -0700 | [diff] [blame] | 39 | #define STENCIL_BUFFER_SIZE 8 | 
| Romain Guy | 530041d | 2012-01-25 18:56:29 -0800 | [diff] [blame] | 40 |  | 
| Romain Guy | cf51a41 | 2013-04-08 19:40:31 -0700 | [diff] [blame] | 41 | /////////////////////////////////////////////////////////////////////////////// | 
|  | 42 | // Debug properties | 
|  | 43 | /////////////////////////////////////////////////////////////////////////////// | 
|  | 44 |  | 
| Romain Guy | e190aa6 | 2010-11-10 19:01:29 -0800 | [diff] [blame] | 45 | /** | 
| Romain Guy | 4ff0cf4 | 2012-08-06 14:51:10 -0700 | [diff] [blame] | 46 | * Debug level for app developers. The value is a numeric value defined | 
|  | 47 | * by the DebugLevel enum below. | 
| Romain Guy | e190aa6 | 2010-11-10 19:01:29 -0800 | [diff] [blame] | 48 | */ | 
| Romain Guy | 4ff0cf4 | 2012-08-06 14:51:10 -0700 | [diff] [blame] | 49 | #define PROPERTY_DEBUG "debug.hwui.level" | 
| Romain Guy | e190aa6 | 2010-11-10 19:01:29 -0800 | [diff] [blame] | 50 |  | 
|  | 51 | /** | 
|  | 52 | * Debug levels. Debug levels are used as flags. | 
|  | 53 | */ | 
|  | 54 | enum DebugLevel { | 
|  | 55 | kDebugDisabled = 0, | 
|  | 56 | kDebugMemory = 1, | 
| Romain Guy | 25dc3a7 | 2010-12-10 12:33:05 -0800 | [diff] [blame] | 57 | kDebugCaches = 2, | 
| Kenny Root | 042f7d6 | 2011-07-13 09:49:43 -0700 | [diff] [blame] | 58 | kDebugMoreCaches = kDebugMemory | kDebugCaches | 
| Romain Guy | e190aa6 | 2010-11-10 19:01:29 -0800 | [diff] [blame] | 59 | }; | 
|  | 60 |  | 
| Romain Guy | 4ff0cf4 | 2012-08-06 14:51:10 -0700 | [diff] [blame] | 61 | /** | 
| Romain Guy | 7c450aa | 2012-09-21 19:15:00 -0700 | [diff] [blame] | 62 | * Used to enable/disable layers update debugging. The accepted values are | 
| Romain Guy | 4ff0cf4 | 2012-08-06 14:51:10 -0700 | [diff] [blame] | 63 | * "true" and "false". The default value is "false". | 
|  | 64 | */ | 
|  | 65 | #define PROPERTY_DEBUG_LAYERS_UPDATES "debug.hwui.show_layers_updates" | 
|  | 66 |  | 
| Romain Guy | 7c450aa | 2012-09-21 19:15:00 -0700 | [diff] [blame] | 67 | /** | 
| Romain Guy | 627c6fd | 2013-08-21 11:53:18 -0700 | [diff] [blame] | 68 | * Used to enable/disable overdraw debugging. | 
|  | 69 | * | 
|  | 70 | * The accepted values are | 
|  | 71 | * "show", to show overdraw | 
|  | 72 | * "show_deuteranomaly", to show overdraw if you suffer from Deuteranomaly | 
|  | 73 | * "count", to show an overdraw counter | 
|  | 74 | * "false", to disable overdraw debugging | 
|  | 75 | * | 
|  | 76 | * The default value is "false". | 
| Romain Guy | 7c450aa | 2012-09-21 19:15:00 -0700 | [diff] [blame] | 77 | */ | 
| Romain Guy | 78dd96d | 2013-05-03 14:24:16 -0700 | [diff] [blame] | 78 | #define PROPERTY_DEBUG_OVERDRAW "debug.hwui.overdraw" | 
| Romain Guy | 7c450aa | 2012-09-21 19:15:00 -0700 | [diff] [blame] | 79 |  | 
| Romain Guy | 87e2f757 | 2012-09-24 11:37:12 -0700 | [diff] [blame] | 80 | /** | 
| John Reck | fe5e7b7 | 2014-05-23 17:42:28 -0700 | [diff] [blame] | 81 | *  System property used to enable or disable hardware rendering profiling. | 
|  | 82 | * The default value of this property is assumed to be false. | 
|  | 83 | * | 
|  | 84 | * When profiling is enabled, the adb shell dumpsys gfxinfo command will | 
|  | 85 | * output extra information about the time taken to execute by the last | 
|  | 86 | * frames. | 
|  | 87 | * | 
|  | 88 | * Possible values: | 
|  | 89 | * "true", to enable profiling | 
|  | 90 | * "visual_bars", to enable profiling and visualize the results on screen | 
|  | 91 | * "false", to disable profiling | 
|  | 92 | */ | 
|  | 93 | #define PROPERTY_PROFILE "debug.hwui.profile" | 
|  | 94 | #define PROPERTY_PROFILE_VISUALIZE_BARS "visual_bars" | 
|  | 95 |  | 
|  | 96 | /** | 
| John Reck | 23d307c | 2014-10-27 12:38:48 -0700 | [diff] [blame] | 97 | * Turn on to draw dirty regions every other frame. | 
|  | 98 | * | 
|  | 99 | * Possible values: | 
|  | 100 | * "true", to enable dirty regions debugging | 
|  | 101 | * "false", to disable dirty regions debugging | 
|  | 102 | */ | 
|  | 103 | #define PROPERTY_DEBUG_SHOW_DIRTY_REGIONS "debug.hwui.show_dirty_regions" | 
|  | 104 |  | 
|  | 105 | /** | 
| John Reck | d04794a | 2015-05-08 10:04:36 -0700 | [diff] [blame] | 106 | * Setting this property will enable or disable the dropping of frames with | 
|  | 107 | * empty damage. Default is "true". | 
|  | 108 | */ | 
|  | 109 | #define PROPERTY_SKIP_EMPTY_DAMAGE "debug.hwui.skip_empty_damage" | 
|  | 110 |  | 
|  | 111 | /** | 
| John Reck | 149173d | 2015-08-10 09:52:29 -0700 | [diff] [blame] | 112 | * Controls whether or not HWUI will use the EGL_EXT_buffer_age extension | 
|  | 113 | * to do partial invalidates. Setting this to "false" will fall back to | 
|  | 114 | * using BUFFER_PRESERVED instead | 
|  | 115 | * Default is "true" | 
|  | 116 | */ | 
|  | 117 | #define PROPERTY_USE_BUFFER_AGE "debug.hwui.use_buffer_age" | 
|  | 118 |  | 
|  | 119 | /** | 
|  | 120 | * Setting this to "false" will force HWUI to always do full-redraws of the surface. | 
|  | 121 | * This will disable the use of EGL_EXT_buffer_age and BUFFER_PRESERVED. | 
|  | 122 | * Default is "true" | 
|  | 123 | */ | 
| ryang | 647bc13 | 2016-09-26 15:57:38 -0400 | [diff] [blame] | 124 | #define PROPERTY_ENABLE_PARTIAL_UPDATES "debug.hwui.use_partial_updates" | 
| John Reck | 149173d | 2015-08-10 09:52:29 -0700 | [diff] [blame] | 125 |  | 
| John Reck | c7cd9cf | 2016-03-28 10:38:19 -0700 | [diff] [blame] | 126 | #define PROPERTY_FILTER_TEST_OVERHEAD "debug.hwui.filter_test_overhead" | 
|  | 127 |  | 
| Stan Iliev | 03de074 | 2016-07-07 12:35:54 -0400 | [diff] [blame] | 128 | /** | 
| John Reck | 8dc02f9 | 2017-07-17 09:55:02 -0700 | [diff] [blame] | 129 | * Indicates whether PBOs can be used to back pixel buffers. | 
|  | 130 | * Accepted values are "true" and "false". Default is true. | 
|  | 131 | */ | 
|  | 132 | #define PROPERTY_ENABLE_GPU_PIXEL_BUFFERS "debug.hwui.use_gpu_pixel_buffers" | 
|  | 133 |  | 
|  | 134 | /** | 
| Stan Iliev | 03de074 | 2016-07-07 12:35:54 -0400 | [diff] [blame] | 135 | * Allows to set rendering pipeline mode to OpenGL (default), Skia OpenGL | 
|  | 136 | * or Vulkan. | 
|  | 137 | */ | 
| Derek Sollenberger | 4badfe6 | 2017-02-14 11:38:06 -0500 | [diff] [blame] | 138 | #define PROPERTY_RENDERER "debug.hwui.renderer" | 
| Stan Iliev | 03de074 | 2016-07-07 12:35:54 -0400 | [diff] [blame] | 139 |  | 
| Stan Iliev | e9d0012 | 2017-09-19 12:07:10 -0400 | [diff] [blame] | 140 | /** | 
|  | 141 | * Allows to collect a recording of Skia drawing commands. | 
|  | 142 | */ | 
|  | 143 | #define PROPERTY_CAPTURE_SKP_ENABLED "debug.hwui.capture_skp_enabled" | 
|  | 144 |  | 
| Stan Iliev | e9d0012 | 2017-09-19 12:07:10 -0400 | [diff] [blame] | 145 | /** | 
| Nolan Scobie | 799b574 | 2022-12-05 21:12:16 -0500 | [diff] [blame] | 146 | * Allows broad recording of Skia drawing commands. | 
|  | 147 | * | 
|  | 148 | * If disabled, a very minimal set of trace events *may* be recorded. | 
|  | 149 | * If enabled, a much broader set of trace events *may* be recorded. | 
|  | 150 | * | 
|  | 151 | * In either case, trace events are only recorded if an appropriately configured tracing session is | 
|  | 152 | * active. | 
|  | 153 | * | 
|  | 154 | * Use debug.hwui.skia_use_perfetto_track_events to determine if ATrace (default) or Perfetto is | 
|  | 155 | * used as the tracing backend. | 
| Stan Iliev | 02daab6 | 2018-06-29 15:16:11 -0400 | [diff] [blame] | 156 | */ | 
| Nolan Scobie | 799b574 | 2022-12-05 21:12:16 -0500 | [diff] [blame] | 157 | #define PROPERTY_SKIA_TRACING_ENABLED "debug.hwui.skia_tracing_enabled" | 
|  | 158 |  | 
|  | 159 | /** | 
|  | 160 | * Switches Skia's tracing to use Perfetto's Track Event system instead of ATrace. | 
|  | 161 | * | 
|  | 162 | * If disabled, ATrace will be used by default, which will record trace events from any of Skia's | 
|  | 163 | * tracing categories if overall system tracing is active and the "gfx" and "view" ATrace categories | 
|  | 164 | * are enabled. | 
|  | 165 | * | 
|  | 166 | * If enabled, then Perfetto's Track Event system will be used instead, which will only record if an | 
|  | 167 | * active Perfetto tracing session is targeting the correct apps and Skia tracing categories with | 
|  | 168 | * the Track Event data source enabled. This approach may be used to selectively filter out | 
|  | 169 | * undesired Skia tracing categories, and events will contain more data fields. | 
|  | 170 | */ | 
|  | 171 | #define PROPERTY_SKIA_USE_PERFETTO_TRACK_EVENTS "debug.hwui.skia_use_perfetto_track_events" | 
| Stan Iliev | 02daab6 | 2018-06-29 15:16:11 -0400 | [diff] [blame] | 172 |  | 
|  | 173 | /** | 
| Stan Iliev | e9d0012 | 2017-09-19 12:07:10 -0400 | [diff] [blame] | 174 | * Defines how many frames in a sequence to capture. | 
|  | 175 | */ | 
| John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 176 | #define PROPERTY_CAPTURE_SKP_FRAMES "debug.hwui.capture_skp_frames" | 
| Stan Iliev | e9d0012 | 2017-09-19 12:07:10 -0400 | [diff] [blame] | 177 |  | 
|  | 178 | /** | 
|  | 179 | * File name and location, where a SKP recording will be saved. | 
|  | 180 | */ | 
|  | 181 | #define PROPERTY_CAPTURE_SKP_FILENAME "debug.hwui.skp_filename" | 
|  | 182 |  | 
| Lingfeng Yang | 3a9f223 | 2018-01-24 10:40:18 -0800 | [diff] [blame] | 183 | /** | 
| Bo Liu | 027b218 | 2021-03-18 16:50:38 -0400 | [diff] [blame] | 184 | * Controls whether HWUI will send timing hints to HintManager for | 
|  | 185 | * better CPU scheduling. Accepted values are "true" and "false". | 
|  | 186 | */ | 
|  | 187 | #define PROPERTY_USE_HINT_MANAGER "debug.hwui.use_hint_manager" | 
|  | 188 |  | 
|  | 189 | /** | 
|  | 190 | * Percentage of frame time that's used for CPU work. The rest is | 
|  | 191 | * reserved for GPU work. This is used with use_hint_manager to | 
|  | 192 | * provide timing hints to HintManager. Accepted values are | 
|  | 193 | * integer from 1-100. | 
|  | 194 | */ | 
|  | 195 | #define PROPERTY_TARGET_CPU_TIME_PERCENTAGE "debug.hwui.target_cpu_time_percent" | 
|  | 196 |  | 
|  | 197 | /** | 
| Lingfeng Yang | 3a9f223 | 2018-01-24 10:40:18 -0800 | [diff] [blame] | 198 | * Property for whether this is running in the emulator. | 
|  | 199 | */ | 
| Roman Kiryanov | d6a9f425 | 2021-03-10 16:57:41 -0800 | [diff] [blame] | 200 | #define PROPERTY_IS_EMULATOR "ro.boot.qemu" | 
| Lingfeng Yang | 3a9f223 | 2018-01-24 10:40:18 -0800 | [diff] [blame] | 201 |  | 
| Adlai Holler | 5636cde | 2021-03-25 16:53:56 +0000 | [diff] [blame] | 202 | /** | 
|  | 203 | * Turns on the Skia GPU option "reduceOpsTaskSplitting" which improves GPU | 
| Adlai Holler | 108be5b | 2021-04-20 14:37:29 +0000 | [diff] [blame] | 204 | * efficiency but may increase VRAM consumption. Default is "true". | 
| Adlai Holler | 5636cde | 2021-03-25 16:53:56 +0000 | [diff] [blame] | 205 | */ | 
|  | 206 | #define PROPERTY_REDUCE_OPS_TASK_SPLITTING "renderthread.skia.reduceopstasksplitting" | 
|  | 207 |  | 
| Huihong Luo | eb93107 | 2021-06-30 10:12:17 -0700 | [diff] [blame] | 208 | /** | 
|  | 209 | * Enable WebView Overlays feature. | 
|  | 210 | */ | 
|  | 211 | #define PROPERTY_WEBVIEW_OVERLAYS_ENABLED "debug.hwui.webview_overlays_enabled" | 
|  | 212 |  | 
| Brett Chabot | 856db9e | 2021-05-21 08:41:58 -0700 | [diff] [blame] | 213 | /** | 
|  | 214 | * Property for globally GL drawing state. Can be overridden per process with | 
|  | 215 | * setDrawingEnabled. | 
|  | 216 | */ | 
|  | 217 | #define PROPERTY_DRAWING_ENABLED "debug.hwui.drawing_enabled" | 
|  | 218 |  | 
| John Reck | 5f66fb8 | 2022-09-23 17:49:23 -0400 | [diff] [blame] | 219 | #define PROPERTY_MEMORY_POLICY "debug.hwui.app_memory_policy" | 
|  | 220 |  | 
| John Reck | 342f621 | 2023-03-14 21:58:26 -0400 | [diff] [blame] | 221 | #define PROPERTY_8BIT_HDR_HEADROOM "debug.hwui.8bit_hdr_headroom" | 
|  | 222 |  | 
| Romain Guy | cf51a41 | 2013-04-08 19:40:31 -0700 | [diff] [blame] | 223 | /////////////////////////////////////////////////////////////////////////////// | 
| Romain Guy | cf51a41 | 2013-04-08 19:40:31 -0700 | [diff] [blame] | 224 | // Misc | 
|  | 225 | /////////////////////////////////////////////////////////////////////////////// | 
|  | 226 |  | 
|  | 227 | // Converts a number of mega-bytes into bytes | 
| John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 228 | #define MB(s) ((s)*1024 * 1024) | 
| Romain Guy | 3b748a4 | 2013-04-17 18:54:38 -0700 | [diff] [blame] | 229 | // Converts a number of kilo-bytes into bytes | 
| John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 230 | #define KB(s) ((s)*1024) | 
| Romain Guy | cf51a41 | 2013-04-08 19:40:31 -0700 | [diff] [blame] | 231 |  | 
| John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 232 | enum class ProfileType { None, Console, Bars }; | 
| Chris Craik | 2507c34 | 2015-05-04 14:36:49 -0700 | [diff] [blame] | 233 |  | 
| John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 234 | enum class OverdrawColorSet { Default = 0, Deuteranomaly }; | 
| Chris Craik | 2507c34 | 2015-05-04 14:36:49 -0700 | [diff] [blame] | 235 |  | 
| John Reck | 18f442e | 2018-04-09 16:56:34 -0700 | [diff] [blame] | 236 | enum class RenderPipelineType { SkiaGL, SkiaVulkan, NotInitialized = 128 }; | 
| Stan Iliev | 03de074 | 2016-07-07 12:35:54 -0400 | [diff] [blame] | 237 |  | 
| John Reck | 8ed00dc | 2021-05-10 13:09:27 -0400 | [diff] [blame] | 238 | enum class StretchEffectBehavior { | 
| John Reck | 8088f8e | 2021-05-11 20:38:19 -0400 | [diff] [blame] | 239 | ShaderHWUI,   // Stretch shader in HWUI only, matrix scale in SF | 
|  | 240 | Shader,       // Stretch shader in both HWUI and SF | 
|  | 241 | UniformScale  // Uniform scale stretch everywhere | 
| John Reck | 8ed00dc | 2021-05-10 13:09:27 -0400 | [diff] [blame] | 242 | }; | 
|  | 243 |  | 
| Brett Chabot | 074ba59 | 2021-07-16 14:38:11 -0700 | [diff] [blame] | 244 | enum class DrawingEnabled { NotInitialized, On, Off }; | 
| Brett Chabot | 856db9e | 2021-05-21 08:41:58 -0700 | [diff] [blame] | 245 |  | 
| Chris Craik | 2507c34 | 2015-05-04 14:36:49 -0700 | [diff] [blame] | 246 | /** | 
|  | 247 | * Renderthread-only singleton which manages several static rendering properties. Most of these | 
|  | 248 | * are driven by system properties which are queried once at initialization, and again if init() | 
|  | 249 | * is called. | 
|  | 250 | */ | 
|  | 251 | class Properties { | 
|  | 252 | public: | 
|  | 253 | static bool load(); | 
|  | 254 |  | 
| Chris Craik | 2507c34 | 2015-05-04 14:36:49 -0700 | [diff] [blame] | 255 | static bool debugLayersUpdates; | 
|  | 256 | static bool debugOverdraw; | 
|  | 257 | static bool showDirtyRegions; | 
| John Reck | d04794a | 2015-05-08 10:04:36 -0700 | [diff] [blame] | 258 | // TODO: Remove after stabilization period | 
|  | 259 | static bool skipEmptyFrames; | 
| John Reck | 149173d | 2015-08-10 09:52:29 -0700 | [diff] [blame] | 260 | static bool useBufferAge; | 
|  | 261 | static bool enablePartialUpdates; | 
| Nader Jawad | 4a6b60a | 2021-09-20 21:22:50 -0700 | [diff] [blame] | 262 | static bool enableRenderEffectCache; | 
| Chris Craik | 2507c34 | 2015-05-04 14:36:49 -0700 | [diff] [blame] | 263 |  | 
| John Reck | 8dc02f9 | 2017-07-17 09:55:02 -0700 | [diff] [blame] | 264 | // TODO: Move somewhere else? | 
|  | 265 | static constexpr float textGamma = 1.45f; | 
| Chris Craik | 9fded23 | 2015-11-11 16:42:34 -0800 | [diff] [blame] | 266 |  | 
| Chris Craik | 2507c34 | 2015-05-04 14:36:49 -0700 | [diff] [blame] | 267 | static DebugLevel debugLevel; | 
|  | 268 | static OverdrawColorSet overdrawColorSet; | 
| Chris Craik | 2507c34 | 2015-05-04 14:36:49 -0700 | [diff] [blame] | 269 |  | 
|  | 270 | // Override the value for a subset of properties in this class | 
|  | 271 | static void overrideProperty(const char* name, const char* value); | 
|  | 272 |  | 
|  | 273 | static float overrideLightRadius; | 
|  | 274 | static float overrideLightPosY; | 
|  | 275 | static float overrideLightPosZ; | 
|  | 276 | static float overrideAmbientRatio; | 
|  | 277 | static int overrideAmbientShadowStrength; | 
|  | 278 | static int overrideSpotShadowStrength; | 
|  | 279 |  | 
|  | 280 | static ProfileType getProfileType(); | 
| Derek Sollenberger | 3fedf5a | 2020-02-21 13:07:28 -0500 | [diff] [blame] | 281 | static RenderPipelineType peekRenderPipelineType(); | 
|  | 282 | static RenderPipelineType getRenderPipelineType(); | 
| Chris Craik | 2507c34 | 2015-05-04 14:36:49 -0700 | [diff] [blame] | 283 |  | 
| Derek Sollenberger | 3fedf5a | 2020-02-21 13:07:28 -0500 | [diff] [blame] | 284 | static bool enableHighContrastText; | 
| John Reck | 938e884 | 2017-08-24 13:41:59 -0700 | [diff] [blame] | 285 |  | 
| John Reck | 682573c | 2015-10-30 10:37:35 -0700 | [diff] [blame] | 286 | // Should be used only by test apps | 
|  | 287 | static bool waitForGpuCompletion; | 
| John Reck | f148076 | 2016-07-03 18:28:25 -0700 | [diff] [blame] | 288 | static bool forceDrawFrame; | 
| John Reck | 682573c | 2015-10-30 10:37:35 -0700 | [diff] [blame] | 289 |  | 
| John Reck | c7cd9cf | 2016-03-28 10:38:19 -0700 | [diff] [blame] | 290 | // Should only be set by automated tests to try and filter out | 
|  | 291 | // any overhead they add | 
|  | 292 | static bool filterOutTestOverhead; | 
|  | 293 |  | 
| John Reck | a896306 | 2017-06-14 10:47:50 -0700 | [diff] [blame] | 294 | // Workaround a device lockup in edge cases by switching to async mode | 
|  | 295 | // instead of the default vsync (b/38372997). Only system_server should hit this. | 
|  | 296 | // Any existing RenderProxy & Surface combination will be unaffected, only things | 
|  | 297 | // created after changing this. | 
|  | 298 | static bool disableVsync; | 
|  | 299 |  | 
| Stan Iliev | e9d0012 | 2017-09-19 12:07:10 -0400 | [diff] [blame] | 300 | static bool skpCaptureEnabled; | 
|  | 301 |  | 
| John Reck | 9f51644 | 2017-09-25 10:27:21 -0700 | [diff] [blame] | 302 | // For experimentation b/68769804 | 
| Derek Sollenberger | 3fedf5a | 2020-02-21 13:07:28 -0500 | [diff] [blame] | 303 | static bool enableRTAnimations; | 
| John Reck | 9f51644 | 2017-09-25 10:27:21 -0700 | [diff] [blame] | 304 |  | 
| John Reck | 113ddd9 | 2017-11-09 16:21:21 -0800 | [diff] [blame] | 305 | // Used for testing only to change the render pipeline. | 
| Alec Mouri | 219997a | 2023-05-23 17:25:19 +0000 | [diff] [blame] | 306 | static void overrideRenderPipelineType(RenderPipelineType); | 
| Greg Daniel | 98c78dad | 2017-01-04 14:45:56 -0500 | [diff] [blame] | 307 |  | 
| Lingfeng Yang | 3a9f223 | 2018-01-24 10:40:18 -0800 | [diff] [blame] | 308 | static bool runningInEmulator; | 
|  | 309 |  | 
| Derek Sollenberger | 3fedf5a | 2020-02-21 13:07:28 -0500 | [diff] [blame] | 310 | static bool debuggingEnabled; | 
|  | 311 | static bool isolatedProcess; | 
| John Reck | 6afa009 | 2018-03-01 17:28:35 -0800 | [diff] [blame] | 312 |  | 
| Derek Sollenberger | 3fedf5a | 2020-02-21 13:07:28 -0500 | [diff] [blame] | 313 | static int contextPriority; | 
| Jorim Jaggi | 767e25e | 2018-04-04 23:07:35 +0200 | [diff] [blame] | 314 |  | 
| John Reck | f42ff76 | 2020-08-06 13:53:22 -0700 | [diff] [blame] | 315 | static float defaultSdrWhitePoint; | 
|  | 316 |  | 
| Bo Liu | 027b218 | 2021-03-18 16:50:38 -0400 | [diff] [blame] | 317 | static bool useHintManager; | 
|  | 318 | static int targetCpuTimePercentage; | 
|  | 319 |  | 
| Huihong Luo | eb93107 | 2021-06-30 10:12:17 -0700 | [diff] [blame] | 320 | static bool enableWebViewOverlays; | 
|  | 321 |  | 
| John Reck | 5f66fb8 | 2022-09-23 17:49:23 -0400 | [diff] [blame] | 322 | static bool isHighEndGfx; | 
|  | 323 | static bool isLowRam; | 
|  | 324 | static bool isSystemOrPersistent; | 
|  | 325 |  | 
| John Reck | 342f621 | 2023-03-14 21:58:26 -0400 | [diff] [blame] | 326 | static float maxHdrHeadroomOn8bit; | 
|  | 327 |  | 
| John Reck | 1b152e7 | 2023-10-24 20:43:22 -0400 | [diff] [blame] | 328 | static bool clipSurfaceViews; | 
|  | 329 |  | 
| Nader Jawad | 93d6e24 | 2021-05-17 18:12:29 -0700 | [diff] [blame] | 330 | static StretchEffectBehavior getStretchEffectBehavior() { | 
|  | 331 | return stretchEffectBehavior; | 
|  | 332 | } | 
|  | 333 |  | 
|  | 334 | static void setIsHighEndGfx(bool isHighEndGfx) { | 
| John Reck | 5f66fb8 | 2022-09-23 17:49:23 -0400 | [diff] [blame] | 335 | Properties::isHighEndGfx = isHighEndGfx; | 
| Nader Jawad | 93d6e24 | 2021-05-17 18:12:29 -0700 | [diff] [blame] | 336 | stretchEffectBehavior = isHighEndGfx ? | 
|  | 337 | StretchEffectBehavior::ShaderHWUI : | 
|  | 338 | StretchEffectBehavior::UniformScale; | 
|  | 339 | } | 
|  | 340 |  | 
| John Reck | 5f66fb8 | 2022-09-23 17:49:23 -0400 | [diff] [blame] | 341 | static void setIsLowRam(bool isLowRam) { Properties::isLowRam = isLowRam; } | 
|  | 342 |  | 
|  | 343 | static void setIsSystemOrPersistent(bool isSystemOrPersistent) { | 
|  | 344 | Properties::isSystemOrPersistent = isSystemOrPersistent; | 
|  | 345 | } | 
|  | 346 |  | 
| Nader Jawad | 93d6e24 | 2021-05-17 18:12:29 -0700 | [diff] [blame] | 347 | /** | 
|  | 348 | * Used for testing. Typical configuration of stretch behavior is done | 
|  | 349 | * through setIsHighEndGfx | 
|  | 350 | */ | 
|  | 351 | static void setStretchEffectBehavior(StretchEffectBehavior behavior) { | 
|  | 352 | stretchEffectBehavior = behavior; | 
|  | 353 | } | 
| John Reck | 8ed00dc | 2021-05-10 13:09:27 -0400 | [diff] [blame] | 354 |  | 
| Brett Chabot | 074ba59 | 2021-07-16 14:38:11 -0700 | [diff] [blame] | 355 | // Represents if drawing is enabled. Should only be Off in headless testing environments | 
|  | 356 | static DrawingEnabled drawingEnabled; | 
| Brett Chabot | 856db9e | 2021-05-21 08:41:58 -0700 | [diff] [blame] | 357 | static bool isDrawingEnabled(); | 
|  | 358 | static void setDrawingEnabled(bool enable); | 
|  | 359 |  | 
| Chris Craik | 2507c34 | 2015-05-04 14:36:49 -0700 | [diff] [blame] | 360 | private: | 
| Nader Jawad | 93d6e24 | 2021-05-17 18:12:29 -0700 | [diff] [blame] | 361 | static StretchEffectBehavior stretchEffectBehavior; | 
| Chris Craik | 2507c34 | 2015-05-04 14:36:49 -0700 | [diff] [blame] | 362 | static ProfileType sProfileType; | 
|  | 363 | static bool sDisableProfileBars; | 
| Stan Iliev | 03de074 | 2016-07-07 12:35:54 -0400 | [diff] [blame] | 364 | static RenderPipelineType sRenderPipelineType; | 
| John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 365 | };  // class Caches | 
| Chris Craik | 2507c34 | 2015-05-04 14:36:49 -0700 | [diff] [blame] | 366 |  | 
| Chris Blume | 7b8a808 | 2018-11-30 15:51:58 -0800 | [diff] [blame] | 367 | }  // namespace uirenderer | 
|  | 368 | }  // namespace android | 
| Romain Guy | e190aa6 | 2010-11-10 19:01:29 -0800 | [diff] [blame] | 369 |  | 
| John Reck | 1bcacfd | 2017-11-03 10:12:19 -0700 | [diff] [blame] | 370 | #endif  // ANDROID_HWUI_PROPERTIES_H |