Properties.h revision fe5e7b7346a54537b980796ceeca66bfdbd05561
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>
21e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guy#include <stdlib.h>
22fb8b763f762ae21923c58d64caa729b012f40e05Romain Guy
2351769a68a5cb34e9564740c6a854fcb93018789dRomain Guy/**
2451769a68a5cb34e9564740c6a854fcb93018789dRomain Guy * This file contains the list of system properties used to configure
2551769a68a5cb34e9564740c6a854fcb93018789dRomain Guy * the OpenGLRenderer.
2651769a68a5cb34e9564740c6a854fcb93018789dRomain Guy */
2751769a68a5cb34e9564740c6a854fcb93018789dRomain Guy
28cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy///////////////////////////////////////////////////////////////////////////////
29cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy// Compile-time properties
30cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy///////////////////////////////////////////////////////////////////////////////
31cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy
32726aeba80ffc6778a9bc3e0ee957b8d644183505Romain Guy// If turned on, text is interpreted as glyphs instead of UTF-16
33726aeba80ffc6778a9bc3e0ee957b8d644183505Romain Guy#define RENDER_TEXT_AS_GLYPHS 1
34726aeba80ffc6778a9bc3e0ee957b8d644183505Romain Guy
3528d8ff6dbcc1b137131c70b72b4dbd211db7fbd9Romain Guy// Indicates whether to remove the biggest layers first, or the smaller ones
3628d8ff6dbcc1b137131c70b72b4dbd211db7fbd9Romain Guy#define LAYER_REMOVE_BIGGEST_FIRST 0
3728d8ff6dbcc1b137131c70b72b4dbd211db7fbd9Romain Guy
3828d8ff6dbcc1b137131c70b72b4dbd211db7fbd9Romain Guy// Textures used by layers must have dimensions multiples of this number
3928d8ff6dbcc1b137131c70b72b4dbd211db7fbd9Romain Guy#define LAYER_SIZE 64
4028d8ff6dbcc1b137131c70b72b4dbd211db7fbd9Romain Guy
418d4aeb7111afac0c3c7e56d4ad5d92f9cfce2ffdRomain Guy// Defines the size in bits of the stencil buffer for the framebuffer
42ada4d53d50dc869b8278573ad640dc44118d3bcfRomain Guy// Note: Only 1 bit is required for clipping but more bits are required
438d4aeb7111afac0c3c7e56d4ad5d92f9cfce2ffdRomain Guy// to properly implement overdraw debugging
447c450aaa3caac2a05fcb20a177483d0e92378426Romain Guy#define STENCIL_BUFFER_SIZE 8
45530041d3191ce817832a0108514617768e43cda6Romain Guy
46cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy///////////////////////////////////////////////////////////////////////////////
47cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy// Debug properties
48cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy///////////////////////////////////////////////////////////////////////////////
49cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy
50e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guy/**
514ff0cf4b83605bff630c4e6f1fabe4f72a3f93a1Romain Guy * Debug level for app developers. The value is a numeric value defined
524ff0cf4b83605bff630c4e6f1fabe4f72a3f93a1Romain Guy * by the DebugLevel enum below.
53e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guy */
544ff0cf4b83605bff630c4e6f1fabe4f72a3f93a1Romain Guy#define PROPERTY_DEBUG "debug.hwui.level"
55e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guy
56e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guy/**
57e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guy * Debug levels. Debug levels are used as flags.
58e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guy */
59e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guyenum DebugLevel {
60e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guy    kDebugDisabled = 0,
61e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guy    kDebugMemory = 1,
6225dc3a7dbac2f90f5144035e9c8ed99c09cc3132Romain Guy    kDebugCaches = 2,
63042f7d64b5ccd7b5b73e7e9814a84576f04fb7d4Kenny Root    kDebugMoreCaches = kDebugMemory | kDebugCaches
64e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guy};
65e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guy
664ff0cf4b83605bff630c4e6f1fabe4f72a3f93a1Romain Guy/**
677c450aaa3caac2a05fcb20a177483d0e92378426Romain Guy * Used to enable/disable layers update debugging. The accepted values are
684ff0cf4b83605bff630c4e6f1fabe4f72a3f93a1Romain Guy * "true" and "false". The default value is "false".
694ff0cf4b83605bff630c4e6f1fabe4f72a3f93a1Romain Guy */
704ff0cf4b83605bff630c4e6f1fabe4f72a3f93a1Romain Guy#define PROPERTY_DEBUG_LAYERS_UPDATES "debug.hwui.show_layers_updates"
714ff0cf4b83605bff630c4e6f1fabe4f72a3f93a1Romain Guy
727c450aaa3caac2a05fcb20a177483d0e92378426Romain Guy/**
73627c6fd91377ead85f74a365438e25610ef1e2eeRomain Guy * Used to enable/disable overdraw debugging.
74627c6fd91377ead85f74a365438e25610ef1e2eeRomain Guy *
75627c6fd91377ead85f74a365438e25610ef1e2eeRomain Guy * The accepted values are
76627c6fd91377ead85f74a365438e25610ef1e2eeRomain Guy * "show", to show overdraw
77627c6fd91377ead85f74a365438e25610ef1e2eeRomain Guy * "show_deuteranomaly", to show overdraw if you suffer from Deuteranomaly
78627c6fd91377ead85f74a365438e25610ef1e2eeRomain Guy * "count", to show an overdraw counter
79627c6fd91377ead85f74a365438e25610ef1e2eeRomain Guy * "false", to disable overdraw debugging
80627c6fd91377ead85f74a365438e25610ef1e2eeRomain Guy *
81627c6fd91377ead85f74a365438e25610ef1e2eeRomain Guy * The default value is "false".
827c450aaa3caac2a05fcb20a177483d0e92378426Romain Guy */
8378dd96d5af20f489f0e8b288617d57774ec284f7Romain Guy#define PROPERTY_DEBUG_OVERDRAW "debug.hwui.overdraw"
847c450aaa3caac2a05fcb20a177483d0e92378426Romain Guy
8587e2f757be9b24d369bab354e37c276e851b1fc7Romain Guy/**
8631e08e953fe7bdb1b1cbc247156cb6a19917a2f1Romain Guy * Used to enable/disable PerfHUD ES profiling. The accepted values
8731e08e953fe7bdb1b1cbc247156cb6a19917a2f1Romain Guy * are "true" and "false". The default value is "false".
8831e08e953fe7bdb1b1cbc247156cb6a19917a2f1Romain Guy */
8931e08e953fe7bdb1b1cbc247156cb6a19917a2f1Romain Guy#define PROPERTY_DEBUG_NV_PROFILING "debug.hwui.nv_profiling"
9031e08e953fe7bdb1b1cbc247156cb6a19917a2f1Romain Guy
9131e08e953fe7bdb1b1cbc247156cb6a19917a2f1Romain Guy/**
92fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck *  System property used to enable or disable hardware rendering profiling.
93fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck * The default value of this property is assumed to be false.
94fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck *
95fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck * When profiling is enabled, the adb shell dumpsys gfxinfo command will
96fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck * output extra information about the time taken to execute by the last
97fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck * frames.
98fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck *
99fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck * Possible values:
100fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck * "true", to enable profiling
101fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck * "visual_bars", to enable profiling and visualize the results on screen
102fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck * "false", to disable profiling
103fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck */
104fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck#define PROPERTY_PROFILE "debug.hwui.profile"
105fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck#define PROPERTY_PROFILE_VISUALIZE_BARS "visual_bars"
106fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck
107fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck/**
108fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck * System property used to specify the number of frames to be used
109fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck * when doing hardware rendering profiling.
110fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck * The default value of this property is #PROFILE_MAX_FRAMES.
111fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck *
112fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck * When profiling is enabled, the adb shell dumpsys gfxinfo command will
113fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck * output extra information about the time taken to execute by the last
114fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck * frames.
115fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck *
116fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck * Possible values:
117fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck * "60", to set the limit of frames to 60
118fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck */
119fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck#define PROPERTY_PROFILE_MAXFRAMES "debug.hwui.profile.maxframes"
120fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck
121fe5e7b7346a54537b980796ceeca66bfdbd05561John Reck/**
1223ff0bfdd144bba3b023eda8c49b25fb0d0de8653Romain Guy * Used to enable/disable non-rectangular clipping debugging.
1233ff0bfdd144bba3b023eda8c49b25fb0d0de8653Romain Guy *
1243ff0bfdd144bba3b023eda8c49b25fb0d0de8653Romain Guy * The accepted values are:
1253ff0bfdd144bba3b023eda8c49b25fb0d0de8653Romain Guy * "highlight", drawing commands clipped by the stencil will
1263ff0bfdd144bba3b023eda8c49b25fb0d0de8653Romain Guy *              be colored differently
1273ff0bfdd144bba3b023eda8c49b25fb0d0de8653Romain Guy * "region", renders the clipping region on screen whenever
1283ff0bfdd144bba3b023eda8c49b25fb0d0de8653Romain Guy *           the stencil is set
1293ff0bfdd144bba3b023eda8c49b25fb0d0de8653Romain Guy * "hide", don't show the clip
1303ff0bfdd144bba3b023eda8c49b25fb0d0de8653Romain Guy *
1313ff0bfdd144bba3b023eda8c49b25fb0d0de8653Romain Guy * The default value is "hide".
1323ff0bfdd144bba3b023eda8c49b25fb0d0de8653Romain Guy */
13308bca88b272f0006e1581e9c28bc6312490f634eRomain Guy#define PROPERTY_DEBUG_STENCIL_CLIP "debug.hwui.show_non_rect_clip"
1343ff0bfdd144bba3b023eda8c49b25fb0d0de8653Romain Guy
1353ff0bfdd144bba3b023eda8c49b25fb0d0de8653Romain Guy/**
136cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy * Disables draw operation deferral if set to "true", forcing draw
137cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy * commands to be issued to OpenGL in order, and processed in sequence
138cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy * with state-manipulation canvas commands.
139cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy */
140cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy#define PROPERTY_DISABLE_DRAW_DEFER "debug.hwui.disable_draw_defer"
141cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy
142cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy/**
143cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy * Used to disable draw operation reordering when deferring draw operations
144cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy * Has no effect if PROPERTY_DISABLE_DRAW_DEFER is set to "true"
145cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy */
146cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy#define PROPERTY_DISABLE_DRAW_REORDER "debug.hwui.disable_draw_reorder"
147cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy
148cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy///////////////////////////////////////////////////////////////////////////////
149cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy// Runtime configuration properties
150cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy///////////////////////////////////////////////////////////////////////////////
151cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy
152cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy/**
15387e2f757be9b24d369bab354e37c276e851b1fc7Romain Guy * Used to enable/disable scissor optimization. The accepted values are
15487e2f757be9b24d369bab354e37c276e851b1fc7Romain Guy * "true" and "false". The default value is "false".
15587e2f757be9b24d369bab354e37c276e851b1fc7Romain Guy *
15687e2f757be9b24d369bab354e37c276e851b1fc7Romain Guy * When scissor optimization is enabled, OpenGLRenderer will attempt to
15787e2f757be9b24d369bab354e37c276e851b1fc7Romain Guy * minimize the use of scissor by selectively enabling and disabling the
15887e2f757be9b24d369bab354e37c276e851b1fc7Romain Guy * GL scissor test.
15987e2f757be9b24d369bab354e37c276e851b1fc7Romain Guy * When the optimization is disabled, OpenGLRenderer will keep the GL
16087e2f757be9b24d369bab354e37c276e851b1fc7Romain Guy * scissor test enabled and change the scissor rect as needed.
16187e2f757be9b24d369bab354e37c276e851b1fc7Romain Guy * Some GPUs (for instance the SGX 540) perform better when changing
16287e2f757be9b24d369bab354e37c276e851b1fc7Romain Guy * the scissor rect often than when enabling/disabling the scissor test
16387e2f757be9b24d369bab354e37c276e851b1fc7Romain Guy * often.
16487e2f757be9b24d369bab354e37c276e851b1fc7Romain Guy */
16587e2f757be9b24d369bab354e37c276e851b1fc7Romain Guy#define PROPERTY_DISABLE_SCISSOR_OPTIMIZATION "ro.hwui.disable_scissor_opt"
16687e2f757be9b24d369bab354e37c276e851b1fc7Romain Guy
167c3566d06421c8acc0aafb18f7e307e5725ce87e1Chris Craik/**
168cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy * Indicates whether PBOs can be used to back pixel buffers.
169f9f0016b1ff816eb2c7561eed482c056189005f8Romain Guy * Accepted values are "true" and "false". Default is true.
170c3566d06421c8acc0aafb18f7e307e5725ce87e1Chris Craik */
171f9f0016b1ff816eb2c7561eed482c056189005f8Romain Guy#define PROPERTY_ENABLE_GPU_PIXEL_BUFFERS "ro.hwui.use_gpu_pixel_buffers"
172c3566d06421c8acc0aafb18f7e307e5725ce87e1Chris Craik
17351769a68a5cb34e9564740c6a854fcb93018789dRomain Guy// These properties are defined in mega-bytes
17451769a68a5cb34e9564740c6a854fcb93018789dRomain Guy#define PROPERTY_TEXTURE_CACHE_SIZE "ro.hwui.texture_cache_size"
17551769a68a5cb34e9564740c6a854fcb93018789dRomain Guy#define PROPERTY_LAYER_CACHE_SIZE "ro.hwui.layer_cache_size"
1768d4aeb7111afac0c3c7e56d4ad5d92f9cfce2ffdRomain Guy#define PROPERTY_RENDER_BUFFER_CACHE_SIZE "ro.hwui.r_buffer_cache_size"
17751769a68a5cb34e9564740c6a854fcb93018789dRomain Guy#define PROPERTY_GRADIENT_CACHE_SIZE "ro.hwui.gradient_cache_size"
1787fbcc0492fca03857e3c45064f4aa040af817d55Romain Guy#define PROPERTY_PATH_CACHE_SIZE "ro.hwui.path_cache_size"
1793b748a44c6bd2ea05fe16839caf73dbe50bd7ae9Romain Guy#define PROPERTY_PATCH_CACHE_SIZE "ro.hwui.patch_cache_size"
1801e45aae5de003657e5d18f74d34998f5de5db5b7Romain Guy#define PROPERTY_DROP_SHADOW_CACHE_SIZE "ro.hwui.drop_shadow_cache_size"
181e2d345ea67e2960b37bfdc0fc8626d1bfa747404Romain Guy#define PROPERTY_FBO_CACHE_SIZE "ro.hwui.fbo_cache_size"
18251769a68a5cb34e9564740c6a854fcb93018789dRomain Guy
183eca0ca2424afc1e98912405906edfc32f7733e16Romain Guy// These properties are defined in percentage (range 0..1)
184115096f50a560e64a7f95d37686d4861042c7aebRomain Guy#define PROPERTY_TEXTURE_CACHE_FLUSH_RATE "ro.hwui.texture_cache_flushrate"
185eca0ca2424afc1e98912405906edfc32f7733e16Romain Guy
18651769a68a5cb34e9564740c6a854fcb93018789dRomain Guy// These properties are defined in pixels
187eb32a499194119b3783b86c925172df02e5d2685Chet Haase#define PROPERTY_TEXT_SMALL_CACHE_WIDTH "ro.hwui.text_small_cache_width"
188eb32a499194119b3783b86c925172df02e5d2685Chet Haase#define PROPERTY_TEXT_SMALL_CACHE_HEIGHT "ro.hwui.text_small_cache_height"
189eb32a499194119b3783b86c925172df02e5d2685Chet Haase#define PROPERTY_TEXT_LARGE_CACHE_WIDTH "ro.hwui.text_large_cache_width"
190eb32a499194119b3783b86c925172df02e5d2685Chet Haase#define PROPERTY_TEXT_LARGE_CACHE_HEIGHT "ro.hwui.text_large_cache_height"
19151769a68a5cb34e9564740c6a854fcb93018789dRomain Guy
192b1d0a4ed21168fefcb82232c8f22cb95d60acb85Romain Guy// Indicates whether gamma correction should be applied in the shaders
1936e25e38e43f9e7f71397dfab7ed32c81c7bf7d46Romain Guy// or in lookup tables. Accepted values:
1946e25e38e43f9e7f71397dfab7ed32c81c7bf7d46Romain Guy//
1956e25e38e43f9e7f71397dfab7ed32c81c7bf7d46Romain Guy//     - "lookup3", correction based on lookup tables. Gamma correction
1966e25e38e43f9e7f71397dfab7ed32c81c7bf7d46Romain Guy//        is different for black and white text (see thresholds below)
1976e25e38e43f9e7f71397dfab7ed32c81c7bf7d46Romain Guy//
1986e25e38e43f9e7f71397dfab7ed32c81c7bf7d46Romain Guy//     - "lookup", correction based on a single lookup table
1996e25e38e43f9e7f71397dfab7ed32c81c7bf7d46Romain Guy//
2006e25e38e43f9e7f71397dfab7ed32c81c7bf7d46Romain Guy//     - "shader3", correction applied by a GLSL shader. Gamma correction
2016e25e38e43f9e7f71397dfab7ed32c81c7bf7d46Romain Guy//        is different for black and white text (see thresholds below)
2026e25e38e43f9e7f71397dfab7ed32c81c7bf7d46Romain Guy//
2036e25e38e43f9e7f71397dfab7ed32c81c7bf7d46Romain Guy//     - "shader", correction applied by a GLSL shader
2046e25e38e43f9e7f71397dfab7ed32c81c7bf7d46Romain Guy//
2056e25e38e43f9e7f71397dfab7ed32c81c7bf7d46Romain Guy// See PROPERTY_TEXT_GAMMA, PROPERTY_TEXT_BLACK_GAMMA_THRESHOLD and
2066e25e38e43f9e7f71397dfab7ed32c81c7bf7d46Romain Guy// PROPERTY_TEXT_WHITE_GAMMA_THRESHOLD for more control.
207dfab50d8b97a90dca279b119ebe439f595616ffaRomain Guy#define PROPERTY_TEXT_GAMMA_METHOD "hwui.text_gamma_correction"
208dfab50d8b97a90dca279b119ebe439f595616ffaRomain Guy#define DEFAULT_TEXT_GAMMA_METHOD "lookup"
209b1d0a4ed21168fefcb82232c8f22cb95d60acb85Romain Guy
210b45c0c9774bd19a9dbe77d149abae4e124b08bf6Romain Guy// Gamma (>= 1.0, <= 10.0)
2116e25e38e43f9e7f71397dfab7ed32c81c7bf7d46Romain Guy#define PROPERTY_TEXT_GAMMA "hwui.text_gamma"
2126e25e38e43f9e7f71397dfab7ed32c81c7bf7d46Romain Guy// Luminance threshold below which black gamma correction is applied. Range: [0..255]
2136e25e38e43f9e7f71397dfab7ed32c81c7bf7d46Romain Guy#define PROPERTY_TEXT_BLACK_GAMMA_THRESHOLD "hwui.text_gamma.black_threshold"
2146e25e38e43f9e7f71397dfab7ed32c81c7bf7d46Romain Guy// Lumincance threshold above which white gamma correction is applied. Range: [0..255]
2156e25e38e43f9e7f71397dfab7ed32c81c7bf7d46Romain Guy#define PROPERTY_TEXT_WHITE_GAMMA_THRESHOLD "hwui.text_gamma.white_threshold"
216b45c0c9774bd19a9dbe77d149abae4e124b08bf6Romain Guy
217cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy///////////////////////////////////////////////////////////////////////////////
218cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy// Default property values
219cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy///////////////////////////////////////////////////////////////////////////////
220fb8b763f762ae21923c58d64caa729b012f40e05Romain Guy
22109b7c91de73b59aa3f679b3ae3ba299f82ec9f8aRomain Guy#define DEFAULT_TEXTURE_CACHE_SIZE 24.0f
22265b345fa22b878e141b8fd8ece9c208df00fa40fRomain Guy#define DEFAULT_LAYER_CACHE_SIZE 16.0f
2238d4aeb7111afac0c3c7e56d4ad5d92f9cfce2ffdRomain Guy#define DEFAULT_RENDER_BUFFER_CACHE_SIZE 2.0f
224c46d07a29e94807e768f8b162ce9f77a88ba6f46Romain Guy#define DEFAULT_PATH_CACHE_SIZE 10.0f
2253b748a44c6bd2ea05fe16839caf73dbe50bd7ae9Romain Guy#define DEFAULT_PATCH_CACHE_SIZE 128 // in kB
226fb8b763f762ae21923c58d64caa729b012f40e05Romain Guy#define DEFAULT_GRADIENT_CACHE_SIZE 0.5f
227fb8b763f762ae21923c58d64caa729b012f40e05Romain Guy#define DEFAULT_DROP_SHADOW_CACHE_SIZE 2.0f
22809b7c91de73b59aa3f679b3ae3ba299f82ec9f8aRomain Guy#define DEFAULT_FBO_CACHE_SIZE 16
229fb8b763f762ae21923c58d64caa729b012f40e05Romain Guy
230eca0ca2424afc1e98912405906edfc32f7733e16Romain Guy#define DEFAULT_TEXTURE_CACHE_FLUSH_RATE 0.6f
231eca0ca2424afc1e98912405906edfc32f7733e16Romain Guy
232b45c0c9774bd19a9dbe77d149abae4e124b08bf6Romain Guy#define DEFAULT_TEXT_GAMMA 1.4f
233b45c0c9774bd19a9dbe77d149abae4e124b08bf6Romain Guy#define DEFAULT_TEXT_BLACK_GAMMA_THRESHOLD 64
234b45c0c9774bd19a9dbe77d149abae4e124b08bf6Romain Guy#define DEFAULT_TEXT_WHITE_GAMMA_THRESHOLD 192
235b45c0c9774bd19a9dbe77d149abae4e124b08bf6Romain Guy
236cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy///////////////////////////////////////////////////////////////////////////////
237cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy// Misc
238cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy///////////////////////////////////////////////////////////////////////////////
239cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy
240cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy// Converts a number of mega-bytes into bytes
241cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy#define MB(s) s * 1024 * 1024
2423b748a44c6bd2ea05fe16839caf73dbe50bd7ae9Romain Guy// Converts a number of kilo-bytes into bytes
2433b748a44c6bd2ea05fe16839caf73dbe50bd7ae9Romain Guy#define KB(s) s * 1024
244cf51a4199835e9604aa4c8b3854306f8fbabbf33Romain Guy
245e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guystatic DebugLevel readDebugLevel() {
246e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guy    char property[PROPERTY_VALUE_MAX];
247e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guy    if (property_get(PROPERTY_DEBUG, property, NULL) > 0) {
248e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guy        return (DebugLevel) atoi(property);
249e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guy    }
250e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guy    return kDebugDisabled;
251e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guy}
252e190aa69756aecfaffabdd4c6d32cb6b3220d842Romain Guy
2535b3b35296e8b2c8d3f07d32bb645d5414db41a1dRomain Guy#endif // ANDROID_HWUI_PROPERTIES_H
254