Loading core/java/android/view/ViewDebug.java +77 −60 Original line number Diff line number Diff line Loading @@ -916,6 +916,24 @@ public class ViewDebug { out = new BufferedWriter(new OutputStreamWriter(clientStream), 32 * 1024); if (view != null) { profileViewAndChildren(view, out); } else { out.write("-1 -1 -1"); out.newLine(); } out.write("DONE."); out.newLine(); } catch (Exception e) { android.util.Log.w("View", "Problem profiling the view:", e); } finally { if (out != null) { out.close(); } } } private static void profileViewAndChildren(final View view, BufferedWriter out) throws IOException { final long durationMeasure = profileViewOperation(view, new ViewOperation<Void>() { public Void[] pre() { forceLayout(view); Loading Loading @@ -957,10 +975,13 @@ public class ViewDebug { final long durationDraw = profileViewOperation(view, new ViewOperation<Object>() { public Object[] pre() { final DisplayMetrics metrics = view.getResources().getDisplayMetrics(); final Bitmap bitmap = Bitmap.createBitmap(metrics.widthPixels, metrics.heightPixels, Bitmap.Config.RGB_565); final Bitmap bitmap = Bitmap.createBitmap(metrics.widthPixels, metrics.heightPixels, Bitmap.Config.RGB_565); final Canvas canvas = new Canvas(bitmap); return new Object[] { bitmap, canvas }; return new Object[] { bitmap, canvas }; } public void run(Object... data) { Loading @@ -978,15 +999,11 @@ public class ViewDebug { out.write(' '); out.write(String.valueOf(durationDraw)); out.newLine(); } else { out.write("-1 -1 -1"); out.newLine(); } } catch (Exception e) { android.util.Log.w("View", "Problem profiling the view:", e); } finally { if (out != null) { out.close(); if (view instanceof ViewGroup) { ViewGroup group = (ViewGroup) view; final int count = group.getChildCount(); for (int i = 0; i < count; i++) { profileViewAndChildren(group.getChildAt(i), out); } } } Loading Loading
core/java/android/view/ViewDebug.java +77 −60 Original line number Diff line number Diff line Loading @@ -916,6 +916,24 @@ public class ViewDebug { out = new BufferedWriter(new OutputStreamWriter(clientStream), 32 * 1024); if (view != null) { profileViewAndChildren(view, out); } else { out.write("-1 -1 -1"); out.newLine(); } out.write("DONE."); out.newLine(); } catch (Exception e) { android.util.Log.w("View", "Problem profiling the view:", e); } finally { if (out != null) { out.close(); } } } private static void profileViewAndChildren(final View view, BufferedWriter out) throws IOException { final long durationMeasure = profileViewOperation(view, new ViewOperation<Void>() { public Void[] pre() { forceLayout(view); Loading Loading @@ -957,10 +975,13 @@ public class ViewDebug { final long durationDraw = profileViewOperation(view, new ViewOperation<Object>() { public Object[] pre() { final DisplayMetrics metrics = view.getResources().getDisplayMetrics(); final Bitmap bitmap = Bitmap.createBitmap(metrics.widthPixels, metrics.heightPixels, Bitmap.Config.RGB_565); final Bitmap bitmap = Bitmap.createBitmap(metrics.widthPixels, metrics.heightPixels, Bitmap.Config.RGB_565); final Canvas canvas = new Canvas(bitmap); return new Object[] { bitmap, canvas }; return new Object[] { bitmap, canvas }; } public void run(Object... data) { Loading @@ -978,15 +999,11 @@ public class ViewDebug { out.write(' '); out.write(String.valueOf(durationDraw)); out.newLine(); } else { out.write("-1 -1 -1"); out.newLine(); } } catch (Exception e) { android.util.Log.w("View", "Problem profiling the view:", e); } finally { if (out != null) { out.close(); if (view instanceof ViewGroup) { ViewGroup group = (ViewGroup) view; final int count = group.getChildCount(); for (int i = 0; i < count; i++) { profileViewAndChildren(group.getChildAt(i), out); } } } Loading