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

Commit 65cd612f authored by Chris Craik's avatar Chris Craik
Browse files

Add cap tessellation support

bug:7117155
bug:8114304

Currently used for lines (with and without AA) and arcs with useCenter=false

Also removes 0.375, 0.375 offset for AA lines

Change-Id: Ic8ace418739344db1e2814edf65253fe7448b0b0
parent c93c6aa5
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -21,10 +21,10 @@ ifeq ($(USE_OPENGL_RENDERER),true)
		LayerRenderer.cpp \
		Matrix.cpp \
		OpenGLRenderer.cpp \
		PathRenderer.cpp \
		Patch.cpp \
		PatchCache.cpp \
		PathCache.cpp \
		PathTessellator.cpp \
		Program.cpp \
		ProgramCache.cpp \
		ResourceCache.cpp \
+0 −1
Original line number Diff line number Diff line
@@ -66,7 +66,6 @@ static const TextureVertex gMeshVertices[] = {
static const GLsizei gMeshStride = sizeof(TextureVertex);
static const GLsizei gVertexStride = sizeof(Vertex);
static const GLsizei gAlphaVertexStride = sizeof(AlphaVertex);
static const GLsizei gAAVertexStride = sizeof(AAVertex);
static const GLsizei gMeshTextureOffset = 2 * sizeof(float);
static const GLsizei gVertexAlphaOffset = 2 * sizeof(float);
static const GLsizei gVertexAAWidthOffset = 2 * sizeof(float);
+55 −346

File changed.

Preview size limit exceeded, changes collapsed.

+12 −5
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ namespace uirenderer {
///////////////////////////////////////////////////////////////////////////////

class DisplayList;
class VertexBuffer;

/**
 * OpenGL renderer used to draw accelerated 2D graphics. The API is a
@@ -581,13 +582,23 @@ private:
     */
    void drawAlphaBitmap(Texture* texture, float left, float top, SkPaint* paint);

    /**
     * Renders a strip of polygons with the specified paint, used for tessellated geometry.
     *
     * @param vertexBuffer The VertexBuffer to be drawn
     * @param paint The paint to render with
     * @param useOffset Offset the vertexBuffer (used in drawing non-AA lines)
     */
    status_t drawVertexBuffer(const VertexBuffer& vertexBuffer, SkPaint* paint,
            bool useOffset = false);

    /**
     * Renders the convex hull defined by the specified path as a strip of polygons.
     *
     * @param path The hull of the path to draw
     * @param paint The paint to render with
     */
    void drawConvexPath(const SkPath& path, SkPaint* paint);
    status_t drawConvexPath(const SkPath& path, SkPaint* paint);

    /**
     * Draws a textured rectangle with the specified texture. The specified coordinates
@@ -754,7 +765,6 @@ private:
    void setupDrawWithExternalTexture();
    void setupDrawNoTexture();
    void setupDrawAA();
    void setupDrawVertexShape();
    void setupDrawPoint(float pointSize);
    void setupDrawColor(int color, int alpha);
    void setupDrawColor(float r, float g, float b, float a);
@@ -788,9 +798,6 @@ private:
    void setupDrawMesh(GLvoid* vertices, GLvoid* texCoords = NULL, GLuint vbo = 0);
    void setupDrawMeshIndices(GLvoid* vertices, GLvoid* texCoords);
    void setupDrawVertices(GLvoid* vertices);
    void setupDrawAALine(GLvoid* vertices, GLvoid* distanceCoords, GLvoid* lengthCoords,
            float strokeWidth, int& widthSlot, int& lengthSlot);
    void finishDrawAALine(const int widthSlot, const int lengthSlot);
    void finishDrawTexture();
    void accountForClear(SkXfermode::Mode mode);

+970 −0

File changed and moved.

Preview size limit exceeded, changes collapsed.

Loading