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

[Impeller] Add some traces around impeller rendering #37510

Merged
merged 1 commit into from
Nov 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions flow/surface_frame.cc
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ SurfaceFrame::SurfaceFrame(sk_sp<SkSurface> surface,
}

bool SurfaceFrame::Submit() {
TRACE_EVENT0("flutter", "SurfaceFrame::Submit");
if (submitted_) {
return false;
}
Expand Down
1 change: 1 addition & 0 deletions shell/common/rasterizer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,7 @@ RasterStatus Rasterizer::DoDraw(
RasterStatus Rasterizer::DrawToSurface(
FrameTimingsRecorder& frame_timings_recorder,
flutter::LayerTree& layer_tree) {
TRACE_EVENT0("flutter", "Rasterizer::DrawToSurface");
FML_DCHECK(surface_);

RasterStatus raster_status;
Expand Down
3 changes: 3 additions & 0 deletions shell/gpu/gpu_surface_metal_impeller.mm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

#include "flutter/fml/make_copyable.h"
#include "flutter/fml/mapping.h"
#include "flutter/fml/trace_event.h"
#include "flutter/impeller/display_list/display_list_dispatcher.h"
#include "flutter/impeller/renderer/backend/metal/surface_mtl.h"

Expand Down Expand Up @@ -42,6 +43,8 @@

// |Surface|
std::unique_ptr<SurfaceFrame> GPUSurfaceMetalImpeller::AcquireFrame(const SkISize& frame_info) {
TRACE_EVENT0("impeller", "GPUSurfaceMetalImpeller::AcquireFrame");

if (!IsValid()) {
FML_LOG(ERROR) << "Metal surface was invalid.";
return nullptr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,8 @@ - (BOOL)flt_hasFirstResponderInViewHierarchySubtree {
bool FlutterPlatformViewsController::SubmitFrame(GrDirectContext* gr_context,
std::shared_ptr<IOSContext> ios_context,
std::unique_ptr<SurfaceFrame> frame) {
TRACE_EVENT0("flutter", "FlutterPlatformViewsController::SubmitFrame");

// Any UIKit related code has to run on main thread.
FML_DCHECK([[NSThread currentThread] isMainThread]);
if (flutter_view_ == nullptr) {
Expand All @@ -600,8 +602,8 @@ - (BOOL)flt_hasFirstResponderInViewHierarchySubtree {
// Resolve all pending GPU operations before allocating a new surface.
background_canvas->flush();

// Clipping the background canvas before drawing the picture recorders requires to
// save and restore the clip context.
// Clipping the background canvas before drawing the picture recorders requires
// saving and restoring the clip context.
SkAutoCanvasRestore save(background_canvas, /*doSave=*/true);

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