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

Commit 3b8e25af authored by Chris Craik's avatar Chris Craik Committed by Android (Google) Code Review
Browse files

Merge "Remove legacy enable/disable methods from Blend"

parents 571b9da8 8e5ca2a9
Loading
Loading
Loading
Loading
+6 −15
Original line number Diff line number Diff line
@@ -98,20 +98,6 @@ Blend::Blend()
    // gl blending off by default
}

void Blend::enable(SkXfermode::Mode mode, ModeOrderSwap modeUsage) {
    GLenum srcMode;
    GLenum dstMode;
    getFactors(mode, modeUsage, &srcMode, &dstMode);
    setFactors(srcMode, dstMode);
}

void Blend::disable() {
    if (mEnabled) {
        glDisable(GL_BLEND);
        mEnabled = false;
    }
}

void Blend::invalidate() {
    syncEnabled();
    mSrcMode = mDstMode = GL_ZERO;
@@ -132,8 +118,13 @@ void Blend::getFactors(SkXfermode::Mode mode, ModeOrderSwap modeUsage, GLenum* o

void Blend::setFactors(GLenum srcMode, GLenum dstMode) {
    if (srcMode == GL_ZERO && dstMode == GL_ZERO) {
        disable();
        // disable blending
        if (mEnabled) {
            glDisable(GL_BLEND);
            mEnabled = false;
        }
    } else {
        // enable blending
        if (!mEnabled) {
            glEnable(GL_BLEND);
            mEnabled = true;
+0 −3
Original line number Diff line number Diff line
@@ -34,9 +34,6 @@ public:
        NoSwap,
        Swap,
    };

    void enable(SkXfermode::Mode mode, ModeOrderSwap modeUsage);
    void disable();
    void syncEnabled();

    static void getFactors(SkXfermode::Mode mode, ModeOrderSwap modeUsage,