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

Commit c2f31df8 authored by Mike Reed's avatar Mike Reed Committed by Derek Sollenberger
Browse files

use SkBlendMode

skbug.com/5814

Test: compile only
Change-Id: Ibbaff43df1117b2ca77fd8f917f03d88cc476330
(cherry picked from commit 26edbcba8a2ed4cb300e7f87e679e3b73cec2772)
parent 0863156e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@
#include "SkPathEffect.h"
#include "SkRasterizer.h"
#include "SkShader.h"
#include "SkXfermode.h"
#include "SkBlendMode.h"
#include "unicode/uloc.h"
#include "unicode/ushape.h"
#include "utils/Blur.h"
+2 −2
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@
#include "SkGradientShader.h"
#include "SkImagePriv.h"
#include "SkShader.h"
#include "SkXfermode.h"
#include "SkBlendMode.h"
#include "core_jni_helpers.h"

#include <Caches.h>
@@ -237,7 +237,7 @@ static jlong ComposeShader_create(JNIEnv* env, jobject o,
    SkBlendMode mode = static_cast<SkBlendMode>(xfermodeHandle);
    SkShader* shader = SkShader::MakeComposeShader(sk_ref_sp(shaderA),
                                                   sk_ref_sp(shaderB),
                                                   (SkXfermode::Mode)mode).release();
                                                   mode).release();
    return reinterpret_cast<jlong>(shader);
}

+1 −1
Original line number Diff line number Diff line
@@ -29,7 +29,7 @@
#include <SkBitmap.h>
#include <SkCanvas.h>
#include <SkMatrix.h>
#include <SkXfermode.h>
#include <SkBlendMode.h>

#include <DeferredLayerUpdater.h>
#include <SkiaShader.h>
+0 −1
Original line number Diff line number Diff line
@@ -25,7 +25,6 @@

#include <GLES2/gl2.h>
#include <GLES2/gl2ext.h>
#include <SkXfermode.h>

namespace android {
namespace uirenderer {
+4 −4
Original line number Diff line number Diff line
@@ -257,7 +257,7 @@ void GlopBuilder::setFill(int color, float alphaScale,
            // If the blend mode cannot be implemented using shaders, fall
            // back to the default SrcOver blend mode instead
            if (CC_UNLIKELY(mCaches.extensions().hasFramebufferFetch())) {
                mDescription.framebufferMode = (SkXfermode::Mode)mode;
                mDescription.framebufferMode = mode;
                mDescription.swapSrcDst = (modeUsage == Blend::ModeOrderSwap::Swap);
                // blending in shader, don't enable
            } else {
@@ -271,11 +271,11 @@ void GlopBuilder::setFill(int color, float alphaScale,

    if (colorFilter) {
        SkColor color;
        SkXfermode::Mode xmode;
        SkBlendMode bmode;
        SkScalar srcColorMatrix[20];
        if (colorFilter->asColorMode(&color, &xmode)) {
        if (colorFilter->asColorMode(&color, &bmode)) {
            mOutGlop->fill.filterMode = mDescription.colorOp = ProgramDescription::ColorFilterMode::Blend;
            mDescription.colorMode = xmode;
            mDescription.colorMode = bmode;
            mOutGlop->fill.filter.color.set(color);
        } else if (colorFilter->asColorMatrix(srcColorMatrix)) {
            mOutGlop->fill.filterMode = mDescription.colorOp = ProgramDescription::ColorFilterMode::Matrix;
Loading