Donner 0.8.0-pre
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
LayerInspectorDiagnostics.h File Reference
#include <cstdint>
#include <span>
#include <string>
#include <string_view>
#include "donner/base/Box.h"
#include "donner/base/Vector2.h"
#include "donner/svg/compositor/CompositorController.h"
Include dependency graph for LayerInspectorDiagnostics.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  donner::editor::CompositorHeuristicTelemetryContext
 Context fields written with a compositor heuristic telemetry snapshot. More...

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.

Enumerations

enum class  donner::editor::CanvasFreshness {
  Current ,
  CommitStalled ,
  CompositorBehind
}
 Canvas freshness state shown by the layer inspector.

Functions

CanvasFreshness donner::editor::ClassifyCanvasFreshness (const Vector2i &viewportDesiredCanvas, const Vector2i &documentCanvas, const Vector2i &compositorCanvas)
 Classify desired, document, and compositor canvas-size agreement.
std::string_view donner::editor::CanvasFreshnessStatusSuffix (CanvasFreshness freshness)
 User-visible status suffix for a canvas freshness state.
std::string donner::editor::BuildCompositorHeuristicTelemetryJson (std::span< const svg::compositor::CompositorController::CompositeTileSnapshot > tiles, const CompositorHeuristicTelemetryContext &context)
 Serialize the current compositor span heuristic state as one JSON object.
std::string donner::editor::BuildCompositorHeuristicTelemetrySampleJson (const svg::compositor::CompositorController::CompositeTileSnapshot &tile, const CompositorHeuristicTelemetryContext &context, std::uint64_t sequence)
 Serialize one segment heuristic sample as one JSONL record.
bool donner::editor::AppendCompositorHeuristicTelemetry (std::string_view path, std::string_view json, std::string *error)
 Append a compositor heuristic telemetry record to a JSONL file.
bool donner::editor::SaveCompositorHeuristicTelemetry (std::string_view path, std::string_view json, std::string *error)
 Save compositor heuristic telemetry to a JSONL file, replacing any existing contents.

Function Documentation

◆ AppendCompositorHeuristicTelemetry()

bool donner::editor::AppendCompositorHeuristicTelemetry ( std::string_view path,
std::string_view json,
std::string * error )
nodiscard

Append a compositor heuristic telemetry record to a JSONL file.

Parameters
pathDestination file path.
jsonOne JSON object, normally returned by BuildCompositorHeuristicTelemetryJson.
errorOptional destination for a human-readable failure message.
Returns
True when the record was appended.

◆ BuildCompositorHeuristicTelemetryJson()

std::string donner::editor::BuildCompositorHeuristicTelemetryJson ( std::span< const svg::compositor::CompositorController::CompositeTileSnapshot > tiles,
const CompositorHeuristicTelemetryContext & context )
nodiscard

Serialize the current compositor span heuristic state as one JSON object.

Parameters
tilesPaint-order composite tile snapshot from the async renderer.
contextViewport, canvas, and aggregate compositor state.
Returns
JSON object ending with a trailing newline, suitable for JSONL append.

◆ BuildCompositorHeuristicTelemetrySampleJson()

std::string donner::editor::BuildCompositorHeuristicTelemetrySampleJson ( const svg::compositor::CompositorController::CompositeTileSnapshot & tile,
const CompositorHeuristicTelemetryContext & context,
std::uint64_t sequence )
nodiscard

Serialize one segment heuristic sample as one JSONL record.

Parameters
tileSegment tile to serialize.
contextViewport, canvas, and aggregate compositor state.
sequenceMonotonic sample sequence assigned by the editor.
Returns
JSON object ending with a trailing newline.

◆ CanvasFreshnessStatusSuffix()

std::string_view donner::editor::CanvasFreshnessStatusSuffix ( CanvasFreshness freshness)
nodiscard

User-visible status suffix for a canvas freshness state.

Parameters
freshnessState returned by ClassifyCanvasFreshness.

◆ ClassifyCanvasFreshness()

CanvasFreshness donner::editor::ClassifyCanvasFreshness ( const Vector2i & viewportDesiredCanvas,
const Vector2i & documentCanvas,
const Vector2i & compositorCanvas )
nodiscard

Classify desired, document, and compositor canvas-size agreement.

Parameters
viewportDesiredCanvasCanvas size implied by the current viewport.
documentCanvasCanvas size committed to the SVG document.
compositorCanvasCanvas size last rasterized by the compositor.

◆ SaveCompositorHeuristicTelemetry()

bool donner::editor::SaveCompositorHeuristicTelemetry ( std::string_view path,
std::string_view json,
std::string * error )
nodiscard

Save compositor heuristic telemetry to a JSONL file, replacing any existing contents.

Parameters
pathDestination file path.
jsonJSONL payload to write.
errorOptional destination for a human-readable failure message.
Returns
True when the payload was written.