Skip to content

Commit 638f17c

Browse files
Romain GuyAndroid (Google) Code Review
authored andcommitted
Merge "TextureView works best when it draws stuff. Bug #5391188"
2 parents 966222e + 59c7f80 commit 638f17c

File tree

4 files changed

+17
-3
lines changed

4 files changed

+17
-3
lines changed

core/java/android/view/TextureView.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,11 @@ public int getLayerType() {
250250
return LAYER_TYPE_HARDWARE;
251251
}
252252

253+
@Override
254+
boolean hasStaticLayer() {
255+
return true;
256+
}
257+
253258
/**
254259
* Calling this method has no effect.
255260
*/

core/java/android/view/View.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10000,6 +10000,15 @@ public void setLayerType(int layerType, Paint paint) {
1000010000
invalidate(true);
1000110001
}
1000210002

10003+
/**
10004+
* Indicates whether this view has a static layer. A view with layer type
10005+
* {@link #LAYER_TYPE_NONE} is a static layer. Other types of layers are
10006+
* dynamic.
10007+
*/
10008+
boolean hasStaticLayer() {
10009+
return mLayerType == LAYER_TYPE_NONE;
10010+
}
10011+
1000310012
/**
1000410013
* Indicates what type of layer is currently associated with this view. By default
1000510014
* a view does not have a layer, and the layer type is {@link #LAYER_TYPE_NONE}.

core/java/android/view/ViewGroup.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2560,8 +2560,8 @@ protected void dispatchGetDisplayList() {
25602560
final View[] children = mChildren;
25612561
for (int i = 0; i < count; i++) {
25622562
final View child = children[i];
2563-
if (((child.mViewFlags & VISIBILITY_MASK) == VISIBLE ||
2564-
child.getAnimation() != null) && child.getLayerType() == LAYER_TYPE_NONE) {
2563+
if (((child.mViewFlags & VISIBILITY_MASK) == VISIBLE || child.getAnimation() != null) &&
2564+
child.hasStaticLayer()) {
25652565
child.mRecreateDisplayList = (child.mPrivateFlags & INVALIDATED) == INVALIDATED;
25662566
child.mPrivateFlags &= ~INVALIDATED;
25672567
child.getDisplayList();

libs/hwui/TextDropShadowCache.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ struct ShadowText {
8181
LTE_INT(flags) {
8282
LTE_INT(italicStyle) {
8383
LTE_INT(scaleX) {
84-
return strncmp16(text, rhs.text, len >> 1) < 0;
84+
return memcmp(text, rhs.text, len) < 0;
8585
}
8686
}
8787
}

0 commit comments

Comments
 (0)