void FrameInfoVisualizer::draw(IProfileRenderer& renderer) {
    RETURN_IF_DISABLED();

    if (mShowDirtyRegions) {
        mFlashToggle = !mFlashToggle;
        if (mFlashToggle) {
            SkPaint paint;
            paint.setColor(0x7fff0000);
            renderer.drawRect(mDirtyRegion.fLeft, mDirtyRegion.fTop, mDirtyRegion.fRight,
                              mDirtyRegion.fBottom, paint);
        }
    }

    if (mType == ProfileType::Bars) {
        // Patch up the current frame to pretend we ended here. CanvasContext
        // will overwrite these values with the real ones after we return.
        // This is a bit nicer looking than the vague green bar, as we have
        // valid data for almost all the stages and a very good idea of what
        // the issue stage will look like, too
        FrameInfo& info = mFrameSource.back();
        info.markSwapBuffers();
        info.markFrameCompleted();

        initializeRects(renderer.getViewportHeight(), renderer.getViewportWidth());
        drawGraph(renderer);
        drawThreshold(renderer);
    }
}
void DrawProfiler::draw(OpenGLRenderer* canvas) {
    RETURN_IF_DISABLED();

    if (mShowDirtyRegions) {
        mFlashToggle = !mFlashToggle;
        if (mFlashToggle) {
            SkPaint paint;
            paint.setColor(0x7fff0000);
            canvas->drawRect(mDirtyRegion.fLeft, mDirtyRegion.fTop,
                    mDirtyRegion.fRight, mDirtyRegion.fBottom, &paint);
        }
    }

    if (mType == kBars) {
        prepareShapes(canvas->getViewportHeight());
        drawGraph(canvas);
        drawCurrentFrame(canvas);
        drawThreshold(canvas);
    }
}
    void CharacterKey::draw(
            glm::vec4 color,
            glm::vec4 pickColor,
            glm::vec4 iconColor,
			glm::vec4 thresholdColor,
			float threshold,
            float alpha) const
    {
        // Draw circle of key
        drawCircle(
            color,
            pickColor,
            alpha);

        // Render character
        mpQuadShader->bind();
        glBindVertexArray(mQuadVertexArrayObject);

        // Bind atlas texture
        mpFont->bindAtlasTexture(FontSize::KEYBOARD, 1, true);

        // Fill color
        glm::vec4 characterColor = iconColor;
        characterColor.a *= alpha;
        mpQuadShader->fillValue("color", characterColor);

        // Fill other uniforms
        mpQuadShader->fillValue("matrix", mQuadMatrix); // Matrix is updated in transform and size
        mpQuadShader->fillValue("atlas", 1);

        // Draw character quad (vertex count must be 6)
        glDrawArrays(GL_TRIANGLES, 0, 6);

		// Draw threshold
		drawThreshold(
			thresholdColor,
			threshold,
			alpha);
    }