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

Commit 3bec621

Browse files
author
Chris Yang
committed
cleanup
1 parent 5755ed2 commit 3bec621

File tree

12 files changed

+8
-34
lines changed

12 files changed

+8
-34
lines changed

lib/ui/compositing/scene_builder_unittests.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ TEST_F(ShellTest, SceneBuilderBuildAndSceneDisposeReleasesLayerStack) {
7878
AddNativeCallback("CaptureScene", CREATE_NATIVE_ENTRY(capture_scene));
7979
AddNativeCallback("ValidateSceneHasNoLayers",
8080
CREATE_NATIVE_ENTRY(validate_scene_has_no_layers));
81+
8182
std::unique_ptr<Shell> shell =
8283
CreateShell(std::move(settings), std::move(task_runners));
8384

shell/common/animator.cc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ Animator::Animator(Delegate& delegate,
4141
#endif // SHELL_ENABLE_METAL
4242
pending_frame_semaphore_(1),
4343
weak_factory_(this) {
44-
// waiter->SetDelegate(weak_factory_.GetWeakPtr());
4544
}
4645

4746
Animator::~Animator() = default;
@@ -65,11 +64,6 @@ void Animator::SetDimensionChangePending() {
6564
dimension_change_pending_ = true;
6665
}
6766

68-
// |VsycnWaiter::Delegate|
69-
void Animator::OnReportNewFrameRate(double new_frame_rate) {
70-
FML_DLOG(ERROR) << "Animator::new frame rate " << new_frame_rate;
71-
}
72-
7367
void Animator::EnqueueTraceFlowId(uint64_t trace_flow_id) {
7468
fml::TaskRunner::RunNowOrPostTask(
7569
task_runners_.GetUITaskRunner(),

shell/common/animator.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class ShellTest;
2727
///
2828
/// In conjunction with the |VsyncWaiter| it allows callers (typically Dart
2929
/// code) to schedule work that ends up generating a |LayerTree|.
30-
class Animator final : public VsyncWaiter::Delegate {
30+
class Animator final {
3131
public:
3232
class Delegate {
3333
public:
@@ -84,9 +84,6 @@ class Animator final : public VsyncWaiter::Delegate {
8484
// active rendering.
8585
void EnqueueTraceFlowId(uint64_t trace_flow_id);
8686

87-
// |VsycnWaiter::Delegate|
88-
void OnReportNewFrameRate(double new_frame_rate) override;
89-
9087
private:
9188
using LayerTreePipeline = Pipeline<flutter::LayerTree>;
9289

shell/common/animator_unittests.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ TEST_F(ShellTest, AnimatorDoesNotNotifyIdleBeforeRender) {
163163
} while (ui_latch.WaitWithTimeout(fml::TimeDelta::FromMilliseconds(1)));
164164
latch.Signal();
165165
};
166+
166167
// Create the animator on the UI task runner.
167168
task_runners.GetUITaskRunner()->PostTask([&] {
168169
auto vsync_waiter = static_cast<std::unique_ptr<VsyncWaiter>>(

shell/common/platform_view.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ std::unique_ptr<VsyncWaiter> PlatformView::CreateVSyncWaiter() {
2525
FML_DLOG(WARNING)
2626
<< "This platform does not provide a Vsync waiter implementation. A "
2727
"simple timer based fallback is being used.";
28-
return std::make_unique<VsyncWaiterFallback>(task_runners_, false);
28+
return std::make_unique<VsyncWaiterFallback>(task_runners_);
2929
}
3030

3131
void PlatformView::DispatchPlatformMessage(

shell/common/vsync_waiter.cc

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,6 @@ void VsyncWaiter::ScheduleSecondaryCallback(uintptr_t id,
9494
AwaitVSyncForSecondaryCallback();
9595
}
9696

97-
void VsyncWaiter::SetDelegate(fml::WeakPtr<Delegate> delegate) {
98-
delegate_ = std::move(delegate);
99-
}
100-
10197
void VsyncWaiter::FireCallback(fml::TimePoint frame_start_time,
10298
fml::TimePoint frame_target_time,
10399
bool pause_secondary_tasks) {
@@ -173,4 +169,5 @@ void VsyncWaiter::ResumeDartMicroTasks(fml::TaskQueueId ui_task_queue_id) {
173169
auto task_queues = fml::MessageLoopTaskQueues::GetInstance();
174170
task_queues->ResumeSecondarySource(ui_task_queue_id);
175171
}
172+
176173
} // namespace flutter

shell/common/vsync_waiter.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ namespace flutter {
2020
/// getting callbacks when a vsync event happens.
2121
class VsyncWaiter : public std::enable_shared_from_this<VsyncWaiter> {
2222
public:
23-
class Delegate {
24-
public:
25-
virtual void OnReportNewFrameRate(double new_frame_rate) = 0;
26-
};
27-
2823
using Callback = std::function<void(std::unique_ptr<FrameTimingsRecorder>)>;
2924

3025
virtual ~VsyncWaiter();
@@ -37,8 +32,6 @@ class VsyncWaiter : public std::enable_shared_from_this<VsyncWaiter> {
3732
/// |Animator::ScheduleMaybeClearTraceFlowIds|.
3833
void ScheduleSecondaryCallback(uintptr_t id, const fml::closure& callback);
3934

40-
void SetDelegate(fml::WeakPtr<Delegate> delegate);
41-
4235
protected:
4336
// On some backends, the |FireCallback| needs to be made from a static C
4437
// method.
@@ -82,7 +75,6 @@ class VsyncWaiter : public std::enable_shared_from_this<VsyncWaiter> {
8275
std::mutex callback_mutex_;
8376
Callback callback_;
8477
std::unordered_map<uintptr_t, fml::closure> secondary_callbacks_;
85-
fml::WeakPtr<Delegate> delegate_;
8678
double frame_rate_ = -1;
8779

8880
void PauseDartMicroTasks();

shell/common/vsync_waiters_test.cc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,5 @@ void ConstantFiringVsyncWaiter::AwaitVSync() {
6464
});
6565
}
6666

67-
void TestVsyncWaiterDelegate::OnReportNewFrameRate(double new_frame_rate) {
68-
FML_DLOG(ERROR) << "new frame rate " << new_frame_rate;
69-
}
70-
7167
} // namespace testing
7268
} // namespace flutter

shell/common/vsync_waiters_test.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,6 @@ class ConstantFiringVsyncWaiter : public VsyncWaiter {
5656
void AwaitVSync() override;
5757
};
5858

59-
class TestVsyncWaiterDelegate : public VsyncWaiter::Delegate {
60-
// |VsycnWaiter::Delegate|
61-
void OnReportNewFrameRate(double new_frame_rate) override;
62-
};
63-
6459
} // namespace testing
6560
} // namespace flutter
6661

shell/platform/android/vsync_waiter_android.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace flutter {
1919
static fml::jni::ScopedJavaGlobalRef<jclass>* g_vsync_waiter_class = nullptr;
2020
static jmethodID g_async_wait_for_vsync_method_ = nullptr;
2121

22-
VsyncWaiterAndroid::VsyncWaiterAndroid(flutter::TaskRunners task_runners, )
22+
VsyncWaiterAndroid::VsyncWaiterAndroid(flutter::TaskRunners task_runners)
2323
: VsyncWaiter(std::move(task_runners)) {}
2424

2525
VsyncWaiterAndroid::~VsyncWaiterAndroid() = default;

0 commit comments

Comments
 (0)