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

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

Merge "Fix hairline rendering."

parents 73a7a1c5 67ac217a
Loading
Loading
Loading
Loading
+12 −14
Original line number Diff line number Diff line
@@ -1426,27 +1426,25 @@ void OpenGLRenderer::drawLines(float* points, int count, SkPaint* paint) {
    } else {
        // TODO: Handle the AA case
        for (int i = 0; i < count; i += 4) {
            const float left = fmin(points[i], points[i + 1]);
            const float right = fmax(points[i], points[i + 1]);
            const float top = fmin(points[i + 2], points[i + 3]);
            const float bottom = fmax(points[i + 2], points[i + 3]);

            if (!quickReject(left, top, right, bottom)) {
            TextureVertex::set(vertex++, points[i], points[i + 1], 0.0f, 0.0f);
            TextureVertex::set(vertex++, points[i + 2], points[i + 3], 0.0f, 0.0f);

            generatedVerticesCount += 2;

                dirtyLayer(left, top, right, bottom, *mSnapshot->transform);
            }
            const float left = fmin(points[i], points[i + 2]);
            const float right = fmax(points[i], points[i + 2]);
            const float top = fmin(points[i + 1], points[i + 3]);
            const float bottom = fmax(points[i + 1], points[i + 3]);

            dirtyLayer(left, top,
                    right == left ? left + 1 : right, bottom == top ? top + 1 : bottom,
                    *mSnapshot->transform);
        }

        if (generatedVerticesCount > 0) {
        glLineWidth(1.0f);
        glDrawArrays(GL_LINES, 0, generatedVerticesCount);
    }
}
}

void OpenGLRenderer::drawColor(int color, SkXfermode::Mode mode) {
    // No need to check against the clip, we fill the clip region