Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 216a78c

Browse files
committed
Add more raster traces
1 parent fc72934 commit 216a78c

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

flow/surface_frame.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ SurfaceFrame::SurfaceFrame(sk_sp<SkSurface> surface,
3535
}
3636

3737
bool SurfaceFrame::Submit() {
38+
TRACE_EVENT0("flutter", "SurfaceFrame::Submit");
3839
if (submitted_) {
3940
return false;
4041
}

shell/common/rasterizer.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@ RasterStatus Rasterizer::DoDraw(
464464
RasterStatus Rasterizer::DrawToSurface(
465465
FrameTimingsRecorder& frame_timings_recorder,
466466
flutter::LayerTree& layer_tree) {
467+
TRACE_EVENT0("flutter", "Rasterizer::DrawToSurface");
467468
FML_DCHECK(surface_);
468469

469470
RasterStatus raster_status;

shell/gpu/gpu_surface_metal_impeller.mm

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include "flutter/fml/make_copyable.h"
1111
#include "flutter/fml/mapping.h"
12+
#include "flutter/fml/trace_event.h"
1213
#include "flutter/impeller/display_list/display_list_dispatcher.h"
1314
#include "flutter/impeller/renderer/backend/metal/surface_mtl.h"
1415

@@ -42,6 +43,8 @@
4243

4344
// |Surface|
4445
std::unique_ptr<SurfaceFrame> GPUSurfaceMetalImpeller::AcquireFrame(const SkISize& frame_info) {
46+
TRACE_EVENT0("impeller", "GPUSurfaceMetalImpeller::AcquireFrame");
47+
4548
if (!IsValid()) {
4649
FML_LOG(ERROR) << "Metal surface was invalid.";
4750
return nullptr;

shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,8 @@ - (BOOL)flt_hasFirstResponderInViewHierarchySubtree {
586586
bool FlutterPlatformViewsController::SubmitFrame(GrDirectContext* gr_context,
587587
std::shared_ptr<IOSContext> ios_context,
588588
std::unique_ptr<SurfaceFrame> frame) {
589+
TRACE_EVENT0("flutter", "FlutterPlatformViewsController::SubmitFrame");
590+
589591
// Any UIKit related code has to run on main thread.
590592
FML_DCHECK([[NSThread currentThread] isMainThread]);
591593
if (flutter_view_ == nullptr) {
@@ -600,8 +602,8 @@ - (BOOL)flt_hasFirstResponderInViewHierarchySubtree {
600602
// Resolve all pending GPU operations before allocating a new surface.
601603
background_canvas->flush();
602604

603-
// Clipping the background canvas before drawing the picture recorders requires to
604-
// save and restore the clip context.
605+
// Clipping the background canvas before drawing the picture recorders requires
606+
// saving and restoring the clip context.
605607
SkAutoCanvasRestore save(background_canvas, /*doSave=*/true);
606608

607609
// Maps a platform view id to a vector of `FlutterPlatformViewLayer`.

0 commit comments

Comments
 (0)