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

Commit d9633805 authored by Nicolas Roard's avatar Nicolas Roard Committed by Android (Google) Code Review
Browse files

Merge "Update to ToT RemoteCompose" into main

parents 222750e7 04be9989
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -18,19 +18,19 @@ package com.android.internal.widget.remotecompose.core;
import android.annotation.NonNull;
import android.annotation.NonNull;


/** Base interface for RemoteCompose operations */
/** Base interface for RemoteCompose operations */
public interface Operation {
public abstract class Operation {


    /** add the operation to the buffer */
    /** add the operation to the buffer */
    void write(@NonNull WireBuffer buffer);
    public abstract void write(@NonNull WireBuffer buffer);


    /**
    /**
     * paint an operation
     * paint an operation
     *
     *
     * @param context the paint context used to paint the operation
     * @param context the paint context used to paint the operation
     */
     */
    void apply(@NonNull RemoteContext context);
    public abstract void apply(@NonNull RemoteContext context);


    /** Debug utility to display an operation + indentation */
    /** Debug utility to display an operation + indentation */
    @NonNull
    @NonNull
    String deepToString(@NonNull String indent);
    public abstract String deepToString(@NonNull String indent);
}
}
+36 −0
Original line number Original line Diff line number Diff line
/*
 * Copyright (C) 2023 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.android.internal.widget.remotecompose.core;

import android.annotation.NonNull;

/** Base interface for RemoteCompose operations */
public interface OperationInterface {

    /** add the operation to the buffer */
    void write(@NonNull WireBuffer buffer);

    /**
     * paint an operation
     *
     * @param context the paint context used to paint the operation
     */
    void apply(@NonNull RemoteContext context);

    /** Debug utility to display an operation + indentation */
    @NonNull
    String deepToString(@NonNull String indent);
}
+9 −0
Original line number Original line Diff line number Diff line
@@ -55,7 +55,10 @@ import com.android.internal.widget.remotecompose.core.operations.MatrixSkew;
import com.android.internal.widget.remotecompose.core.operations.MatrixTranslate;
import com.android.internal.widget.remotecompose.core.operations.MatrixTranslate;
import com.android.internal.widget.remotecompose.core.operations.NamedVariable;
import com.android.internal.widget.remotecompose.core.operations.NamedVariable;
import com.android.internal.widget.remotecompose.core.operations.PaintData;
import com.android.internal.widget.remotecompose.core.operations.PaintData;
import com.android.internal.widget.remotecompose.core.operations.PathAppend;
import com.android.internal.widget.remotecompose.core.operations.PathCreate;
import com.android.internal.widget.remotecompose.core.operations.PathData;
import com.android.internal.widget.remotecompose.core.operations.PathData;
import com.android.internal.widget.remotecompose.core.operations.PathTween;
import com.android.internal.widget.remotecompose.core.operations.RootContentBehavior;
import com.android.internal.widget.remotecompose.core.operations.RootContentBehavior;
import com.android.internal.widget.remotecompose.core.operations.RootContentDescription;
import com.android.internal.widget.remotecompose.core.operations.RootContentDescription;
import com.android.internal.widget.remotecompose.core.operations.ShaderData;
import com.android.internal.widget.remotecompose.core.operations.ShaderData;
@@ -178,6 +181,9 @@ public class Operations {
    public static final int TEXT_MEASURE = 155;
    public static final int TEXT_MEASURE = 155;
    public static final int TEXT_LENGTH = 156;
    public static final int TEXT_LENGTH = 156;
    public static final int TOUCH_EXPRESSION = 157;
    public static final int TOUCH_EXPRESSION = 157;
    public static final int PATH_TWEEN = 158;
    public static final int PATH_CREATE = 159;
    public static final int PATH_ADD = 160;


    ///////////////////////////////////////// ======================
    ///////////////////////////////////////// ======================


@@ -353,5 +359,8 @@ public class Operations {
        map.put(TEXT_MEASURE, TextMeasure::read);
        map.put(TEXT_MEASURE, TextMeasure::read);
        map.put(TEXT_LENGTH, TextLength::read);
        map.put(TEXT_LENGTH, TextLength::read);
        map.put(TOUCH_EXPRESSION, TouchExpression::read);
        map.put(TOUCH_EXPRESSION, TouchExpression::read);
        map.put(PATH_TWEEN, PathTween::read);
        map.put(PATH_CREATE, PathCreate::read);
        map.put(PATH_ADD, PathAppend::read);
    }
    }
}
}
+2 −0
Original line number Original line Diff line number Diff line
@@ -157,6 +157,8 @@ public abstract class PaintContext {
    public abstract void drawTweenPath(
    public abstract void drawTweenPath(
            int path1Id, int path2Id, float tween, float start, float stop);
            int path1Id, int path2Id, float tween, float start, float stop);


    public abstract void tweenPath(int out, int path1, int path2, float tween);

    /**
    /**
     * This applies changes to the current paint
     * This applies changes to the current paint
     *
     *
+1 −1
Original line number Original line Diff line number Diff line
@@ -21,7 +21,7 @@ import android.annotation.NonNull;
 * PaintOperation interface, used for operations aimed at painting (while any operation _can_ paint,
 * PaintOperation interface, used for operations aimed at painting (while any operation _can_ paint,
 * this make it a little more explicit)
 * this make it a little more explicit)
 */
 */
public abstract class PaintOperation implements Operation {
public abstract class PaintOperation extends Operation {


    @Override
    @Override
    public void apply(@NonNull RemoteContext context) {
    public void apply(@NonNull RemoteContext context) {
Loading