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

Commit 9a879d4a authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 6154573 from db7802b3 to rvc-release

Change-Id: I95f0c6203ba871e74115b91eab71ab04b133ee2d
parents aed22d55 db7802b3
Loading
Loading
Loading
Loading
+30 −1
Original line number Diff line number Diff line
@@ -79,6 +79,14 @@ enum {
    ANDROID_BITMAP_FLAGS_ALPHA_SHIFT    = 0,
};

enum {
    /** If this bit is set in AndroidBitmapInfo.flags, the Bitmap uses the
      * HARDWARE Config, and its AHardwareBuffer can be retrieved via
      * AndroidBitmap_getHardwareBuffer.
      */
    ANDROID_BITMAP_FLAGS_IS_HARDWARE = 1 << 31,
};

/** Bitmap info, see AndroidBitmap_getInfo(). */
typedef struct {
    /** The bitmap width in pixels. */
@@ -90,7 +98,9 @@ typedef struct {
    /** The bitmap pixel format. See {@link AndroidBitmapFormat} */
    int32_t     format;
    /** Two bits are used to encode alpha. Use ANDROID_BITMAP_FLAGS_ALPHA_MASK
      * and ANDROID_BITMAP_FLAGS_ALPHA_SHIFT to retrieve them. */
      * and ANDROID_BITMAP_FLAGS_ALPHA_SHIFT to retrieve them. One bit is used
      * to encode whether the Bitmap uses the HARDWARE Config. Use
      * ANDROID_BITMAP_FLAGS_IS_HARDWARE to know.*/
    uint32_t    flags;
} AndroidBitmapInfo;

@@ -210,6 +220,25 @@ int AndroidBitmap_compress(const AndroidBitmapInfo* info,
                           void* userContext,
                           AndroidBitmap_compress_write_fn fn) __INTRODUCED_IN(30);

struct AHardwareBuffer;

/**
 *  Retrieve the native object associated with a HARDWARE Bitmap.
 *
 *  Client must not modify it while a Bitmap is wrapping it.
 *
 *  @param bitmap Handle to an android.graphics.Bitmap.
 *  @param outBuffer On success, is set to a pointer to the
 *         AHardwareBuffer associated with bitmap. This acquires
 *         a reference on the buffer, and the client must call
 *         AHardwareBuffer_release when finished with it.
 *  @return AndroidBitmap functions result code.
 *          ANDROID_BITMAP_RESULT_BAD_PARAMETER if bitmap is not a
 *          HARDWARE Bitmap.
 */
int AndroidBitmap_getHardwareBuffer(JNIEnv* env, jobject bitmap,
        AHardwareBuffer** outBuffer) __INTRODUCED_IN(30);

#endif // __ANDROID_API__ >= 30

#ifdef __cplusplus
+60 −0
Original line number Diff line number Diff line
@@ -158,6 +158,25 @@ int AImageDecoder_setAndroidBitmapFormat(AImageDecoder*,
 */
int AImageDecoder_setUnpremultipliedRequired(AImageDecoder*, bool required) __INTRODUCED_IN(30);

/**
 * Choose the dataspace for the output.
 *
 * Not supported for {@link ANDROID_BITMAP_FORMAT_A_8}, which does not support
 * an ADataSpace.
 *
 * @param dataspace The {@link ADataSpace} to decode into. An ADataSpace
 *                  specifies how to interpret the colors. By default,
 *                  AImageDecoder will decode into the ADataSpace specified by
 *                  {@link AImageDecoderHeaderInfo_getDataSpace}. If this
 *                  parameter is set to a different ADataSpace, AImageDecoder
 *                  will transform the output into the specified ADataSpace.
 * @return - {@link ANDROID_IMAGE_DECODER_SUCCESS} on success
 *         - {@link ANDROID_IMAGE_DECODER_BAD_PARAMETER} for a null
 *           AImageDecoder or an integer that does not correspond to an
 *           ADataSpace value.
 */
int AImageDecoder_setDataSpace(AImageDecoder*, int32_t dataspace) __INTRODUCED_IN(30);

/**
 * Specify the output size for a decoded image.
 *
@@ -179,6 +198,28 @@ int AImageDecoder_setUnpremultipliedRequired(AImageDecoder*, bool required) __IN
 */
int AImageDecoder_setTargetSize(AImageDecoder*, int width, int height) __INTRODUCED_IN(30);


/**
 * Compute the dimensions to use for a given sampleSize.
 *
 * Although AImageDecoder can scale to an arbitrary target size (see
 * {@link AImageDecoder_setTargetSize}), some sizes may be more efficient than
 * others. This computes the most efficient target size to use to reach a
 * particular sampleSize.
 *
 * @param sampleSize A subsampling rate of the original image. Must be greater
 *                   than or equal to 1. A sampleSize of 2 means to skip every
 *                   other pixel/line, resulting in a width and height that are
 *                   1/2 of the original dimensions, with 1/4 the number of
 *                   pixels.
 * @param width Out parameter for the width sampled by sampleSize, and rounded
 *              direction that the decoder can do most efficiently.
 * @param height Out parameter for the height sampled by sampleSize, and rounded
 *               direction that the decoder can do most efficiently.
 * @return ANDROID_IMAGE_DECODER result code.
 */
int AImageDecoder_computeSampledSize(const AImageDecoder*, int sampleSize,
                                     int* width, int* height) __INTRODUCED_IN(30);
/**
 * Specify how to crop the output after scaling (if any).
 *
@@ -260,6 +301,25 @@ AndroidBitmapFormat AImageDecoderHeaderInfo_getAndroidBitmapFormat(
int AImageDecoderHeaderInfo_getAlphaFlags(
        const AImageDecoderHeaderInfo*) __INTRODUCED_IN(30);

/**
 * Report the dataspace the AImageDecoder will decode to by default.
 * AImageDecoder will try to choose one that is sensible for the
 * image and the system. Note that this may not exactly match the ICC
 * profile (or other color information) stored in the encoded image.
 *
 * @return The {@link ADataSpace} most closely representing the way the colors
 *         are encoded (or {@link ADATASPACE_UNKNOWN} if there is not an
 *         approximate ADataSpace). This specifies how to interpret the colors
 *         in the decoded image, unless {@link AImageDecoder_setDataSpace} is
 *         called to decode to a different ADataSpace.
 *
 *         Note that ADataSpace only exposes a few values. This may return
 *         ADATASPACE_UNKNOWN, even for Named ColorSpaces, if they have no
 *         corresponding ADataSpace.
 */
int32_t AImageDecoderHeaderInfo_getDataSpace(
        const AImageDecoderHeaderInfo*) __INTRODUCED_IN(30);

/**
 * Return the minimum stride that can be used, taking the specified
 * (or default) (possibly scaled) width, crop rect and
+4 −0
Original line number Diff line number Diff line
adyabr@google.com
akrulec@google.com
alecmouri@google.com
jessehall@google.com
jwcai@google.com
lpy@google.com
@@ -6,3 +9,4 @@ mathias@google.com
racarr@google.com
steventhomas@google.com
stoza@google.com
vhau@google.com
+4 −2
Original line number Diff line number Diff line
@@ -239,6 +239,8 @@ bool BufferStateLayer::setBuffer(const sp<GraphicBuffer>& buffer, nsecs_t postTi
        mReleasePreviousBuffer = true;
    }

    mFrameCounter++;

    mCurrentState.buffer = buffer;
    mCurrentState.clientCacheId = clientCacheId;
    mCurrentState.modified = true;
@@ -496,6 +498,8 @@ status_t BufferStateLayer::updateTexImage(bool& /*recomputeVisibleRegions*/, nse
        handle->latchTime = latchTime;
    }

    mFrameNumber = mFrameCounter;

    if (!SyncFeatures::getInstance().useNativeFenceSync()) {
        // Bind the new buffer to the GL texture.
        //
@@ -557,8 +561,6 @@ void BufferStateLayer::latchPerFrameState(
    compositionState.buffer = mBufferInfo.mBuffer;
    compositionState.bufferSlot = mBufferInfo.mBufferSlot;
    compositionState.acquireFence = mBufferInfo.mFence;

    mFrameNumber++;
}

void BufferStateLayer::HwcSlotGenerator::bufferErased(const client_cache_t& clientCacheId) {
+1 −0
Original line number Diff line number Diff line
@@ -142,6 +142,7 @@ private:
    std::atomic<bool> mSidebandStreamChanged{false};

    mutable uint32_t mFrameNumber{0};
    uint64_t mFrameCounter{0};

    sp<Fence> mPreviousReleaseFence;
    uint64_t mPreviousBufferId = 0;
Loading