151769a68a5cb34e9564740c6a854fcb93018789dRomain Guy/*
251769a68a5cb34e9564740c6a854fcb93018789dRomain Guy * Copyright (C) 2010 The Android Open Source Project
351769a68a5cb34e9564740c6a854fcb93018789dRomain Guy *
451769a68a5cb34e9564740c6a854fcb93018789dRomain Guy * Licensed under the Apache License, Version 2.0 (the "License");
551769a68a5cb34e9564740c6a854fcb93018789dRomain Guy * you may not use this file except in compliance with the License.
651769a68a5cb34e9564740c6a854fcb93018789dRomain Guy * You may obtain a copy of the License at
751769a68a5cb34e9564740c6a854fcb93018789dRomain Guy *
851769a68a5cb34e9564740c6a854fcb93018789dRomain Guy *      http://www.apache.org/licenses/LICENSE-2.0
951769a68a5cb34e9564740c6a854fcb93018789dRomain Guy *
1051769a68a5cb34e9564740c6a854fcb93018789dRomain Guy * Unless required by applicable law or agreed to in writing, software
1151769a68a5cb34e9564740c6a854fcb93018789dRomain Guy * distributed under the License is distributed on an "AS IS" BASIS,
1251769a68a5cb34e9564740c6a854fcb93018789dRomain Guy * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1351769a68a5cb34e9564740c6a854fcb93018789dRomain Guy * See the License for the specific language governing permissions and
1451769a68a5cb34e9564740c6a854fcb93018789dRomain Guy * limitations under the License.
1551769a68a5cb34e9564740c6a854fcb93018789dRomain Guy */
1651769a68a5cb34e9564740c6a854fcb93018789dRomain Guy
175b3b35296e8b2c8d3f07d32bb645d5414db41a1dRomain Guy#ifndef ANDROID_HWUI_PROPERTIES_H
185b3b35296e8b2c8d3f07d32bb645d5414db41a1dRomain Guy#define ANDROID_HWUI_PROPERTIES_H
1951769a68a5cb34e9564740c6a854fcb93018789dRomain Guy
20fb8b763f762ae21923c58d64caa729b012f40e05Romain Guy#include <cutils/properties.h>
21fb8b763f762ae21923c58d64caa729b012f40e05Romain Guy
2251769a68a5cb34e9564740c6a854fcb93018789dRomain Guy/**
2351769a68a5cb34e9564740c6a854fcb93018789dRomain Guy * This file contains the list of system properties used to configure
2451769a68a5cb34e9564740c6a854fcb93018789dRomain Guy * the OpenGLRenderer.
2551769a68a5cb34e9564740c6a854fcb93018789dRomain Guy */
2651769a68a5cb34e9564740c6a854fcb93018789dRomain Guy
272507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craiknamespace android {
282507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craiknamespace uirenderer {
292507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik
30cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy///////////////////////////////////////////////////////////////////////////////
31cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy// Compile-time properties
32cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy///////////////////////////////////////////////////////////////////////////////
33cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy
3428d8ff6dbcc1b137131c70b72b4dbd211db7fbd9Romain Guy// Textures used by layers must have dimensions multiples of this number
3528d8ff6dbcc1b137131c70b72b4dbd211db7fbd9Romain Guy#define LAYER_SIZE 64
3628d8ff6dbcc1b137131c70b72b4dbd211db7fbd9Romain Guy
378d4aeb7111afac0c3c7e56d4ad5d92f9cfce2ffdRomain Guy// Defines the size in bits of the stencil buffer for the framebuffer
38ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy// Note: Only 1 bit is required for clipping but more bits are required
398d4aeb7111afac0c3c7e56d4ad5d92f9cfce2ffdRomain Guy// to properly implement overdraw debugging
407c450aaa3caac2a05fcb20a177483d0e92378426Romain Guy#define STENCIL_BUFFER_SIZE 8
41530041d3191ce817832a0108514617768e43cda6Romain Guy
42cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy///////////////////////////////////////////////////////////////////////////////
43cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy// Debug properties
44cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy///////////////////////////////////////////////////////////////////////////////
45cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy
46e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guy/**
474ff0cf4b83605bff630c4e6f1fabe4f72a3f93a1Romain Guy * Debug level for app developers. The value is a numeric value defined
484ff0cf4b83605bff630c4e6f1fabe4f72a3f93a1Romain Guy * by the DebugLevel enum below.
49e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guy */
504ff0cf4b83605bff630c4e6f1fabe4f72a3f93a1Romain Guy#define PROPERTY_DEBUG "debug.hwui.level"
51e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guy
52e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guy/**
53e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guy * Debug levels. Debug levels are used as flags.
54e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guy */
55e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guyenum DebugLevel {
56e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guy    kDebugDisabled = 0,
57e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guy    kDebugMemory = 1,
5825dc3a7dbac2f90f5144035e9c8ed99c09cc3132Romain Guy    kDebugCaches = 2,
59042f7d64b5ccd7b5b73e7e9814a84576f04fb7d4Kenny Root    kDebugMoreCaches = kDebugMemory | kDebugCaches
60e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guy};
61e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guy
624ff0cf4b83605bff630c4e6f1fabe4f72a3f93a1Romain Guy/**
637c450aaa3caac2a05fcb20a177483d0e92378426Romain Guy * Used to enable/disable layers update debugging. The accepted values are
644ff0cf4b83605bff630c4e6f1fabe4f72a3f93a1Romain Guy * "true" and "false". The default value is "false".
654ff0cf4b83605bff630c4e6f1fabe4f72a3f93a1Romain Guy */
664ff0cf4b83605bff630c4e6f1fabe4f72a3f93a1Romain Guy#define PROPERTY_DEBUG_LAYERS_UPDATES "debug.hwui.show_layers_updates"
674ff0cf4b83605bff630c4e6f1fabe4f72a3f93a1Romain Guy
687c450aaa3caac2a05fcb20a177483d0e92378426Romain Guy/**
69627c6fd91377ead85f74a365438e25610ef1e2eeRomain Guy * Used to enable/disable overdraw debugging.
70627c6fd91377ead85f74a365438e25610ef1e2eeRomain Guy *
71627c6fd91377ead85f74a365438e25610ef1e2eeRomain Guy * The accepted values are
72627c6fd91377ead85f74a365438e25610ef1e2eeRomain Guy * "show", to show overdraw
73627c6fd91377ead85f74a365438e25610ef1e2eeRomain Guy * "show_deuteranomaly", to show overdraw if you suffer from Deuteranomaly
74627c6fd91377ead85f74a365438e25610ef1e2eeRomain Guy * "count", to show an overdraw counter
75627c6fd91377ead85f74a365438e25610ef1e2eeRomain Guy * "false", to disable overdraw debugging
76627c6fd91377ead85f74a365438e25610ef1e2eeRomain Guy *
77627c6fd91377ead85f74a365438e25610ef1e2eeRomain Guy * The default value is "false".
787c450aaa3caac2a05fcb20a177483d0e92378426Romain Guy */
7978dd96d5af20f489f0e8b288617d57774ec284f7Romain Guy#define PROPERTY_DEBUG_OVERDRAW "debug.hwui.overdraw"
807c450aaa3caac2a05fcb20a177483d0e92378426Romain Guy
8187e2f757be9b24d369bab354e37c276e851b1fc7Romain Guy/**
82fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck *  System property used to enable or disable hardware rendering profiling.
83fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck * The default value of this property is assumed to be false.
84fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck *
85fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck * When profiling is enabled, the adb shell dumpsys gfxinfo command will
86fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck * output extra information about the time taken to execute by the last
87fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck * frames.
88fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck *
89fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck * Possible values:
90fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck * "true", to enable profiling
91fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck * "visual_bars", to enable profiling and visualize the results on screen
92fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck * "false", to disable profiling
93fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck */
94fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck#define PROPERTY_PROFILE "debug.hwui.profile"
95fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck#define PROPERTY_PROFILE_VISUALIZE_BARS "visual_bars"
96fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck
97fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck/**
983ff0bfdd144bba3b023eda8c49b25fb0d0de8653Romain Guy * Used to enable/disable non-rectangular clipping debugging.
993ff0bfdd144bba3b023eda8c49b25fb0d0de8653Romain Guy *
1003ff0bfdd144bba3b023eda8c49b25fb0d0de8653Romain Guy * The accepted values are:
1013ff0bfdd144bba3b023eda8c49b25fb0d0de8653Romain Guy * "highlight", drawing commands clipped by the stencil will
1023ff0bfdd144bba3b023eda8c49b25fb0d0de8653Romain Guy *              be colored differently
1033ff0bfdd144bba3b023eda8c49b25fb0d0de8653Romain Guy * "region", renders the clipping region on screen whenever
1043ff0bfdd144bba3b023eda8c49b25fb0d0de8653Romain Guy *           the stencil is set
1053ff0bfdd144bba3b023eda8c49b25fb0d0de8653Romain Guy * "hide", don't show the clip
1063ff0bfdd144bba3b023eda8c49b25fb0d0de8653Romain Guy *
1073ff0bfdd144bba3b023eda8c49b25fb0d0de8653Romain Guy * The default value is "hide".
1083ff0bfdd144bba3b023eda8c49b25fb0d0de8653Romain Guy */
10908bca88b272f0006e1581e9c28bc6312490f634eRomain Guy#define PROPERTY_DEBUG_STENCIL_CLIP "debug.hwui.show_non_rect_clip"
1103ff0bfdd144bba3b023eda8c49b25fb0d0de8653Romain Guy
1113ff0bfdd144bba3b023eda8c49b25fb0d0de8653Romain Guy/**
11223d307c8d88f4a3849163b9e5b7cd11d0d4f372cJohn Reck * Turn on to draw dirty regions every other frame.
11323d307c8d88f4a3849163b9e5b7cd11d0d4f372cJohn Reck *
11423d307c8d88f4a3849163b9e5b7cd11d0d4f372cJohn Reck * Possible values:
11523d307c8d88f4a3849163b9e5b7cd11d0d4f372cJohn Reck * "true", to enable dirty regions debugging
11623d307c8d88f4a3849163b9e5b7cd11d0d4f372cJohn Reck * "false", to disable dirty regions debugging
11723d307c8d88f4a3849163b9e5b7cd11d0d4f372cJohn Reck */
11823d307c8d88f4a3849163b9e5b7cd11d0d4f372cJohn Reck#define PROPERTY_DEBUG_SHOW_DIRTY_REGIONS "debug.hwui.show_dirty_regions"
11923d307c8d88f4a3849163b9e5b7cd11d0d4f372cJohn Reck
12023d307c8d88f4a3849163b9e5b7cd11d0d4f372cJohn Reck/**
121cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy * Disables draw operation deferral if set to "true", forcing draw
122cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy * commands to be issued to OpenGL in order, and processed in sequence
123cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy * with state-manipulation canvas commands.
124cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy */
125cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy#define PROPERTY_DISABLE_DRAW_DEFER "debug.hwui.disable_draw_defer"
126cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy
127cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy/**
128cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy * Used to disable draw operation reordering when deferring draw operations
129cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy * Has no effect if PROPERTY_DISABLE_DRAW_DEFER is set to "true"
130cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy */
131cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy#define PROPERTY_DISABLE_DRAW_REORDER "debug.hwui.disable_draw_reorder"
132cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy
133d04794a9a3f9edc8b7ca336175d66eb81a8f55faJohn Reck/**
134d04794a9a3f9edc8b7ca336175d66eb81a8f55faJohn Reck * Setting this property will enable or disable the dropping of frames with
135d04794a9a3f9edc8b7ca336175d66eb81a8f55faJohn Reck * empty damage. Default is "true".
136d04794a9a3f9edc8b7ca336175d66eb81a8f55faJohn Reck */
137d04794a9a3f9edc8b7ca336175d66eb81a8f55faJohn Reck#define PROPERTY_SKIP_EMPTY_DAMAGE "debug.hwui.skip_empty_damage"
138d04794a9a3f9edc8b7ca336175d66eb81a8f55faJohn Reck
139d04794a9a3f9edc8b7ca336175d66eb81a8f55faJohn Reck/**
140149173d28c0843aba86b0810ce75b34be6a0d08fJohn Reck * Controls whether or not HWUI will use the EGL_EXT_buffer_age extension
141149173d28c0843aba86b0810ce75b34be6a0d08fJohn Reck * to do partial invalidates. Setting this to "false" will fall back to
142149173d28c0843aba86b0810ce75b34be6a0d08fJohn Reck * using BUFFER_PRESERVED instead
143149173d28c0843aba86b0810ce75b34be6a0d08fJohn Reck * Default is "true"
144149173d28c0843aba86b0810ce75b34be6a0d08fJohn Reck */
145149173d28c0843aba86b0810ce75b34be6a0d08fJohn Reck#define PROPERTY_USE_BUFFER_AGE "debug.hwui.use_buffer_age"
146149173d28c0843aba86b0810ce75b34be6a0d08fJohn Reck
147149173d28c0843aba86b0810ce75b34be6a0d08fJohn Reck/**
148149173d28c0843aba86b0810ce75b34be6a0d08fJohn Reck * Setting this to "false" will force HWUI to always do full-redraws of the surface.
149149173d28c0843aba86b0810ce75b34be6a0d08fJohn Reck * This will disable the use of EGL_EXT_buffer_age and BUFFER_PRESERVED.
150149173d28c0843aba86b0810ce75b34be6a0d08fJohn Reck * Default is "true"
151149173d28c0843aba86b0810ce75b34be6a0d08fJohn Reck */
152149173d28c0843aba86b0810ce75b34be6a0d08fJohn Reck#define PROPERTY_ENABLE_PARTIAL_UPDATES "debug.hwui.enable_partial_updates"
153149173d28c0843aba86b0810ce75b34be6a0d08fJohn Reck
154c7cd9cf25d9775446ffcb6b5f20b0a4c1e3c99c5John Reck#define PROPERTY_FILTER_TEST_OVERHEAD "debug.hwui.filter_test_overhead"
155c7cd9cf25d9775446ffcb6b5f20b0a4c1e3c99c5John Reck
156cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy///////////////////////////////////////////////////////////////////////////////
157cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy// Runtime configuration properties
158cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy///////////////////////////////////////////////////////////////////////////////
159cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy
160cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy/**
16187e2f757be9b24d369bab354e37c276e851b1fc7Romain Guy * Used to enable/disable scissor optimization. The accepted values are
16287e2f757be9b24d369bab354e37c276e851b1fc7Romain Guy * "true" and "false". The default value is "false".
16387e2f757be9b24d369bab354e37c276e851b1fc7Romain Guy *
16487e2f757be9b24d369bab354e37c276e851b1fc7Romain Guy * When scissor optimization is enabled, OpenGLRenderer will attempt to
16587e2f757be9b24d369bab354e37c276e851b1fc7Romain Guy * minimize the use of scissor by selectively enabling and disabling the
16687e2f757be9b24d369bab354e37c276e851b1fc7Romain Guy * GL scissor test.
16787e2f757be9b24d369bab354e37c276e851b1fc7Romain Guy * When the optimization is disabled, OpenGLRenderer will keep the GL
16887e2f757be9b24d369bab354e37c276e851b1fc7Romain Guy * scissor test enabled and change the scissor rect as needed.
16987e2f757be9b24d369bab354e37c276e851b1fc7Romain Guy * Some GPUs (for instance the SGX 540) perform better when changing
17087e2f757be9b24d369bab354e37c276e851b1fc7Romain Guy * the scissor rect often than when enabling/disabling the scissor test
17187e2f757be9b24d369bab354e37c276e851b1fc7Romain Guy * often.
17287e2f757be9b24d369bab354e37c276e851b1fc7Romain Guy */
17387e2f757be9b24d369bab354e37c276e851b1fc7Romain Guy#define PROPERTY_DISABLE_SCISSOR_OPTIMIZATION "ro.hwui.disable_scissor_opt"
17487e2f757be9b24d369bab354e37c276e851b1fc7Romain Guy
175c3566d06421c8acc0aafb18f7e307e5725ce87e1Chris Craik/**
176cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy * Indicates whether PBOs can be used to back pixel buffers.
177f9f0016b1ff816eb2c7561eed482c056189005f8Romain Guy * Accepted values are "true" and "false". Default is true.
178c3566d06421c8acc0aafb18f7e307e5725ce87e1Chris Craik */
179f9f0016b1ff816eb2c7561eed482c056189005f8Romain Guy#define PROPERTY_ENABLE_GPU_PIXEL_BUFFERS "ro.hwui.use_gpu_pixel_buffers"
180c3566d06421c8acc0aafb18f7e307e5725ce87e1Chris Craik
18151769a68a5cb34e9564740c6a854fcb93018789dRomain Guy// These properties are defined in mega-bytes
18251769a68a5cb34e9564740c6a854fcb93018789dRomain Guy#define PROPERTY_TEXTURE_CACHE_SIZE "ro.hwui.texture_cache_size"
18351769a68a5cb34e9564740c6a854fcb93018789dRomain Guy#define PROPERTY_LAYER_CACHE_SIZE "ro.hwui.layer_cache_size"
1848d4aeb7111afac0c3c7e56d4ad5d92f9cfce2ffdRomain Guy#define PROPERTY_RENDER_BUFFER_CACHE_SIZE "ro.hwui.r_buffer_cache_size"
18551769a68a5cb34e9564740c6a854fcb93018789dRomain Guy#define PROPERTY_GRADIENT_CACHE_SIZE "ro.hwui.gradient_cache_size"
1867fbcc0492fca03857e3c45064f4aa040af817d55Romain Guy#define PROPERTY_PATH_CACHE_SIZE "ro.hwui.path_cache_size"
18705f3d6e5111fd08df5cd9aae2c3d28399dc0e7f5Chris Craik#define PROPERTY_VERTEX_CACHE_SIZE "ro.hwui.vertex_cache_size"
1883b748a44c6bd2ea05fe16839caf73dbe50bd7ae9Romain Guy#define PROPERTY_PATCH_CACHE_SIZE "ro.hwui.patch_cache_size"
1891e45aae5de003657e5d18f74d34998f5de5db5b7Romain Guy#define PROPERTY_DROP_SHADOW_CACHE_SIZE "ro.hwui.drop_shadow_cache_size"
190e2d345ea67e2960b37bfdc0fc8626d1bfa747404Romain Guy#define PROPERTY_FBO_CACHE_SIZE "ro.hwui.fbo_cache_size"
19151769a68a5cb34e9564740c6a854fcb93018789dRomain Guy
192eca0ca2424afc1e98912405906edfc32f7733e16Romain Guy// These properties are defined in percentage (range 0..1)
193115096f50a560e64a7f95d37686d4861042c7aebRomain Guy#define PROPERTY_TEXTURE_CACHE_FLUSH_RATE "ro.hwui.texture_cache_flushrate"
194eca0ca2424afc1e98912405906edfc32f7733e16Romain Guy
19551769a68a5cb34e9564740c6a854fcb93018789dRomain Guy// These properties are defined in pixels
196eb32a499194119b3783b86c925172df02e5d2685Chet Haase#define PROPERTY_TEXT_SMALL_CACHE_WIDTH "ro.hwui.text_small_cache_width"
197eb32a499194119b3783b86c925172df02e5d2685Chet Haase#define PROPERTY_TEXT_SMALL_CACHE_HEIGHT "ro.hwui.text_small_cache_height"
198eb32a499194119b3783b86c925172df02e5d2685Chet Haase#define PROPERTY_TEXT_LARGE_CACHE_WIDTH "ro.hwui.text_large_cache_width"
199eb32a499194119b3783b86c925172df02e5d2685Chet Haase#define PROPERTY_TEXT_LARGE_CACHE_HEIGHT "ro.hwui.text_large_cache_height"
20051769a68a5cb34e9564740c6a854fcb93018789dRomain Guy
201b45c0c9774bd19a9dbe77d149abae4e124b08bf6Romain Guy// Gamma (>= 1.0, <= 10.0)
2026e25e38e43f9e7f71397dfab7ed32c81c7bf7d46Romain Guy#define PROPERTY_TEXT_GAMMA "hwui.text_gamma"
203b45c0c9774bd19a9dbe77d149abae4e124b08bf6Romain Guy
204cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy///////////////////////////////////////////////////////////////////////////////
205cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy// Default property values
206cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy///////////////////////////////////////////////////////////////////////////////
207fb8b763f762ae21923c58d64caa729b012f40e05Romain Guy
20809b7c91de73b59aa3f679b3ae3ba299f82ec9f8aRomain Guy#define DEFAULT_TEXTURE_CACHE_SIZE 24.0f
20965b345fa22b878e141b8fd8ece9c208df00fa40fRomain Guy#define DEFAULT_LAYER_CACHE_SIZE 16.0f
2108d4aeb7111afac0c3c7e56d4ad5d92f9cfce2ffdRomain Guy#define DEFAULT_RENDER_BUFFER_CACHE_SIZE 2.0f
2118d34aaff3cda45626be697f5f334a46fc053b273Chris Craik#define DEFAULT_PATH_CACHE_SIZE 4.0f
21205f3d6e5111fd08df5cd9aae2c3d28399dc0e7f5Chris Craik#define DEFAULT_VERTEX_CACHE_SIZE 1.0f
21311718bc17bcfc56dfb9f4362eebf640b025c4415Chris Craik#define DEFAULT_PATCH_CACHE_SIZE 128.0f // in kB
214fb8b763f762ae21923c58d64caa729b012f40e05Romain Guy#define DEFAULT_GRADIENT_CACHE_SIZE 0.5f
215fb8b763f762ae21923c58d64caa729b012f40e05Romain Guy#define DEFAULT_DROP_SHADOW_CACHE_SIZE 2.0f
216e9cd97ee88e6628897e878889d3920857e9c118aJohn Reck#define DEFAULT_FBO_CACHE_SIZE 0
217fb8b763f762ae21923c58d64caa729b012f40e05Romain Guy
218eca0ca2424afc1e98912405906edfc32f7733e16Romain Guy#define DEFAULT_TEXTURE_CACHE_FLUSH_RATE 0.6f
219eca0ca2424afc1e98912405906edfc32f7733e16Romain Guy
220b45c0c9774bd19a9dbe77d149abae4e124b08bf6Romain Guy#define DEFAULT_TEXT_GAMMA 1.4f
221b45c0c9774bd19a9dbe77d149abae4e124b08bf6Romain Guy
222cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy///////////////////////////////////////////////////////////////////////////////
223cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy// Misc
224cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy///////////////////////////////////////////////////////////////////////////////
225cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy
226cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy// Converts a number of mega-bytes into bytes
227cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy#define MB(s) s * 1024 * 1024
2283b748a44c6bd2ea05fe16839caf73dbe50bd7ae9Romain Guy// Converts a number of kilo-bytes into bytes
2293b748a44c6bd2ea05fe16839caf73dbe50bd7ae9Romain Guy#define KB(s) s * 1024
230cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy
2312507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craikenum class ProfileType {
2322507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik    None,
2332507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik    Console,
2342507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik    Bars
2352507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik};
2362507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik
2372507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craikenum class OverdrawColorSet {
2382507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik    Default = 0,
2392507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik    Deuteranomaly
2402507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik};
2412507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik
2422507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craikenum class StencilClipDebug {
2432507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik    Hide,
2442507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik    ShowHighlight,
2452507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik    ShowRegion
2462507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik};
2472507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik
2482507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik/**
2492507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik * Renderthread-only singleton which manages several static rendering properties. Most of these
2502507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik * are driven by system properties which are queried once at initialization, and again if init()
2512507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik * is called.
2522507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik */
2532507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craikclass Properties {
2542507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craikpublic:
2552507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik    static bool load();
2562507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik
2572507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik    static bool drawDeferDisabled;
2582507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik    static bool drawReorderDisabled;
2592507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik    static bool debugLayersUpdates;
2602507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik    static bool debugOverdraw;
2612507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik    static bool showDirtyRegions;
262d04794a9a3f9edc8b7ca336175d66eb81a8f55faJohn Reck    // TODO: Remove after stabilization period
263d04794a9a3f9edc8b7ca336175d66eb81a8f55faJohn Reck    static bool skipEmptyFrames;
264149173d28c0843aba86b0810ce75b34be6a0d08fJohn Reck    static bool useBufferAge;
265149173d28c0843aba86b0810ce75b34be6a0d08fJohn Reck    static bool enablePartialUpdates;
2662507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik
267c08820f587ad94698691a6657e87712de07e484cChris Craik    static float textGamma;
268c08820f587ad94698691a6657e87712de07e484cChris Craik
26948a8f431fa52ae2ee25ffba9d20676f03bb710ffChris Craik    static int fboCacheSize;
27048a8f431fa52ae2ee25ffba9d20676f03bb710ffChris Craik    static int gradientCacheSize;
2719fded232a9548a304e0145011df8849fba0dcda7Chris Craik    static int layerPoolSize;
27248a8f431fa52ae2ee25ffba9d20676f03bb710ffChris Craik    static int patchCacheSize;
27348a8f431fa52ae2ee25ffba9d20676f03bb710ffChris Craik    static int pathCacheSize;
27448a8f431fa52ae2ee25ffba9d20676f03bb710ffChris Craik    static int renderBufferCacheSize;
27548a8f431fa52ae2ee25ffba9d20676f03bb710ffChris Craik    static int tessellationCacheSize;
27648a8f431fa52ae2ee25ffba9d20676f03bb710ffChris Craik    static int textDropShadowCacheSize;
27748a8f431fa52ae2ee25ffba9d20676f03bb710ffChris Craik    static int textureCacheSize;
27848a8f431fa52ae2ee25ffba9d20676f03bb710ffChris Craik    static float textureCacheFlushRate;
2799fded232a9548a304e0145011df8849fba0dcda7Chris Craik
2802507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik    static DebugLevel debugLevel;
2812507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik    static OverdrawColorSet overdrawColorSet;
2822507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik    static StencilClipDebug debugStencilClip;
2832507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik
2842507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik    // Override the value for a subset of properties in this class
2852507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik    static void overrideProperty(const char* name, const char* value);
2862507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik
2872507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik    static float overrideLightRadius;
2882507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik    static float overrideLightPosY;
2892507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik    static float overrideLightPosZ;
2902507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik    static float overrideAmbientRatio;
2912507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik    static int overrideAmbientShadowStrength;
2922507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik    static int overrideSpotShadowStrength;
2932507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik
2942507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik    static ProfileType getProfileType();
2952507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik
296682573c84b7c21dc8ce4a2375da3961147442c4aJohn Reck    // Should be used only by test apps
297682573c84b7c21dc8ce4a2375da3961147442c4aJohn Reck    static bool waitForGpuCompletion;
298682573c84b7c21dc8ce4a2375da3961147442c4aJohn Reck
299c7cd9cf25d9775446ffcb6b5f20b0a4c1e3c99c5John Reck    // Should only be set by automated tests to try and filter out
300c7cd9cf25d9775446ffcb6b5f20b0a4c1e3c99c5John Reck    // any overhead they add
301c7cd9cf25d9775446ffcb6b5f20b0a4c1e3c99c5John Reck    static bool filterOutTestOverhead;
302c7cd9cf25d9775446ffcb6b5f20b0a4c1e3c99c5John Reck
3032507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craikprivate:
3042507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik    static ProfileType sProfileType;
3052507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik    static bool sDisableProfileBars;
3062507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik
3072507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik}; // class Caches
3082507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik
3092507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik}; // namespace uirenderer
3102507c34d91bb0d722b6012e85cb47387b2aa6873Chris Craik}; // namespace android
311e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guy
3125b3b35296e8b2c8d3f07d32bb645d5414db41a1dRomain Guy#endif // ANDROID_HWUI_PROPERTIES_H
313