Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e57475e6 authored by John Reck's avatar John Reck
Browse files

Address API council feedback

Bug: 125027187
Bug: 125026102
Bug: 125026678
Bug: 125026234
Bug: 125027586
Bug: 125026476
Bug: 125026103
Bug: 125026237
Bug: 125027248
Bug: 125026475
Bug: 125027487
Test: RenderNodeTests
Change-Id: Ic63ea7a3cfe359a7dff0c1b46e534e499f7e928b
parent ab5938c3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ public class RenderNodePerfTest {
        final BenchmarkState state = mPerfStatusReporter.getBenchmarkState();
        RenderNode node = RenderNode.create("LinearLayout", null);
        while (state.keepRunning()) {
            node.startRecording(100, 100);
            node.beginRecording(100, 100);
            node.endRecording();
        }
    }
@@ -86,7 +86,7 @@ public class RenderNodePerfTest {

        while (state.keepRunning()) {
            for (int i = 0; i < nodes.length; i++) {
                nodes[i].startRecording(100, 100);
                nodes[i].beginRecording(100, 100);
            }
            for (int i = nodes.length - 1; i >= 0; i--) {
                nodes[i].endRecording();
+9 −9
Original line number Diff line number Diff line
@@ -265,7 +265,7 @@ public class StaticLayoutPerfTest {
            state.pauseTiming();
            final StaticLayout layout =
                    StaticLayout.Builder.obtain(text, 0, text.length(), PAINT, TEXT_WIDTH).build();
            final RecordingCanvas c = node.startRecording(1200, 200);
            final RecordingCanvas c = node.beginRecording(1200, 200);
            state.resumeTiming();

            layout.draw(c);
@@ -282,7 +282,7 @@ public class StaticLayoutPerfTest {
            final CharSequence text = mTextUtil.nextRandomParagraph(WORD_LENGTH, STYLE_TEXT);
            final StaticLayout layout =
                    StaticLayout.Builder.obtain(text, 0, text.length(), PAINT, TEXT_WIDTH).build();
            final RecordingCanvas c = node.startRecording(1200, 200);
            final RecordingCanvas c = node.beginRecording(1200, 200);
            state.resumeTiming();

            layout.draw(c);
@@ -299,7 +299,7 @@ public class StaticLayoutPerfTest {
            final CharSequence text = mTextUtil.nextRandomParagraph(WORD_LENGTH, NO_STYLE_TEXT);
            final StaticLayout layout =
                    StaticLayout.Builder.obtain(text, 0, text.length(), PAINT, TEXT_WIDTH).build();
            final RecordingCanvas c = node.startRecording(1200, 200);
            final RecordingCanvas c = node.beginRecording(1200, 200);
            state.resumeTiming();

            layout.draw(c);
@@ -316,7 +316,7 @@ public class StaticLayoutPerfTest {
            final CharSequence text = mTextUtil.nextRandomParagraph(WORD_LENGTH, STYLE_TEXT);
            final StaticLayout layout =
                    StaticLayout.Builder.obtain(text, 0, text.length(), PAINT, TEXT_WIDTH).build();
            final RecordingCanvas c = node.startRecording(1200, 200);
            final RecordingCanvas c = node.beginRecording(1200, 200);
            Canvas.freeTextLayoutCaches();
            state.resumeTiming();

@@ -334,7 +334,7 @@ public class StaticLayoutPerfTest {
            final CharSequence text = mTextUtil.nextRandomParagraph(WORD_LENGTH, NO_STYLE_TEXT);
            final StaticLayout layout =
                    StaticLayout.Builder.obtain(text, 0, text.length(), PAINT, TEXT_WIDTH).build();
            final RecordingCanvas c = node.startRecording(1200, 200);
            final RecordingCanvas c = node.beginRecording(1200, 200);
            Canvas.freeTextLayoutCaches();
            state.resumeTiming();

@@ -353,7 +353,7 @@ public class StaticLayoutPerfTest {
                    mTextUtil.nextRandomParagraph(WORD_LENGTH, STYLE_TEXT), PAINT);
            final StaticLayout layout =
                    StaticLayout.Builder.obtain(text, 0, text.length(), PAINT, TEXT_WIDTH).build();
            final RecordingCanvas c = node.startRecording(1200, 200);
            final RecordingCanvas c = node.beginRecording(1200, 200);
            state.resumeTiming();

            layout.draw(c);
@@ -371,7 +371,7 @@ public class StaticLayoutPerfTest {
                    mTextUtil.nextRandomParagraph(WORD_LENGTH, NO_STYLE_TEXT), PAINT);
            final StaticLayout layout =
                    StaticLayout.Builder.obtain(text, 0, text.length(), PAINT, TEXT_WIDTH).build();
            final RecordingCanvas c = node.startRecording(1200, 200);
            final RecordingCanvas c = node.beginRecording(1200, 200);
            state.resumeTiming();

            layout.draw(c);
@@ -389,7 +389,7 @@ public class StaticLayoutPerfTest {
                    mTextUtil.nextRandomParagraph(WORD_LENGTH, STYLE_TEXT), PAINT);
            final StaticLayout layout =
                    StaticLayout.Builder.obtain(text, 0, text.length(), PAINT, TEXT_WIDTH).build();
            final RecordingCanvas c = node.startRecording(1200, 200);
            final RecordingCanvas c = node.beginRecording(1200, 200);
            Canvas.freeTextLayoutCaches();
            state.resumeTiming();

@@ -408,7 +408,7 @@ public class StaticLayoutPerfTest {
                    mTextUtil.nextRandomParagraph(WORD_LENGTH, NO_STYLE_TEXT), PAINT);
            final StaticLayout layout =
                    StaticLayout.Builder.obtain(text, 0, text.length(), PAINT, TEXT_WIDTH).build();
            final RecordingCanvas c = node.startRecording(1200, 200);
            final RecordingCanvas c = node.beginRecording(1200, 200);
            Canvas.freeTextLayoutCaches();
            state.resumeTiming();

+4 −4
Original line number Diff line number Diff line
@@ -344,7 +344,7 @@ public class TextViewPrecomputedTextPerfTest {
            textView.setText(text);
            textView.measure(width, height);
            textView.layout(0, 0, textView.getMeasuredWidth(), textView.getMeasuredHeight());
            final RecordingCanvas c = node.startRecording(
            final RecordingCanvas c = node.beginRecording(
                textView.getMeasuredWidth(), textView.getMeasuredHeight());
            textView.nullLayouts();
            Canvas.freeTextLayoutCaches();
@@ -371,7 +371,7 @@ public class TextViewPrecomputedTextPerfTest {
            textView.setText(text);
            textView.measure(width, height);
            textView.layout(0, 0, textView.getMeasuredWidth(), textView.getMeasuredHeight());
            final RecordingCanvas c = node.startRecording(
            final RecordingCanvas c = node.beginRecording(
                textView.getMeasuredWidth(), textView.getMeasuredHeight());
            textView.nullLayouts();
            Canvas.freeTextLayoutCaches();
@@ -400,7 +400,7 @@ public class TextViewPrecomputedTextPerfTest {
            textView.setText(text);
            textView.measure(width, height);
            textView.layout(0, 0, textView.getMeasuredWidth(), textView.getMeasuredHeight());
            final RecordingCanvas c = node.startRecording(
            final RecordingCanvas c = node.beginRecording(
                textView.getMeasuredWidth(), textView.getMeasuredHeight());
            textView.nullLayouts();
            Canvas.freeTextLayoutCaches();
@@ -430,7 +430,7 @@ public class TextViewPrecomputedTextPerfTest {
            textView.setText(text);
            textView.measure(width, height);
            textView.layout(0, 0, textView.getMeasuredWidth(), textView.getMeasuredHeight());
            final RecordingCanvas c = node.startRecording(
            final RecordingCanvas c = node.beginRecording(
                textView.getMeasuredWidth(), textView.getMeasuredHeight());
            textView.nullLayouts();
            Canvas.freeTextLayoutCaches();
+14 −17
Original line number Diff line number Diff line
@@ -14936,13 +14936,15 @@ package android.graphics {
  public final class RenderNode {
    ctor public RenderNode(@Nullable String);
    method public int computeApproximateMemoryUsage();
    method public android.graphics.RecordingCanvas beginRecording(int, int);
    method public android.graphics.RecordingCanvas beginRecording();
    method public long computeApproximateMemoryUsage();
    method public void discardDisplayList();
    method public void endRecording();
    method public float getAlpha();
    method public int getAmbientShadowColor();
    method @ColorInt public int getAmbientShadowColor();
    method public int getBottom();
    method public float getCameraDistance();
    method @FloatRange(from=0.0f, to=java.lang.Float.MAX_VALUE) public float getCameraDistance();
    method public boolean getClipToBounds();
    method public boolean getClipToOutline();
    method public float getElevation();
@@ -14953,12 +14955,12 @@ package android.graphics {
    method public float getPivotX();
    method public float getPivotY();
    method public int getRight();
    method public float getRotation();
    method public float getRotationX();
    method public float getRotationY();
    method public float getRotationZ();
    method public float getScaleX();
    method public float getScaleY();
    method public int getSpotShadowColor();
    method @ColorInt public int getSpotShadowColor();
    method public int getTop();
    method public float getTranslationX();
    method public float getTranslationY();
@@ -14976,36 +14978,31 @@ package android.graphics {
    method public boolean offsetTopAndBottom(int);
    method public boolean resetPivot();
    method public boolean setAlpha(float);
    method public boolean setAmbientShadowColor(int);
    method public boolean setBottom(int);
    method public boolean setCameraDistance(float);
    method public boolean setClipBounds(@Nullable android.graphics.Rect);
    method public boolean setAmbientShadowColor(@ColorInt int);
    method public boolean setCameraDistance(@FloatRange(from=0.0f, to=java.lang.Float.MAX_VALUE) float);
    method public boolean setClipRect(@Nullable android.graphics.Rect);
    method public boolean setClipToBounds(boolean);
    method public boolean setClipToOutline(boolean);
    method public boolean setElevation(float);
    method public boolean setForceDarkAllowed(boolean);
    method public boolean setHasOverlappingRendering(boolean);
    method public boolean setLeft(int);
    method public boolean setLeftTopRightBottom(int, int, int, int);
    method public boolean setOutline(@Nullable android.graphics.Outline);
    method public boolean setPivotX(float);
    method public boolean setPivotY(float);
    method public boolean setPosition(int, int, int, int);
    method public boolean setPosition(android.graphics.Rect);
    method public boolean setProjectBackwards(boolean);
    method public boolean setProjectionReceiver(boolean);
    method public boolean setRight(int);
    method public boolean setRotation(float);
    method public boolean setRotationX(float);
    method public boolean setRotationY(float);
    method public boolean setRotationZ(float);
    method public boolean setScaleX(float);
    method public boolean setScaleY(float);
    method public boolean setSpotShadowColor(int);
    method public boolean setTop(int);
    method public boolean setSpotShadowColor(@ColorInt int);
    method public boolean setTranslationX(float);
    method public boolean setTranslationY(float);
    method public boolean setTranslationZ(float);
    method public boolean setUseCompositingLayer(boolean, @Nullable android.graphics.Paint);
    method public android.graphics.RecordingCanvas startRecording(int, int);
    method public android.graphics.RecordingCanvas startRecording();
  }
  public class Shader {
+2 −2
Original line number Diff line number Diff line
@@ -922,7 +922,7 @@ public class Surface implements Parcelable {
            if (mCanvas != null) {
                throw new IllegalStateException("Surface was already locked!");
            }
            mCanvas = mRenderNode.start(width, height);
            mCanvas = mRenderNode.beginRecording(width, height);
            return mCanvas;
        }

@@ -931,7 +931,7 @@ public class Surface implements Parcelable {
                throw new IllegalArgumentException("canvas object must be the same instance that "
                        + "was previously returned by lockCanvas");
            }
            mRenderNode.end(mCanvas);
            mRenderNode.endRecording();
            mCanvas = null;
            nHwuiDraw(mHwuiRenderer);
        }
Loading