Skip to content

Commit f877308

Browse files
author
Romain Guy
committed
Remove obsolete optimization
Change-Id: I2d43c009c62a7f4a4a2e0a6303bdfa692c4b8c8c
1 parent 7d3082a commit f877308

File tree

5 files changed

+5
-28
lines changed

5 files changed

+5
-28
lines changed

core/java/android/view/View.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10128,8 +10128,7 @@ protected void invalidateParentIfNeeded() {
1012810128
@ViewDebug.ExportedProperty(category = "drawing")
1012910129
public boolean isOpaque() {
1013010130
return (mPrivateFlags & OPAQUE_MASK) == OPAQUE_MASK &&
10131-
((mTransformationInfo != null ? mTransformationInfo.mAlpha : 1)
10132-
>= 1.0f - ViewConfiguration.ALPHA_THRESHOLD);
10131+
((mTransformationInfo != null ? mTransformationInfo.mAlpha : 1.0f) >= 1.0f);
1013310132
}
1013410133

1013510134
/**

core/java/android/view/ViewConfiguration.java

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -29,24 +29,6 @@
2929
* Contains methods to standard constants used in the UI for timeouts, sizes, and distances.
3030
*/
3131
public class ViewConfiguration {
32-
/**
33-
* Expected bit depth of the display panel.
34-
*
35-
* @hide
36-
*/
37-
public static final float PANEL_BIT_DEPTH = 24;
38-
39-
/**
40-
* Minimum alpha required for a view to draw.
41-
*
42-
* @hide
43-
*/
44-
public static final float ALPHA_THRESHOLD = 0.5f / PANEL_BIT_DEPTH;
45-
/**
46-
* @hide
47-
*/
48-
public static final float ALPHA_THRESHOLD_INT = 0x7f / PANEL_BIT_DEPTH;
49-
5032
/**
5133
* Defines the width of the horizontal scrollbar and the height of the vertical scrollbar in
5234
* dips

libs/hwui/OpenGLRenderer.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ namespace uirenderer {
4545
#define RAD_TO_DEG (180.0f / 3.14159265f)
4646
#define MIN_ANGLE 0.001f
4747

48-
// TODO: This should be set in properties
49-
#define ALPHA_THRESHOLD (0x7f / PANEL_BIT_DEPTH)
48+
#define ALPHA_THRESHOLD 0
5049

5150
#define FILTER(paint) (paint && paint->isFilterBitmap() ? GL_LINEAR : GL_NEAREST)
5251

@@ -449,7 +448,7 @@ int OpenGLRenderer::saveLayer(float left, float top, float right, float bottom,
449448

450449
int OpenGLRenderer::saveLayerAlpha(float left, float top, float right, float bottom,
451450
int alpha, int flags) {
452-
if (alpha >= 255 - ALPHA_THRESHOLD) {
451+
if (alpha >= 255) {
453452
return saveLayer(left, top, right, bottom, NULL, flags);
454453
} else {
455454
SkPaint paint;

libs/hwui/Program.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ namespace uirenderer {
4141
#define PROGRAM_LOGD(...)
4242
#endif
4343

44-
#define COLOR_COMPONENT_THRESHOLD (1.0f - (0.5f / PANEL_BIT_DEPTH))
45-
#define COLOR_COMPONENT_INV_THRESHOLD (0.5f / PANEL_BIT_DEPTH)
44+
#define COLOR_COMPONENT_THRESHOLD 1.0f
45+
#define COLOR_COMPONENT_INV_THRESHOLD 0.0f
4646

4747
#define PROGRAM_KEY_TEXTURE 0x1
4848
#define PROGRAM_KEY_A8_TEXTURE 0x2

libs/hwui/Properties.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,6 @@ enum DebugLevel {
7878
#define PROPERTY_TEXT_BLACK_GAMMA_THRESHOLD "ro.text_gamma.black_threshold"
7979
#define PROPERTY_TEXT_WHITE_GAMMA_THRESHOLD "ro.text_gamma.white_threshold"
8080

81-
// TODO: This should be set by a system property
82-
#define PANEL_BIT_DEPTH 20
83-
8481
// Converts a number of mega-bytes into bytes
8582
#define MB(s) s * 1024 * 1024
8683

0 commit comments

Comments
 (0)