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

Commit 6d8bd99

Browse files
authored
Revert "Reland PerformanceOverlayLayer golden test (#7863)" (#7895)
Reverting this broke the flow tests for the performance overlay: ``` ../../flutter/flow/layers/performance_overlay_layer_unittests.cc:70: Failure Value of: golden_data != nullptr Actual: false Expected: true ``` This reverts commit 8427d73.
1 parent 39f7066 commit 6d8bd99

File tree

9 files changed

+12
-234
lines changed

9 files changed

+12
-234
lines changed

ci/licenses_golden/licenses_flutter

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ FILE: ../../../flutter/flow/layers/opacity_layer.cc
5757
FILE: ../../../flutter/flow/layers/opacity_layer.h
5858
FILE: ../../../flutter/flow/layers/performance_overlay_layer.cc
5959
FILE: ../../../flutter/flow/layers/performance_overlay_layer.h
60-
FILE: ../../../flutter/flow/layers/performance_overlay_layer_unittests.cc
6160
FILE: ../../../flutter/flow/layers/physical_shape_layer.cc
6261
FILE: ../../../flutter/flow/layers/physical_shape_layer.h
6362
FILE: ../../../flutter/flow/layers/picture_layer.cc
@@ -697,13 +696,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
697696
====================================================================================================
698697

699698
====================================================================================================
700-
LIBRARY: engine
701699
LIBRARY: txt
702700
ORIGIN: ../../../flutter/third_party/txt/LICENSE
703701
TYPE: LicenseType.apache
704-
FILE: ../../../flutter/flow/flow_run_all_unittests.cc
705-
FILE: ../../../flutter/flow/flow_test_utils.cc
706-
FILE: ../../../flutter/flow/flow_test_utils.h
707702
FILE: ../../../flutter/third_party/txt/benchmarks/paint_record_benchmarks.cc
708703
FILE: ../../../flutter/third_party/txt/benchmarks/paragraph_benchmarks.cc
709704
FILE: ../../../flutter/third_party/txt/benchmarks/paragraph_builder_benchmarks.cc

flow/BUILD.gn

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,13 @@ executable("flow_unittests") {
9393
testonly = true
9494

9595
sources = [
96-
"flow_run_all_unittests.cc",
97-
"flow_test_utils.h",
98-
"flow_test_utils.cc",
9996
"matrix_decomposition_unittests.cc",
10097
"raster_cache_unittests.cc",
101-
"layers/performance_overlay_layer_unittests.cc",
10298
]
10399

104100
deps = [
105101
":flow",
106-
"$flutter_root/fml",
107-
"//third_party/googletest:gtest",
102+
"$flutter_root/testing",
108103
"//third_party/dart/runtime:libdart_jit", # for tracing
109104
"//third_party/skia",
110105
]

flow/flow_run_all_unittests.cc

Lines changed: 0 additions & 32 deletions
This file was deleted.

flow/flow_test_utils.cc

Lines changed: 0 additions & 40 deletions
This file was deleted.

flow/flow_test_utils.h

Lines changed: 0 additions & 29 deletions
This file was deleted.

flow/layers/performance_overlay_layer.cc

Lines changed: 10 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,8 @@ namespace {
1515
void DrawStatisticsText(SkCanvas& canvas,
1616
const std::string& string,
1717
int x,
18-
int y,
19-
const std::string& font_path) {
18+
int y) {
2019
SkFont font;
21-
if (font_path != "") {
22-
font = SkFont(SkTypeface::MakeFromFile(font_path.c_str()));
23-
}
2420
font.setSize(15);
2521
font.setLinearMetrics(false);
2622
SkPaint paint;
@@ -37,8 +33,7 @@ void VisualizeStopWatch(SkCanvas& canvas,
3733
SkScalar height,
3834
bool show_graph,
3935
bool show_labels,
40-
const std::string& label_prefix,
41-
const std::string& font_path) {
36+
const std::string& label_prefix) {
4237
const int label_x = 8; // distance from x
4338
const int label_y = -10; // distance from y+height
4439

@@ -56,20 +51,14 @@ void VisualizeStopWatch(SkCanvas& canvas,
5651
stream << label_prefix << " "
5752
<< "max " << max_ms_per_frame << " ms/frame, "
5853
<< "avg " << average_ms_per_frame << " ms/frame";
59-
DrawStatisticsText(canvas, stream.str(), x + label_x, y + height + label_y,
60-
font_path);
54+
DrawStatisticsText(canvas, stream.str(), x + label_x, y + height + label_y);
6155
}
6256
}
6357

6458
} // namespace
6559

66-
PerformanceOverlayLayer::PerformanceOverlayLayer(uint64_t options,
67-
const char* font_path)
68-
: options_(options) {
69-
if (font_path != nullptr) {
70-
font_path_ = font_path;
71-
}
72-
}
60+
PerformanceOverlayLayer::PerformanceOverlayLayer(uint64_t options)
61+
: options_(options) {}
7362

7463
void PerformanceOverlayLayer::Paint(PaintContext& context) const {
7564
const int padding = 8;
@@ -84,15 +73,15 @@ void PerformanceOverlayLayer::Paint(PaintContext& context) const {
8473
SkScalar height = paint_bounds().height() / 2;
8574
SkAutoCanvasRestore save(context.leaf_nodes_canvas, true);
8675

87-
VisualizeStopWatch(
88-
*context.leaf_nodes_canvas, context.frame_time, x, y, width,
89-
height - padding, options_ & kVisualizeRasterizerStatistics,
90-
options_ & kDisplayRasterizerStatistics, "GPU", font_path_);
76+
VisualizeStopWatch(*context.leaf_nodes_canvas, context.frame_time, x, y,
77+
width, height - padding,
78+
options_ & kVisualizeRasterizerStatistics,
79+
options_ & kDisplayRasterizerStatistics, "GPU");
9180

9281
VisualizeStopWatch(*context.leaf_nodes_canvas, context.engine_time, x,
9382
y + height, width, height - padding,
9483
options_ & kVisualizeEngineStatistics,
95-
options_ & kDisplayEngineStatistics, "UI", font_path_);
84+
options_ & kDisplayEngineStatistics, "UI");
9685
}
9786

9887
} // namespace flow

flow/layers/performance_overlay_layer.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
#ifndef FLUTTER_FLOW_LAYERS_PERFORMANCE_OVERLAY_LAYER_H_
66
#define FLUTTER_FLOW_LAYERS_PERFORMANCE_OVERLAY_LAYER_H_
77

8-
#include <string>
9-
108
#include "flutter/flow/layers/layer.h"
119
#include "flutter/fml/macros.h"
1210

@@ -19,14 +17,12 @@ const int kVisualizeEngineStatistics = 1 << 3;
1917

2018
class PerformanceOverlayLayer : public Layer {
2119
public:
22-
explicit PerformanceOverlayLayer(uint64_t options,
23-
const char* font_path = nullptr);
20+
explicit PerformanceOverlayLayer(uint64_t options);
2421

2522
void Paint(PaintContext& context) const override;
2623

2724
private:
2825
int options_;
29-
std::string font_path_;
3026

3127
FML_DISALLOW_COPY_AND_ASSIGN(PerformanceOverlayLayer);
3228
};

flow/layers/performance_overlay_layer_unittests.cc

Lines changed: 0 additions & 96 deletions
This file was deleted.
-16.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)