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

Commit ee5461cc authored by Romain Guy's avatar Romain Guy Committed by Android (Google) Code Review
Browse files

Merge "Various fixes for wide color gamut rendering"

parents 76dd2a70 88d37dda
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -271,6 +271,7 @@ public:
    uint32_t getStride() const;
    // size of allocated memory in bytes
    size_t getSize() const;
    android_dataspace getDataSpace() const;
};

// ---------------------------------------------------------------------------
+4 −0
Original line number Diff line number Diff line
@@ -1080,5 +1080,9 @@ size_t ScreenshotClient::getSize() const {
    return mBuffer.stride * mBuffer.height * bytesPerPixel(mBuffer.format);
}

android_dataspace ScreenshotClient::getDataSpace() const {
    return mBuffer.dataSpace;
}

// ----------------------------------------------------------------------------
}; // namespace android
+2 −2
Original line number Diff line number Diff line
@@ -342,9 +342,9 @@ TQuaternion<typename MATRIX::value_type> extractQuat(const MATRIX& mat) {
template <typename MATRIX>
String8 asString(const MATRIX& m) {
    String8 s;
    for (size_t c = 0; c < MATRIX::col_size(); c++) {
    for (size_t c = 0; c < MATRIX::COL_SIZE; c++) {
        s.append("|  ");
        for (size_t r = 0; r < MATRIX::row_size(); r++) {
        for (size_t r = 0; r < MATRIX::ROW_SIZE; r++) {
            s.appendFormat("%7.2f  ", m[r][c]);
        }
        s.append("|\n");
+7 −15
Original line number Diff line number Diff line
@@ -26,8 +26,7 @@

namespace android {

Description::Description() :
    mUniformsDirty(true) {
Description::Description() {
    mPlaneAlpha = 1.0f;
    mPremultipliedAlpha = false;
    mOpaque = true;
@@ -41,28 +40,20 @@ Description::~Description() {
}

void Description::setPlaneAlpha(GLclampf planeAlpha) {
    if (planeAlpha != mPlaneAlpha) {
        mUniformsDirty = true;
    mPlaneAlpha = planeAlpha;
}
}

void Description::setPremultipliedAlpha(bool premultipliedAlpha) {
    if (premultipliedAlpha != mPremultipliedAlpha) {
    mPremultipliedAlpha = premultipliedAlpha;
}
}

void Description::setOpaque(bool opaque) {
    if (opaque != mOpaque) {
    mOpaque = opaque;
}
}

void Description::setTexture(const Texture& texture) {
    mTexture = texture;
    mTextureEnabled = true;
    mUniformsDirty = true;
}

void Description::disableTexture() {
@@ -74,12 +65,10 @@ void Description::setColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf
    mColor[1] = green;
    mColor[2] = blue;
    mColor[3] = alpha;
    mUniformsDirty = true;
}

void Description::setProjectionMatrix(const mat4& mtx) {
    mProjectionMatrix = mtx;
    mUniformsDirty = true;
}

void Description::setColorMatrix(const mat4& mtx) {
@@ -92,5 +81,8 @@ const mat4& Description::getColorMatrix() const {
    return mColorMatrix;
}

void Description::setWideGamut(bool wideGamut) {
    mIsWideGamut = wideGamut;
}

} /* namespace android */
+3 −3
Original line number Diff line number Diff line
@@ -54,6 +54,8 @@ class Description {
    bool mColorMatrixEnabled;
    mat4 mColorMatrix;

    bool mIsWideGamut;

public:
    Description();
    ~Description();
@@ -67,9 +69,7 @@ public:
    void setProjectionMatrix(const mat4& mtx);
    void setColorMatrix(const mat4& mtx);
    const mat4& getColorMatrix() const;

private:
    bool mUniformsDirty;
    void setWideGamut(bool wideGamut);
};

} /* namespace android */
Loading