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

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

Merge "Fix colored rects clipping and code cleanup" into jb-mr2-dev

parents ad4a174b 3b753829
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -454,6 +454,14 @@ void Matrix4::mapRect(Rect& r) const {
    }
}

void Matrix4::decomposeScale(float& sx, float& sy) const {
    float len;
    len = data[mat4::kScaleX] * data[mat4::kScaleX] + data[mat4::kSkewX] * data[mat4::kSkewX];
    sx = copysignf(sqrtf(len), data[mat4::kScaleX]);
    len = data[mat4::kScaleY] * data[mat4::kScaleY] + data[mat4::kSkewY] * data[mat4::kSkewY];
    sy = copysignf(sqrtf(len), data[mat4::kScaleY]);
}

void Matrix4::dump() const {
    ALOGD("Matrix4[simple=%d, type=0x%x", isSimple(), getType());
    ALOGD("  %f %f %f %f", data[kScaleX], data[kSkewX], data[8], data[kTranslateX]);
+16 −0
Original line number Diff line number Diff line
@@ -79,6 +79,20 @@ public:
        load(v);
    }

    float operator[](int index) const {
        return data[index];
    }

    float& operator[](int index) {
        mType = kTypeUnknown;
        return data[index];
    }

    Matrix4& operator=(const SkMatrix& v) {
        load(v);
        return *this;
    }

    void loadIdentity();

    void load(const float* v);
@@ -150,6 +164,8 @@ public:
    float getTranslateX();
    float getTranslateY();

    void decomposeScale(float& sx, float& sy) const;

    void dump() const;

    static const Matrix4& identity();
+91 −90

File changed.

Preview size limit exceeded, changes collapsed.

+4 −0
Original line number Diff line number Diff line
@@ -903,6 +903,10 @@ private:
        mDirtyClip = true;
    }

    inline mat4& currentTransform() const {
        return *mSnapshot->transform;
    }

    // Dimensions of the drawing surface
    int mWidth, mHeight;