167 lines
5.1 KiB
C++
167 lines
5.1 KiB
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
#include <optional>
|
|
#include <string>
|
|
#include <vector>
|
|
|
|
namespace mbgl {
|
|
|
|
enum class RenderSegmentStrategy : uint8_t { Retained, Continuous };
|
|
|
|
inline const char* renderSegmentStrategyText(RenderSegmentStrategy strategy) noexcept {
|
|
return strategy == RenderSegmentStrategy::Retained ? "RETAINED" : "CONTINUOUS";
|
|
}
|
|
|
|
struct RenderSegmentDefinition {
|
|
RenderSegmentStrategy strategy = RenderSegmentStrategy::Continuous;
|
|
std::optional<std::string> startLayerId;
|
|
|
|
bool operator==(const RenderSegmentDefinition&) const = default;
|
|
};
|
|
|
|
struct RenderSegmentPlan {
|
|
uint32_t schemaVersion = 1;
|
|
std::vector<RenderSegmentDefinition> segments;
|
|
|
|
bool operator==(const RenderSegmentPlan&) const = default;
|
|
};
|
|
|
|
struct StyleLayerDiagnostics {
|
|
int32_t layerIndex = -1;
|
|
std::string layerId;
|
|
std::string layerType;
|
|
bool visible = false;
|
|
std::optional<std::string> sourceId;
|
|
std::optional<std::string> sourceLayer;
|
|
|
|
bool operator==(const StyleLayerDiagnostics&) const = default;
|
|
};
|
|
|
|
struct RenderSourceReadinessDiagnostics {
|
|
std::string sourceId;
|
|
std::string sourceType;
|
|
bool enabled = false;
|
|
bool isLoaded = false;
|
|
bool tileBacked = false;
|
|
std::optional<uint32_t> tileCount;
|
|
std::optional<uint32_t> incompleteTileCount;
|
|
std::optional<uint32_t> loadedTileCount;
|
|
bool hasFadingTiles = false;
|
|
uint64_t lastSourceMutationSequence = 0;
|
|
uint64_t lastTileChangedSequence = 0;
|
|
uint64_t lastTileActionSequence = 0;
|
|
std::string lastTileAction{"none"};
|
|
std::string lastMutationReason{"none"};
|
|
|
|
bool operator==(const RenderSourceReadinessDiagnostics&) const = default;
|
|
};
|
|
|
|
struct RenderMutationDiagnostics {
|
|
uint64_t sequence = 0;
|
|
uint64_t contentRevision = 0;
|
|
std::string eventType{"none"};
|
|
std::string reason{"none"};
|
|
std::optional<std::string> sourceId;
|
|
std::vector<uint32_t> affectedSegmentIndices;
|
|
std::string dependencyScope{"none"};
|
|
|
|
bool operator==(const RenderMutationDiagnostics&) const = default;
|
|
};
|
|
|
|
struct RendererReadinessDiagnostics {
|
|
bool styleLoaded = false;
|
|
bool imageManagerLoaded = false;
|
|
bool renderOrchestratorLoaded = false;
|
|
bool spriteLoaded = false;
|
|
bool hasFadingTiles = false;
|
|
uint64_t contentRevision = 0;
|
|
std::vector<RenderSourceReadinessDiagnostics> sources;
|
|
RenderMutationDiagnostics lastMutation;
|
|
|
|
bool operator==(const RendererReadinessDiagnostics&) const = default;
|
|
};
|
|
|
|
struct RenderSegmentCacheDiagnostics {
|
|
std::string cacheState{"disabled"};
|
|
uint64_t contentRevision = 0;
|
|
uint64_t build = 0;
|
|
uint64_t reuse = 0;
|
|
uint64_t invalidation = 0;
|
|
std::string lastInvalidationReason{"none"};
|
|
uint64_t textureCreate = 0;
|
|
uint64_t compositeCreate = 0;
|
|
uint64_t resourceRelease = 0;
|
|
};
|
|
|
|
struct RenderSegmentDiagnosticsEntry {
|
|
uint32_t segmentIndex = 0;
|
|
RenderSegmentStrategy strategy = RenderSegmentStrategy::Continuous;
|
|
std::optional<std::string> configuredStartLayerId;
|
|
int32_t beginIndex = -1;
|
|
int32_t endExclusive = -1;
|
|
std::optional<std::string> resolvedStartLayerId;
|
|
std::optional<std::string> resolvedEndLayerId;
|
|
std::vector<StyleLayerDiagnostics> layers;
|
|
std::vector<std::string> dependentSourceIds;
|
|
std::vector<std::string> unknownDependencies;
|
|
std::optional<RenderSegmentCacheDiagnostics> cache;
|
|
};
|
|
|
|
struct RenderSegmentDiagnostics {
|
|
uint32_t schemaVersion = 1;
|
|
bool enabled = true;
|
|
bool configured = false;
|
|
bool valid = false;
|
|
std::string configSource{"unconfigured/legacy"};
|
|
uint64_t configRevision = 0;
|
|
uint64_t topologyRevision = 0;
|
|
uint32_t styleLayerCount = 0;
|
|
uint32_t segmentCount = 0;
|
|
uint32_t retainedSegmentCount = 0;
|
|
uint32_t continuousSegmentCount = 0;
|
|
bool coverageComplete = false;
|
|
bool fallback = false;
|
|
std::string lastReason{"not-configured"};
|
|
bool fastPathEligible = false;
|
|
bool fastPathActive = false;
|
|
std::string fastPathFallbackReason{"no-prepared-tree"};
|
|
uint64_t fastPathHit = 0;
|
|
uint64_t fastPathMiss = 0;
|
|
uint64_t fullCpuFrame = 0;
|
|
bool styleLoaded = false;
|
|
bool imageManagerLoaded = false;
|
|
bool renderOrchestratorLoaded = false;
|
|
bool spriteLoaded = false;
|
|
bool hasFadingTiles = false;
|
|
uint64_t contentRevision = 0;
|
|
std::vector<RenderSourceReadinessDiagnostics> sources;
|
|
RenderMutationDiagnostics lastMutation;
|
|
std::vector<StyleLayerDiagnostics> styleLayers;
|
|
std::vector<RenderSegmentDiagnosticsEntry> segments;
|
|
};
|
|
|
|
struct ResolvedRenderSegment {
|
|
uint32_t segmentIndex = 0;
|
|
RenderSegmentStrategy strategy = RenderSegmentStrategy::Continuous;
|
|
std::optional<std::string> configuredStartLayerId;
|
|
int32_t beginIndex = 0;
|
|
int32_t endExclusive = 0;
|
|
|
|
bool operator==(const ResolvedRenderSegment&) const = default;
|
|
};
|
|
|
|
struct ResolvedRenderSegmentPlan {
|
|
bool configured = false;
|
|
bool valid = false;
|
|
std::string configSource{"unconfigured/legacy"};
|
|
uint64_t configRevision = 0;
|
|
std::string reason{"not-configured"};
|
|
int32_t layerCount = 0;
|
|
std::vector<ResolvedRenderSegment> segments;
|
|
|
|
bool operator==(const ResolvedRenderSegmentPlan&) const = default;
|
|
};
|
|
|
|
} // namespace mbgl
|