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

Commit 9d13fe25 authored by Romain Guy's avatar Romain Guy
Browse files

Fix text rendering artifact.

Change-Id: I50f47207846e4208d363dde4e8f5f1a0f23d2d75
parent e5ebcb01
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -865,6 +865,10 @@ void OpenGLRenderer::drawText(const char* text, int bytesCount, int count,
    fontRenderer.setFont(paint, SkTypeface::UniqueID(paint->getTypeface()),
            paint->getTextSize());

    Rect clipRect(*mSnapshot->clipRect);
    glScissor(clipRect.left, mSnapshot->height - clipRect.bottom,
            clipRect.getWidth(), clipRect.getHeight());

    if (mHasShadow) {
        glActiveTexture(gTextureUnits[0]);
        mCaches.dropShadowCache.setFontRenderer(fontRenderer);
@@ -889,12 +893,15 @@ void OpenGLRenderer::drawText(const char* text, int bytesCount, int count,

    const Rect& clip = mSnapshot->getLocalClip();
    clearLayerRegions();

    fontRenderer.renderText(paint, &clip, text, 0, bytesCount, count, x, y);

    glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
    glDisableVertexAttribArray(mCaches.currentProgram->getAttrib("texCoords"));

    drawTextDecorations(text, bytesCount, length, x, y, paint);

    setScissorFromClip();
}

void OpenGLRenderer::drawPath(SkPath* path, SkPaint* paint) {