1 /*
2  * Copyright (C) 2018 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 package android.view.shadow;
18 
19 /**
20  * Constant values for shadow related configuration
21  */
22 class ShadowConstants {
23 
24     /**
25      * This is used as a factor by which to scale down the shadow bitmap. If we have world
26      * Width x Height, shadow bitmap will be Width/SCALE_DOWN x Height/SCALE_DOWN and during
27      * canvas draw the shadow will be scaled up, resulting faster perf (due to smaller bitmap) but
28      * blurrier (lower quality) shadow.
29      */
30     public static final int SCALE_DOWN = 5;
31 
32     public static final float MIN_ALPHA = 0.2f;
33 
34     public static final int SPOT_SHADOW_LIGHT_Z_HEIGHT_DP = 50 / SCALE_DOWN;
35     public static final int SPOT_SHADOW_LIGHT_Z_EPSILON = 10 / SCALE_DOWN;
36     public static final float SPOT_SHADOW_STRENGTH = 0.3f;
37 
38     public static final float AMBIENT_SHADOW_EDGE_SCALE = 60f;
39     public static final float AMBIENT_SHADOW_SHADOW_BOUND = 0.02f * SCALE_DOWN;
40     public static final float AMBIENT_SHADOW_STRENGTH = 1.0f;
41 
42     public static final int COORDINATE_SIZE = 3;
43     public static final int RECT_VERTICES_SIZE = 4;
44 
45     public static final int SPLICE_ROUNDED_EDGE = 5;
46 }
47