Remove expensive trace events (flutter/engine#36989)

This commit is contained in:
Jonah Williams
2022-10-25 14:13:14 -07:00
committed by GitHub
parent d47708e44a
commit ffff2c1c37
16 changed files with 0 additions and 30 deletions

View File

@@ -75,7 +75,6 @@ void DisplayList::ComputeRTree() {
void DisplayList::Dispatch(Dispatcher& dispatcher,
uint8_t* ptr,
uint8_t* end) const {
TRACE_EVENT0("flutter", "DisplayList::Dispatch");
while (ptr < end) {
auto op = reinterpret_cast<const DLOp*>(ptr);
ptr += op->size;

View File

@@ -54,7 +54,6 @@ void BackdropFilterLayer::Preroll(PrerollContext* context,
}
void BackdropFilterLayer::Paint(PaintContext& context) const {
TRACE_EVENT0("flutter", "BackdropFilterLayer::Paint");
FML_DCHECK(needs_painting(context));
AutoCachePaint save_paint(context);

View File

@@ -10,12 +10,10 @@ ClipPathLayer::ClipPathLayer(const SkPath& clip_path, Clip clip_behavior)
: ClipShapeLayer(clip_path, clip_behavior) {}
void ClipPathLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
TRACE_EVENT0("flutter", "ClipPathLayer::Preroll");
ClipShapeLayer::Preroll(context, matrix);
}
void ClipPathLayer::Paint(PaintContext& context) const {
TRACE_EVENT0("flutter", "ClipPathLayer::Paint");
ClipShapeLayer::Paint(context);
}

View File

@@ -10,12 +10,10 @@ ClipRectLayer::ClipRectLayer(const SkRect& clip_rect, Clip clip_behavior)
: ClipShapeLayer(clip_rect, clip_behavior) {}
void ClipRectLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
TRACE_EVENT0("flutter", "ClipRectLayer::Preroll");
ClipShapeLayer::Preroll(context, matrix);
}
void ClipRectLayer::Paint(PaintContext& context) const {
TRACE_EVENT0("flutter", "ClipRectLayer::Paint");
ClipShapeLayer::Paint(context);
}

View File

@@ -10,12 +10,10 @@ ClipRRectLayer::ClipRRectLayer(const SkRRect& clip_rrect, Clip clip_behavior)
: ClipShapeLayer(clip_rrect, clip_behavior) {}
void ClipRRectLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
TRACE_EVENT0("flutter", "ClipRRectLayer::Preroll");
ClipShapeLayer::Preroll(context, matrix);
}
void ClipRRectLayer::Paint(PaintContext& context) const {
TRACE_EVENT0("flutter", "ClipRRectLayer::Paint");
ClipShapeLayer::Paint(context);
}

View File

@@ -52,7 +52,6 @@ void ColorFilterLayer::Preroll(PrerollContext* context,
}
void ColorFilterLayer::Paint(PaintContext& context) const {
TRACE_EVENT0("flutter", "ColorFilterLayer::Paint");
FML_DCHECK(needs_painting(context));
if (context.raster_cache) {

View File

@@ -108,8 +108,6 @@ void ContainerLayer::Add(std::shared_ptr<Layer> layer) {
}
void ContainerLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
TRACE_EVENT0("flutter", "ContainerLayer::Preroll");
SkRect child_paint_bounds = SkRect::MakeEmpty();
PrerollChildren(context, matrix, &child_paint_bounds);
set_paint_bounds(child_paint_bounds);

View File

@@ -97,7 +97,6 @@ bool DisplayListLayer::Compare(DiffContext::Statistics& statistics,
void DisplayListLayer::Preroll(PrerollContext* context,
const SkMatrix& matrix) {
TRACE_EVENT0("flutter", "DisplayListLayer::Preroll");
DisplayList* disp_list = display_list();
SkMatrix child_matrix = matrix;
@@ -110,7 +109,6 @@ void DisplayListLayer::Preroll(PrerollContext* context,
}
void DisplayListLayer::Paint(PaintContext& context) const {
TRACE_EVENT0("flutter", "DisplayListLayer::Paint");
FML_DCHECK(display_list_.skia_object());
FML_DCHECK(needs_painting(context));

View File

@@ -48,8 +48,6 @@ void ImageFilterLayer::Diff(DiffContext* context, const Layer* old_layer) {
void ImageFilterLayer::Preroll(PrerollContext* context,
const SkMatrix& matrix) {
TRACE_EVENT0("flutter", "ImageFilterLayer::Preroll");
Layer::AutoPrerollSaveLayerState save =
Layer::AutoPrerollSaveLayerState::Create(context);
SkMatrix child_matrix = matrix;
@@ -89,7 +87,6 @@ void ImageFilterLayer::Preroll(PrerollContext* context,
}
void ImageFilterLayer::Paint(PaintContext& context) const {
TRACE_EVENT0("flutter", "ImageFilterLayer::Paint");
FML_DCHECK(needs_painting(context));
AutoCachePaint cache_paint(context);

View File

@@ -37,7 +37,6 @@ void OpacityLayer::Diff(DiffContext* context, const Layer* old_layer) {
}
void OpacityLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
TRACE_EVENT0("flutter", "OpacityLayer::Preroll");
FML_DCHECK(!layers().empty()); // We can't be a leaf.
SkMatrix child_matrix = matrix;
@@ -85,7 +84,6 @@ void OpacityLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
}
void OpacityLayer::Paint(PaintContext& context) const {
TRACE_EVENT0("flutter", "OpacityLayer::Paint");
FML_DCHECK(needs_painting(context));
SkAutoCanvasRestore save(context.internal_nodes_canvas, true);

View File

@@ -93,7 +93,6 @@ void PerformanceOverlayLayer::Paint(PaintContext& context) const {
return;
}
TRACE_EVENT0("flutter", "PerformanceOverlayLayer::Paint");
SkScalar x = paint_bounds().x() + padding;
SkScalar y = paint_bounds().y() + padding;
SkScalar width = paint_bounds().width() - (padding * 2);

View File

@@ -52,7 +52,6 @@ void PhysicalShapeLayer::Diff(DiffContext* context, const Layer* old_layer) {
void PhysicalShapeLayer::Preroll(PrerollContext* context,
const SkMatrix& matrix) {
TRACE_EVENT0("flutter", "PhysicalShapeLayer::Preroll");
Layer::AutoPrerollSaveLayerState save =
Layer::AutoPrerollSaveLayerState::Create(context, UsesSaveLayer());
@@ -77,7 +76,6 @@ void PhysicalShapeLayer::Preroll(PrerollContext* context,
}
void PhysicalShapeLayer::Paint(PaintContext& context) const {
TRACE_EVENT0("flutter", "PhysicalShapeLayer::Paint");
FML_DCHECK(needs_painting(context));
if (elevation_ != 0) {

View File

@@ -49,7 +49,6 @@ void ShaderMaskLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
}
void ShaderMaskLayer::Paint(PaintContext& context) const {
TRACE_EVENT0("flutter", "ShaderMaskLayer::Paint");
FML_DCHECK(needs_painting(context));
AutoCachePaint cache_paint(context);

View File

@@ -41,8 +41,6 @@ void TextureLayer::Diff(DiffContext* context, const Layer* old_layer) {
}
void TextureLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
TRACE_EVENT0("flutter", "TextureLayer::Preroll");
set_paint_bounds(SkRect::MakeXYWH(offset_.x(), offset_.y(), size_.width(),
size_.height()));
context->has_texture_layer = true;
@@ -50,7 +48,6 @@ void TextureLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
}
void TextureLayer::Paint(PaintContext& context) const {
TRACE_EVENT0("flutter", "TextureLayer::Paint");
FML_DCHECK(needs_painting(context));
std::shared_ptr<Texture> texture =

View File

@@ -41,8 +41,6 @@ void TransformLayer::Diff(DiffContext* context, const Layer* old_layer) {
}
void TransformLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
TRACE_EVENT0("flutter", "TransformLayer::Preroll");
SkMatrix child_matrix;
child_matrix.setConcat(matrix, transform_);
context->mutators_stack.PushTransform(transform_);
@@ -71,7 +69,6 @@ void TransformLayer::Preroll(PrerollContext* context, const SkMatrix& matrix) {
}
void TransformLayer::Paint(PaintContext& context) const {
TRACE_EVENT0("flutter", "TransformLayer::Paint");
FML_DCHECK(needs_painting(context));
SkAutoCanvasRestore save(context.internal_nodes_canvas, true);

View File

@@ -29,7 +29,6 @@ RasterCacheResult::RasterCacheResult(sk_sp<SkImage> image,
: image_(std::move(image)), logical_rect_(logical_rect), flow_(type) {}
void RasterCacheResult::draw(SkCanvas& canvas, const SkPaint* paint) const {
TRACE_EVENT0("flutter", "RasterCacheResult::draw");
SkAutoCanvasRestore auto_restore(&canvas, true);
auto matrix = RasterCacheUtil::GetIntegralTransCTM(canvas.getTotalMatrix());
@@ -55,7 +54,6 @@ std::unique_ptr<RasterCacheResult> RasterCache::Rasterize(
const std::function<void(SkCanvas*)>& draw_function,
const std::function<void(SkCanvas*, const SkRect& rect)>& draw_checkerboard)
const {
TRACE_EVENT0("flutter", "RasterCachePopulate");
auto matrix = RasterCacheUtil::GetIntegralTransCTM(context.matrix);
SkRect dest_rect =
RasterCacheUtil::GetRoundedOutDeviceBounds(context.logical_rect, matrix);