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

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

Merge "Minor cleanups around color usage" into lmp-dev

parents 67124952 98d608db
Loading
Loading
Loading
Loading
+9 −6
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
    #define LOG_TAG "OpenGLRenderer"
#endif

#include <SkColor.h>
#include <SkPath.h>
#include <SkPathOps.h>
#include <SkXfermode.h>
@@ -1315,7 +1316,7 @@ public:
        FontRenderer& fontRenderer = renderer.getCaches().fontRenderer->getFontRenderer(paint);
        fontRenderer.precache(paint, mText, mCount, SkMatrix::I());

        deferInfo.batchId = mPaint->getColor() == 0xff000000 ?
        deferInfo.batchId = mPaint->getColor() == SK_ColorBLACK ?
                DeferredDisplayList::kOpBatch_Text :
                DeferredDisplayList::kOpBatch_ColorText;
    }
@@ -1385,17 +1386,19 @@ public:
            fontRenderer.precache(paint, mText, mCount, transform);
            mPrecacheTransform = transform;
        }
        deferInfo.batchId = mPaint->getColor() == 0xff000000 ?
        deferInfo.batchId = mPaint->getColor() == SK_ColorBLACK ?
                DeferredDisplayList::kOpBatch_Text :
                DeferredDisplayList::kOpBatch_ColorText;

        deferInfo.mergeId = reinterpret_cast<mergeid_t>(mPaint->getColor());

        // don't merge decorated text - the decorations won't draw in order
        bool noDecorations = !(mPaint->getFlags() & (SkPaint::kUnderlineText_Flag |
                        SkPaint::kStrikeThruText_Flag));
        deferInfo.mergeable = state.mMatrix.isPureTranslate() && noDecorations &&
                OpenGLRenderer::getXfermodeDirect(mPaint) == SkXfermode::kSrcOver_Mode;
        bool hasDecorations = mPaint->getFlags()
                & (SkPaint::kUnderlineText_Flag | SkPaint::kStrikeThruText_Flag);

        deferInfo.mergeable = state.mMatrix.isPureTranslate()
                && !hasDecorations
                && OpenGLRenderer::getXfermodeDirect(mPaint) == SkXfermode::kSrcOver_Mode;
    }

    virtual status_t applyDraw(OpenGLRenderer& renderer, Rect& dirty) {
+2 −1
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@
#include <sys/types.h>

#include <SkCanvas.h>
#include <SkColor.h>
#include <SkShader.h>
#include <SkTypeface.h>

@@ -1462,7 +1463,7 @@ void OpenGLRenderer::setStencilFromClip() {
            mSkipOutlineClip = true;

            SkPaint paint;
            paint.setColor(0xff000000);
            paint.setColor(SK_ColorBLACK);
            paint.setXfermodeMode(SkXfermode::kSrc_Mode);

            // NOTE: We could use the region contour path to generate a smaller mesh
+2 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@

#include <SkBitmap.h>
#include <SkCanvas.h>
#include <SkColor.h>
#include <SkPaint.h>
#include <SkPath.h>
#include <SkRect.h>
@@ -111,7 +112,7 @@ static void initBitmap(SkBitmap& bitmap, uint32_t width, uint32_t height) {
static void initPaint(SkPaint& paint) {
    // Make sure the paint is opaque, color, alpha, filter, etc.
    // will be applied later when compositing the alpha8 texture
    paint.setColor(0xff000000);
    paint.setColor(SK_ColorBLACK);
    paint.setAlpha(255);
    paint.setColorFilter(NULL);
    paint.setMaskFilter(NULL);