2010-07-23 00:28:00 -07:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2010 The Android Open Source Project
|
|
|
|
*
|
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
|
|
|
*
|
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
*
|
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License.
|
|
|
|
*/
|
|
|
|
|
2010-10-27 18:57:51 -07:00
|
|
|
#ifndef ANDROID_HWUI_PROPERTIES_H
|
|
|
|
#define ANDROID_HWUI_PROPERTIES_H
|
2010-07-23 00:28:00 -07:00
|
|
|
|
2010-08-23 21:05:08 -07:00
|
|
|
#include <cutils/properties.h>
|
2010-11-10 19:01:29 -08:00
|
|
|
#include <stdlib.h>
|
2010-08-23 21:05:08 -07:00
|
|
|
|
2010-07-23 00:28:00 -07:00
|
|
|
/**
|
|
|
|
* This file contains the list of system properties used to configure
|
|
|
|
* the OpenGLRenderer.
|
|
|
|
*/
|
|
|
|
|
2010-12-03 16:48:20 -08:00
|
|
|
// If turned on, layers drawn inside FBOs are optimized with regions
|
2011-01-12 15:08:47 -08:00
|
|
|
#define RENDER_LAYERS_AS_REGIONS 1
|
2010-12-03 16:48:20 -08:00
|
|
|
|
2011-06-01 14:52:00 -07:00
|
|
|
// If turned on, text is interpreted as glyphs instead of UTF-16
|
|
|
|
#define RENDER_TEXT_AS_GLYPHS 1
|
|
|
|
|
2010-11-10 19:01:29 -08:00
|
|
|
/**
|
|
|
|
* Debug level for app developers.
|
|
|
|
*/
|
|
|
|
#define PROPERTY_DEBUG "hwui.debug_level"
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Debug levels. Debug levels are used as flags.
|
|
|
|
*/
|
|
|
|
enum DebugLevel {
|
|
|
|
kDebugDisabled = 0,
|
|
|
|
kDebugMemory = 1,
|
2010-12-10 12:33:05 -08:00
|
|
|
kDebugCaches = 2,
|
2011-07-13 09:49:43 -07:00
|
|
|
kDebugMoreCaches = kDebugMemory | kDebugCaches
|
2010-11-10 19:01:29 -08:00
|
|
|
};
|
|
|
|
|
2010-07-23 00:28:00 -07:00
|
|
|
// These properties are defined in mega-bytes
|
|
|
|
#define PROPERTY_TEXTURE_CACHE_SIZE "ro.hwui.texture_cache_size"
|
|
|
|
#define PROPERTY_LAYER_CACHE_SIZE "ro.hwui.layer_cache_size"
|
|
|
|
#define PROPERTY_GRADIENT_CACHE_SIZE "ro.hwui.gradient_cache_size"
|
2010-08-04 15:40:07 -07:00
|
|
|
#define PROPERTY_PATH_CACHE_SIZE "ro.hwui.path_cache_size"
|
2011-01-19 21:54:02 -08:00
|
|
|
#define PROPERTY_SHAPE_CACHE_SIZE "ro.hwui.shape_cache_size"
|
2010-08-13 19:39:53 -07:00
|
|
|
#define PROPERTY_DROP_SHADOW_CACHE_SIZE "ro.hwui.drop_shadow_cache_size"
|
2010-09-24 18:39:22 -07:00
|
|
|
#define PROPERTY_FBO_CACHE_SIZE "ro.hwui.fbo_cache_size"
|
2010-07-23 00:28:00 -07:00
|
|
|
|
|
|
|
// These properties are defined in pixels
|
|
|
|
#define PROPERTY_TEXT_CACHE_WIDTH "ro.hwui.text_cache_width"
|
|
|
|
#define PROPERTY_TEXT_CACHE_HEIGHT "ro.hwui.text_cache_height"
|
|
|
|
|
2010-08-26 20:35:23 -07:00
|
|
|
// Gamma (>= 1.0, <= 10.0)
|
|
|
|
#define PROPERTY_TEXT_GAMMA "ro.text_gamma"
|
|
|
|
#define PROPERTY_TEXT_BLACK_GAMMA_THRESHOLD "ro.text_gamma.black_threshold"
|
|
|
|
#define PROPERTY_TEXT_WHITE_GAMMA_THRESHOLD "ro.text_gamma.white_threshold"
|
|
|
|
|
2010-08-23 21:05:08 -07:00
|
|
|
// Converts a number of mega-bytes into bytes
|
|
|
|
#define MB(s) s * 1024 * 1024
|
|
|
|
|
2011-02-02 20:28:09 -08:00
|
|
|
#define DEFAULT_TEXTURE_CACHE_SIZE 24.0f
|
2011-07-27 18:51:50 -07:00
|
|
|
#define DEFAULT_LAYER_CACHE_SIZE 16.0f
|
2010-10-08 15:49:53 -07:00
|
|
|
#define DEFAULT_PATH_CACHE_SIZE 4.0f
|
2011-01-19 21:54:02 -08:00
|
|
|
#define DEFAULT_SHAPE_CACHE_SIZE 1.0f
|
2010-10-08 18:36:15 -07:00
|
|
|
#define DEFAULT_PATCH_CACHE_SIZE 512
|
2010-08-23 21:05:08 -07:00
|
|
|
#define DEFAULT_GRADIENT_CACHE_SIZE 0.5f
|
|
|
|
#define DEFAULT_DROP_SHADOW_CACHE_SIZE 2.0f
|
2011-02-02 20:28:09 -08:00
|
|
|
#define DEFAULT_FBO_CACHE_SIZE 16
|
2010-08-23 21:05:08 -07:00
|
|
|
|
2010-08-26 20:35:23 -07:00
|
|
|
#define DEFAULT_TEXT_GAMMA 1.4f
|
|
|
|
#define DEFAULT_TEXT_BLACK_GAMMA_THRESHOLD 64
|
|
|
|
#define DEFAULT_TEXT_WHITE_GAMMA_THRESHOLD 192
|
|
|
|
|
2010-11-10 19:01:29 -08:00
|
|
|
static DebugLevel readDebugLevel() {
|
|
|
|
char property[PROPERTY_VALUE_MAX];
|
|
|
|
if (property_get(PROPERTY_DEBUG, property, NULL) > 0) {
|
|
|
|
return (DebugLevel) atoi(property);
|
|
|
|
}
|
|
|
|
return kDebugDisabled;
|
|
|
|
}
|
|
|
|
|
2010-10-27 18:57:51 -07:00
|
|
|
#endif // ANDROID_HWUI_PROPERTIES_H
|