• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2020 The Android Open Source Project
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #pragma once
16 
17 #define  LCD_DENSITY_LDPI      120
18 #define  LCD_DENSITY_MDPI      160
19 #define  LCD_DENSITY_TVDPI     213
20 #define  LCD_DENSITY_HDPI      240
21 #define  LCD_DENSITY_260DPI    260
22 #define  LCD_DENSITY_280DPI    280
23 #define  LCD_DENSITY_300DPI    300
24 #define  LCD_DENSITY_XHDPI     320
25 #define  LCD_DENSITY_340DPI    340
26 #define  LCD_DENSITY_360DPI    360
27 #define  LCD_DENSITY_400DPI    400
28 #define  LCD_DENSITY_420DPI    420
29 #define  LCD_DENSITY_440DPI    440
30 #define  LCD_DENSITY_XXHDPI    480
31 #define  LCD_DENSITY_560DPI    560
32 #define  LCD_DENSITY_XXXHDPI   640
33 
34 typedef enum hwLcd_screenSize {
35     LCD_SIZE_SMALL,
36     LCD_SIZE_NORMAL,
37     LCD_SIZE_LARGE,
38     LCD_SIZE_XLARGE
39 } hwLcd_screenSize_t;
40 
41 /* Sets the boot property corresponding to the emulated abstract LCD density */
42 extern void hwLcd_setBootProperty(int density);
43 
44 extern hwLcd_screenSize_t hwLcd_getScreenSize(int heightPx,
45                                               int widthPx,
46                                               int density);
47 
48 /* Don't call this directly.
49  * It is public only to allow unit testing.
50  */
51 extern int hwLcd_mapDensity(int density);
52