Bug 1500692 - Add GRAPHICS subcategories. r=njn,mattwoodrow

r?njn only because this is the first example that adds any actual subcategories.

Differential Revision: https://phabricator.services.mozilla.com/D11340

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Markus Stange 2019-02-16 17:38:23 +00:00
parent 99df373110
commit ad3f9a53de
11 changed files with 29 additions and 12 deletions

View File

@ -434,7 +434,7 @@ CompositorBridgeChild* ClientLayerManager::GetCompositorBridgeChild() {
}
void ClientLayerManager::FlushAsyncPaints() {
AUTO_PROFILER_LABEL("ClientLayerManager::FlushAsyncPaints", GRAPHICS);
AUTO_PROFILER_LABEL_CATEGORY_PAIR(GRAPHICS_FlushingAsyncPaints);
CompositorBridgeChild* cbc = GetCompositorBridgeChild();
if (cbc) {

View File

@ -307,8 +307,6 @@ bool ClientMultiTiledLayerBuffer::ValidateTile(TileClient& aTile,
const nsIntPoint& aTileOrigin,
nsIntRegion& aDirtyRegion,
TilePaintFlags aFlags) {
AUTO_PROFILER_LABEL("ClientMultiTiledLayerBuffer::ValidateTile", GRAPHICS);
#ifdef GFX_TILEDLAYER_PREF_WARNINGS
if (aDirtyRegion.IsComplex()) {
printf_stderr("Complex region\n");

View File

@ -578,6 +578,7 @@ Maybe<AcquiredBackBuffer> TileClient::AcquireBackBuffer(
CompositableClient& aCompositable, const nsIntRegion& aDirtyRegion,
const nsIntRegion& aVisibleRegion, gfxContentType aContent,
SurfaceMode aMode, TilePaintFlags aFlags) {
AUTO_PROFILER_LABEL("TileClient::AcquireBackBuffer", GRAPHICS_TileAllocation);
if (!mAllocator) {
gfxCriticalError() << "[TileClient] Missing TextureClientAllocator.";
return Nothing();

View File

@ -1426,6 +1426,8 @@ void WebRenderCommandBuilder::BuildWebRenderCommands(
wr::IpcResourceUpdateQueue& aResourceUpdates, nsDisplayList* aDisplayList,
nsDisplayListBuilder* aDisplayListBuilder, WebRenderScrollData& aScrollData,
wr::LayoutSize& aContentSize, nsTArray<wr::FilterOp>&& aFilters) {
AUTO_PROFILER_LABEL_CATEGORY_PAIR(GRAPHICS_WRDisplayList);
StackingContextHelper sc;
aScrollData = WebRenderScrollData(mManager);
MOZ_ASSERT(mLayerScrollData.empty());

View File

@ -119,7 +119,7 @@ LexerResult Decoder::Decode(IResumable* aOnResume /* = nullptr */) {
LexerResult lexerResult(TerminalState::FAILURE);
{
AUTO_PROFILER_LABEL("Decoder::Decode", GRAPHICS);
AUTO_PROFILER_LABEL_CATEGORY_PAIR(GRAPHICS_ImageDecoding);
AutoRecordDecoderTelemetry telemetry(this);
lexerResult = DoDecode(*mIterator, aOnResume);

View File

@ -51,6 +51,14 @@
END_CATEGORY \
BEGIN_CATEGORY(GRAPHICS, "Graphics", "green") \
SUBCATEGORY(GRAPHICS, GRAPHICS, "Other") \
SUBCATEGORY(GRAPHICS, GRAPHICS_DisplayListBuilding, "DisplayList building") \
SUBCATEGORY(GRAPHICS, GRAPHICS_DisplayListMerging, "DisplayList merging") \
SUBCATEGORY(GRAPHICS, GRAPHICS_LayerBuilding, "Layer building") \
SUBCATEGORY(GRAPHICS, GRAPHICS_TileAllocation, "Tile allocation") \
SUBCATEGORY(GRAPHICS, GRAPHICS_WRDisplayList, "WebRender display list") \
SUBCATEGORY(GRAPHICS, GRAPHICS_Rasterization, "Rasterization") \
SUBCATEGORY(GRAPHICS, GRAPHICS_FlushingAsyncPaints, "Flushing async paints") \
SUBCATEGORY(GRAPHICS, GRAPHICS_ImageDecoding, "Image decoding") \
END_CATEGORY \
BEGIN_CATEGORY(DOM, "DOM", "blue") \
SUBCATEGORY(DOM, DOM, "Other") \

View File

@ -3534,7 +3534,7 @@ nsresult nsLayoutUtils::PaintFrame(gfxContext* aRenderingContext,
PartialUpdateResult updateState = PartialUpdateResult::Failed;
{
AUTO_PROFILER_LABEL("nsLayoutUtils::PaintFrame:BuildDisplayList", GRAPHICS);
AUTO_PROFILER_LABEL_CATEGORY_PAIR(GRAPHICS_DisplayListBuilding);
AUTO_PROFILER_TRACING("Paint", "DisplayList", GRAPHICS);
PaintTelemetry::AutoRecord record(PaintTelemetry::Metric::DisplayList);
@ -6761,7 +6761,8 @@ static ImgDrawResult DrawImageInternal(
SamplingFilter aSamplingFilter, const nsRect& aDest, const nsRect& aFill,
const nsSize& aRepeatSize, const nsPoint& aAnchor, const nsRect& aDirty,
uint32_t aImageFlags, ExtendMode aExtendMode, float aOpacity) {
AUTO_PROFILER_LABEL("nsLayoutUtils::DrawBackgroundImage", GRAPHICS);
AUTO_PROFILER_LABEL("nsLayoutUtils::DrawBackgroundImage",
GRAPHICS_Rasterization);
Maybe<SVGImageContext> svgContext(Some(SVGImageContext(Some(aImageSize))));
SVGImageContext::MaybeStoreContextPaint(svgContext, aForFrame, aImage);

View File

@ -51,7 +51,8 @@ void ViewportFrame::Init(nsIContent* aContent, nsContainerFrame* aParent,
void ViewportFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists) {
AUTO_PROFILER_LABEL("ViewportFrame::BuildDisplayList", GRAPHICS);
AUTO_PROFILER_LABEL("ViewportFrame::BuildDisplayList",
GRAPHICS_DisplayListBuilding);
if (nsIFrame* kid = mFrames.FirstChild()) {
// make the kid's BorderBackground our own. This ensures that the canvas

View File

@ -4393,7 +4393,8 @@ static void ProcessDisplayItemMarker(DisplayItemEntryType aMarker,
* of ContainerState::Finish.
*/
void ContainerState::ProcessDisplayItems(nsDisplayList* aList) {
AUTO_PROFILER_LABEL("ContainerState::ProcessDisplayItems", GRAPHICS);
AUTO_PROFILER_LABEL("ContainerState::ProcessDisplayItems",
GRAPHICS_LayerBuilding);
nsPoint topLeft(0, 0);
@ -6941,10 +6942,11 @@ void FrameLayerBuilder::PaintItems(std::vector<AssignedDisplayItem>& aItems,
}
#ifdef MOZ_DUMP_PAINTING
AUTO_PROFILER_LABEL_DYNAMIC_CSTR("FrameLayerBuilder::PaintItems", GRAPHICS,
item->Name());
AUTO_PROFILER_LABEL_DYNAMIC_CSTR("FrameLayerBuilder::PaintItems",
GRAPHICS_Rasterization, item->Name());
#else
AUTO_PROFILER_LABEL("FrameLayerBuilder::PaintItems", GRAPHICS);
AUTO_PROFILER_LABEL("FrameLayerBuilder::PaintItems",
GRAPHICS_Rasterization);
#endif
MOZ_ASSERT((opacityLevel == 0 && !cdi.mHasOpacity) ||
@ -7117,7 +7119,8 @@ static void DrawForcedBackgroundColor(DrawTarget& aDrawTarget,
void* aCallbackData) {
DrawTarget& aDrawTarget = *aContext->GetDrawTarget();
AUTO_PROFILER_LABEL("FrameLayerBuilder::DrawPaintedLayer", GRAPHICS);
AUTO_PROFILER_LABEL("FrameLayerBuilder::DrawPaintedLayer",
GRAPHICS_Rasterization);
nsDisplayListBuilder* builder =
static_cast<nsDisplayListBuilder*>(aCallbackData);

View File

@ -658,6 +658,8 @@ bool RetainedDisplayListBuilder::MergeDisplayLists(
RetainedDisplayList* aOutList,
mozilla::Maybe<const mozilla::ActiveScrolledRoot*>& aOutContainerASR,
nsDisplayItem* aOuterItem) {
AUTO_PROFILER_LABEL_CATEGORY_PAIR(GRAPHICS_DisplayListMerging);
MergeState merge(this, *aOldList,
aOuterItem ? aOuterItem->GetPerFrameKey() : 0);

View File

@ -2466,6 +2466,7 @@ FrameLayerBuilder* nsDisplayList::BuildLayers(nsDisplayListBuilder* aBuilder,
RefPtr<ContainerLayer> root;
{
AUTO_PROFILER_LABEL_CATEGORY_PAIR(GRAPHICS_LayerBuilding);
#ifdef MOZ_GECKO_PROFILER
nsCOMPtr<nsIDocShell> docShell = presContext->GetDocShell();
AUTO_PROFILER_TRACING_DOCSHELL("Paint", "LayerBuilding", GRAPHICS,