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

Commit 885153e2 authored by Romain Guy's avatar Romain Guy
Browse files

Add more debug info for profiling.

Change-Id: I0c74e2aa108142cc6ddac4577ae2d0fe6c0ddb25
parent 270cbcc1
Loading
Loading
Loading
Loading
+30 −2
Original line number Diff line number Diff line
@@ -23,10 +23,11 @@
namespace android {
namespace uirenderer {

void OpenGLDebugRenderer::prepare(bool opaque) {
void OpenGLDebugRenderer::prepareDirty(float left, float top,
        float right, float bottom, bool opaque) {
    mPrimitivesCount = 0;
    LOGD("========= Frame start =========");
    OpenGLRenderer::prepare(opaque);
    OpenGLRenderer::prepareDirty(left, top, right, bottom, opaque);
}

void OpenGLDebugRenderer::finish() {
@@ -105,6 +106,33 @@ void OpenGLDebugRenderer::drawRect(float left, float top, float right, float bot
    OpenGLRenderer::drawRect(left, top, right, bottom, paint);
}

void OpenGLDebugRenderer::drawRoundRect(float left, float top, float right, float bottom,
        float rx, float ry, SkPaint* paint) {
    mPrimitivesCount++;
    StopWatch w("drawRoundRect");
    OpenGLRenderer::drawRoundRect(left, top, right, bottom, rx, ry, paint);
}

void OpenGLDebugRenderer::drawCircle(float x, float y, float radius, SkPaint* paint) {
    mPrimitivesCount++;
    StopWatch w("drawCircle");
    OpenGLRenderer::drawCircle(x, y, radius, paint);
}

void OpenGLDebugRenderer::drawOval(float left, float top, float right, float bottom,
        SkPaint* paint) {
    mPrimitivesCount++;
    StopWatch w("drawOval");
    OpenGLRenderer::drawOval(left, top, right, bottom, paint);
}

void OpenGLDebugRenderer::drawArc(float left, float top, float right, float bottom,
        float startAngle, float sweepAngle, bool useCenter, SkPaint* paint) {
    mPrimitivesCount++;
    StopWatch w("drawArc");
    OpenGLRenderer::drawArc(left, top, right, bottom, startAngle, sweepAngle, useCenter, paint);
}

void OpenGLDebugRenderer::drawPath(SkPath* path, SkPaint* paint) {
    mPrimitivesCount++;
    StopWatch w("drawPath");
+7 −1
Original line number Diff line number Diff line
@@ -34,7 +34,7 @@ public:
    ~OpenGLDebugRenderer() {
    }

    void prepare(bool opaque);
    void prepareDirty(float left, float top, float right, float bottom, bool opaque);
    void finish();

    int saveLayer(float left, float top, float right, float bottom,
@@ -52,6 +52,12 @@ public:
            float left, float top, float right, float bottom, SkPaint* paint);
    void drawColor(int color, SkXfermode::Mode mode);
    void drawRect(float left, float top, float right, float bottom, SkPaint* paint);
    void drawRoundRect(float left, float top, float right, float bottom,
            float rx, float ry, SkPaint* paint);
    void drawCircle(float x, float y, float radius, SkPaint* paint);
    void drawOval(float left, float top, float right, float bottom, SkPaint* paint);
    void drawArc(float left, float top, float right, float bottom,
            float startAngle, float sweepAngle, bool useCenter, SkPaint* paint);
    void drawPath(SkPath* path, SkPaint* paint);
    void drawLines(float* points, int count, SkPaint* paint);
    void drawText(const char* text, int bytesCount, int count, float x, float y,