Skip to content

Commit f7ee2a0

Browse files
Romain GuyAndroid (Google) Code Review
authored andcommitted
Merge "Fix rendering artifacts on tiled renderers Bug #7275145" into jb-mr1-dev
2 parents 6fb7fd3 + dfab363 commit f7ee2a0

File tree

6 files changed

+26
-24
lines changed

6 files changed

+26
-24
lines changed

core/java/android/view/GLES20RecordingCanvas.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -235,18 +235,6 @@ public void drawRect(float left, float top, float right, float bottom, Paint pai
235235
recordShaderBitmap(paint);
236236
}
237237

238-
@Override
239-
public void drawRect(Rect r, Paint paint) {
240-
super.drawRect(r, paint);
241-
recordShaderBitmap(paint);
242-
}
243-
244-
@Override
245-
public void drawRect(RectF r, Paint paint) {
246-
super.drawRect(r, paint);
247-
recordShaderBitmap(paint);
248-
}
249-
250238
@Override
251239
public void drawRoundRect(RectF rect, float rx, float ry, Paint paint) {
252240
super.drawRoundRect(rect, rx, ry, paint);

core/java/android/view/HardwareRenderer.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,17 +507,22 @@ abstract boolean draw(View view, View.AttachInfo attachInfo, HardwareDrawCallbac
507507
* @param width The width of the drawing surface.
508508
* @param height The height of the drawing surface.
509509
* @param surface The surface to hardware accelerate
510+
*
511+
* @return true if the surface was initialized, false otherwise. Returning
512+
* false might mean that the surface was already initialized.
510513
*/
511-
void initializeIfNeeded(int width, int height, Surface surface)
514+
boolean initializeIfNeeded(int width, int height, Surface surface)
512515
throws Surface.OutOfResourcesException {
513516
if (isRequested()) {
514517
// We lost the gl context, so recreate it.
515518
if (!isEnabled()) {
516519
if (initialize(surface)) {
517520
setup(width, height);
521+
return true;
518522
}
519523
}
520-
}
524+
}
525+
return false;
521526
}
522527

523528
/**

core/java/android/view/View.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2904,6 +2904,7 @@ static class TransformationInfo {
29042904
*/
29052905
int mOldHeightMeasureSpec = Integer.MIN_VALUE;
29062906

2907+
@ViewDebug.ExportedProperty(deepExport = true, prefix = "bg_")
29072908
private Drawable mBackground;
29082909

29092910
private int mBackgroundResource;

core/java/android/view/ViewDebug.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -923,8 +923,12 @@ private static void dumpViewProperties(Context context, Object view,
923923
private static void dumpViewProperties(Context context, Object view,
924924
BufferedWriter out, String prefix) throws IOException {
925925

926-
Class<?> klass = view.getClass();
926+
if (view == null) {
927+
out.write(prefix + "=4,null ");
928+
return;
929+
}
927930

931+
Class<?> klass = view.getClass();
928932
do {
929933
exportFields(context, view, out, klass, prefix);
930934
exportMethods(context, view, out, klass, prefix);
@@ -1064,8 +1068,8 @@ private static void exportFields(Context context, Object view, BufferedWriter ou
10641068
return;
10651069
} else if (!type.isPrimitive()) {
10661070
if (property.deepExport()) {
1067-
dumpViewProperties(context, field.get(view), out, prefix
1068-
+ property.prefix());
1071+
dumpViewProperties(context, field.get(view), out, prefix +
1072+
property.prefix());
10691073
continue;
10701074
}
10711075
}

core/java/android/view/ViewRootImpl.java

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
import android.os.SystemClock;
5353
import android.os.SystemProperties;
5454
import android.os.Trace;
55-
import android.os.UserHandle;
5655
import android.util.AndroidRuntimeException;
5756
import android.util.DisplayMetrics;
5857
import android.util.Log;
@@ -2817,10 +2816,10 @@ public void handleMessage(Message msg) {
28172816
case MSG_RESIZED: {
28182817
// Recycled in the fall through...
28192818
SomeArgs args = (SomeArgs) msg.obj;
2820-
if (mWinFrame.equals((Rect) args.arg1)
2821-
&& mPendingContentInsets.equals((Rect) args.arg2)
2822-
&& mPendingVisibleInsets.equals((Rect) args.arg3)
2823-
&& ((Configuration) args.arg4 == null)) {
2819+
if (mWinFrame.equals(args.arg1)
2820+
&& mPendingContentInsets.equals(args.arg2)
2821+
&& mPendingVisibleInsets.equals(args.arg3)
2822+
&& args.arg4 == null) {
28242823
break;
28252824
}
28262825
} // fall through...
@@ -2882,8 +2881,10 @@ public void handleMessage(Message msg) {
28822881
mSurface != null && mSurface.isValid()) {
28832882
mFullRedrawNeeded = true;
28842883
try {
2885-
mAttachInfo.mHardwareRenderer.initializeIfNeeded(mWidth, mHeight,
2886-
mHolder.getSurface());
2884+
if (mAttachInfo.mHardwareRenderer.initializeIfNeeded(
2885+
mWidth, mHeight, mHolder.getSurface())) {
2886+
mFullRedrawNeeded = true;
2887+
}
28872888
} catch (Surface.OutOfResourcesException e) {
28882889
Log.e(TAG, "OutOfResourcesException locking surface", e);
28892890
try {

graphics/java/android/graphics/drawable/ColorDrawable.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import android.content.res.Resources;
2121
import android.content.res.TypedArray;
2222
import android.util.AttributeSet;
23+
import android.view.ViewDebug;
2324
import org.xmlpull.v1.XmlPullParser;
2425
import org.xmlpull.v1.XmlPullParserException;
2526

@@ -34,6 +35,7 @@
3435
* @attr ref android.R.styleable#ColorDrawable_color
3536
*/
3637
public class ColorDrawable extends Drawable {
38+
@ViewDebug.ExportedProperty(deepExport = true, prefix = "state_")
3739
private ColorState mState;
3840
private final Paint mPaint = new Paint();
3941
private boolean mMutated;
@@ -174,6 +176,7 @@ public ConstantState getConstantState() {
174176

175177
final static class ColorState extends ConstantState {
176178
int mBaseColor; // base color, independent of setAlpha()
179+
@ViewDebug.ExportedProperty
177180
int mUseColor; // basecolor modulated by setAlpha()
178181
int mChangingConfigurations;
179182

0 commit comments

Comments
 (0)