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

Commit 010e2c29 authored by Xavier Ducrohet's avatar Xavier Ducrohet Committed by Android (Google) Code Review
Browse files

Merge "Layoutlib: more text drawing."

parents 1c415171 e0c763f5
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -886,23 +886,22 @@ public class Canvas_Delegate {
        native_drawText(nativeCanvas, buffer, 0, count, x, y, flags, paint);
    }


    /*package*/ static void native_drawTextRun(int nativeCanvas, String text,
            int start, int end, int contextStart, int contextEnd,
            float x, float y, int flags, int paint) {
        // FIXME
        throw new UnsupportedOperationException();
    }
        int count = end - start;
        char[] buffer = TemporaryBuffer.obtain(count);
        TextUtils.getChars(text, start, end, buffer, 0);

        native_drawText(nativeCanvas, buffer, start, end, x, y, flags, paint);
    }

    /*package*/ static void native_drawTextRun(int nativeCanvas, char[] text,
            int start, int count, int contextStart, int contextCount,
            float x, float y, int flags, int paint) {
        // FIXME
        throw new UnsupportedOperationException();
        native_drawText(nativeCanvas, text, 0, count, x, y, flags, paint);
    }


    /*package*/ static void native_drawPosText(int nativeCanvas,
                                                  char[] text, int index,
                                                  int count, float[] pos,
+3 −4
Original line number Diff line number Diff line
@@ -430,7 +430,7 @@ public final class Bridge implements ILayoutBridge {
                        MeasureSpec.UNSPECIFIED); // this lets us know the actual needed size
                h_spec = MeasureSpec.makeMeasureSpec(screenHeight - screenOffset,
                        MeasureSpec.UNSPECIFIED); // this lets us know the actual needed size
                view.measure(w_spec, h_spec);
                root.measure(w_spec, h_spec);

                int neededWidth = root.getChildAt(0).getMeasuredWidth();
                if (neededWidth > screenWidth) {
@@ -448,10 +448,10 @@ public final class Bridge implements ILayoutBridge {
            w_spec = MeasureSpec.makeMeasureSpec(screenWidth, MeasureSpec.EXACTLY);
            h_spec = MeasureSpec.makeMeasureSpec(screenHeight - screenOffset,
                    MeasureSpec.EXACTLY);
            view.measure(w_spec, h_spec);
            root.measure(w_spec, h_spec);

            // now do the layout.
            view.layout(0, screenOffset, screenWidth, screenHeight);
            root.layout(0, screenOffset, screenWidth, screenHeight);

            // draw the views
            // create the BufferedImage into which the layout will be rendered.
@@ -468,7 +468,6 @@ public final class Bridge implements ILayoutBridge {
            Canvas_Delegate canvasDelegate = Canvas_Delegate.getDelegate(canvas);
            canvasDelegate.setLogger(logger);


            root.draw(canvas);
            canvasDelegate.dispose();