blob: 9b1ba69a53779a38fbbf369efd504fd263a44f81 [file] [log] [blame]
Romain Guyc15008e2010-11-10 11:59:15 -08001/*
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
17#ifndef ANDROID_HWUI_DEBUG_H
18#define ANDROID_HWUI_DEBUG_H
19
John Reck975591a2016-01-22 16:28:07 -080020#define DEBUG_LEVEL_HIGH 3
21#define DEBUG_LEVEL_MODERATE 2
22#define DEBUG_LEVEL_LOW 1
23#define DEBUG_LEVEL_NONE 0
24
Romain Guyc15008e2010-11-10 11:59:15 -080025// Turn on to check for OpenGL errors on each frame
John Reck975591a2016-01-22 16:28:07 -080026// Note DEBUG_LEVEL_HIGH for DEBUG_OPENGL is only setable by enabling
27// HWUI_ENABLE_OPENGL_VALIDATION when building HWUI. Similarly if
28// HWUI_ENABLE_OPENGL_VALIDATION is set then this is always DEBUG_LEVEL_HIGH
29#ifndef DEBUG_OPENGL
30#define DEBUG_OPENGL DEBUG_LEVEL_LOW
31#endif
Romain Guyc15008e2010-11-10 11:59:15 -080032
Romain Guyc9855a52011-01-21 21:14:15 -080033// Turn on to enable initialization information
34#define DEBUG_INIT 0
35
Romain Guyc15008e2010-11-10 11:59:15 -080036// Turn on to enable memory usage summary on each frame
37#define DEBUG_MEMORY_USAGE 0
38
Romain Guybdf76092011-07-18 15:00:43 -070039// Turn on to enable debugging of cache flushes
Romain Guy9c10ab02012-02-22 14:34:58 -080040#define DEBUG_CACHE_FLUSH 0
Romain Guybdf76092011-07-18 15:00:43 -070041
Romain Guyaaceeb02011-03-23 19:56:13 -070042// Turn on to enable layers debugging when rendered as regions
Romain Guyc15008e2010-11-10 11:59:15 -080043#define DEBUG_LAYERS_AS_REGIONS 0
44
Romain Guy735738c2012-12-03 12:34:51 -080045// Turn on to enable debugging when the clip is not a rect
46#define DEBUG_CLIP_REGIONS 0
47
Romain Guyc15008e2010-11-10 11:59:15 -080048// Turn on to display debug info about vertex/fragment shaders
49#define DEBUG_PROGRAMS 0
50
51// Turn on to display info about layers
52#define DEBUG_LAYERS 0
53
Romain Guy8d4aeb72013-02-12 16:08:55 -080054// Turn on to display info about render buffers
55#define DEBUG_RENDER_BUFFERS 0
56
Romain Guy3bbacf22013-02-06 16:51:04 -080057// Turn on to make stencil operations easier to debug
Romain Guy3ff0bfd2013-02-25 14:15:37 -080058// (writes 255 instead of 1 in the buffer, forces 8 bit stencil)
Romain Guy3bbacf22013-02-06 16:51:04 -080059#define DEBUG_STENCIL 0
60
Romain Guyaaceeb02011-03-23 19:56:13 -070061// Turn on to display debug info about 9patch objects
Romain Guyc15008e2010-11-10 11:59:15 -080062#define DEBUG_PATCHES 0
Romain Guya5ef39a2010-12-03 16:48:20 -080063// Turn on to display vertex and tex coords data about 9patch objects
64// This flag requires DEBUG_PATCHES to be turned on
65#define DEBUG_PATCHES_VERTICES 0
Romain Guyfb13abd2011-01-16 15:16:38 -080066// Turn on to display vertex and tex coords data used by empty quads
67// in 9patch objects
68// This flag requires DEBUG_PATCHES to be turned on
69#define DEBUG_PATCHES_EMPTY_VERTICES 0
Romain Guyc15008e2010-11-10 11:59:15 -080070
Romain Guy01d58e42011-01-19 21:54:02 -080071// Turn on to display debug info about shapes
Romain Guyc46d07a2013-03-15 19:06:39 -070072#define DEBUG_PATHS 0
Romain Guy01d58e42011-01-19 21:54:02 -080073
Romain Guyc15008e2010-11-10 11:59:15 -080074// Turn on to display debug info about textures
75#define DEBUG_TEXTURES 0
76
Romain Guy1fc883b2011-01-12 14:30:59 -080077// Turn on to display debug info about the layer renderer
78#define DEBUG_LAYER_RENDERER 0
79
Romain Guyb6294902012-02-02 15:13:18 -080080// Turn on to enable additional debugging in the font renderers
81#define DEBUG_FONT_RENDERER 0
82
Chris Craikc3566d02013-02-04 16:16:33 -080083// Turn on to log draw operation batching and deferral information
84#define DEBUG_DEFER 0
85
Romain Guyffac7fc2011-01-13 17:21:49 -080086// Turn on to dump display list state
87#define DEBUG_DISPLAY_LIST 0
88
Romain Guy8a4ac612012-07-17 17:32:48 -070089// Turn on to insert an event marker for each display list op
90#define DEBUG_DISPLAY_LIST_OPS_AS_EVENTS 0
91
Chris Craik62d307c2014-07-29 10:35:13 -070092// Turn on to insert detailed event markers
93#define DEBUG_DETAILED_EVENTS 0
94
Chris Craik527a3aa2013-03-04 10:19:31 -080095// Turn on to highlight drawing batches and merged batches with different colors
96#define DEBUG_MERGE_BEHAVIOR 0
97
ztenghui55bfb4e2013-12-03 10:38:55 -080098// Turn on to enable debugging shadow
99#define DEBUG_SHADOW 0
100
Teng-Hui Zhu85d99522016-04-25 14:23:40 -0700101// Turn on to enable debugging vector drawable
102#define DEBUG_VECTOR_DRAWABLE 0
103
Romain Guyc9855a52011-01-21 21:14:15 -0800104#if DEBUG_INIT
John Reck1bcacfd2017-11-03 10:12:19 -0700105#define INIT_LOGD(...) ALOGD(__VA_ARGS__)
Romain Guyc9855a52011-01-21 21:14:15 -0800106#else
John Reck1bcacfd2017-11-03 10:12:19 -0700107#define INIT_LOGD(...)
Romain Guyc9855a52011-01-21 21:14:15 -0800108#endif
109
John Reck1bcacfd2017-11-03 10:12:19 -0700110#endif // ANDROID_HWUI_DEBUG_H