Skip to content

Commit 48befc5

Browse files
authored
More rename from GPU thread to raster thread (flutter#22819)
1 parent bdadaad commit 48befc5

File tree

18 files changed

+61
-59
lines changed

18 files changed

+61
-59
lines changed

lib/ui/ui_benchmarks.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Fixture : public testing::FixtureTest {
2121
static void BM_PlatformMessageResponseDartComplete(
2222
benchmark::State& state) { // NOLINT
2323
ThreadHost thread_host("test",
24-
ThreadHost::Type::Platform | ThreadHost::Type::GPU |
24+
ThreadHost::Type::Platform | ThreadHost::Type::RASTER |
2525
ThreadHost::Type::IO | ThreadHost::Type::UI);
2626
TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
2727
thread_host.raster_thread->GetTaskRunner(),

lib/ui/window/platform_configuration.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -333,9 +333,9 @@ class PlatformConfiguration final {
333333
/// The frame time given as the argument indicates the point at
334334
/// which the current frame interval began. It is very slightly
335335
/// (because of scheduling overhead) in the past. If a new layer
336-
/// tree is not produced and given to the GPU task runner within
337-
/// one frame interval from this point, the Flutter application
338-
/// will jank.
336+
/// tree is not produced and given to the raster task runner
337+
/// within one frame interval from this point, the Flutter
338+
/// application will jank.
339339
///
340340
/// This method calls the `::_beginFrame` method in `hooks.dart`.
341341
///
@@ -349,13 +349,13 @@ class PlatformConfiguration final {
349349
/// @brief Dart code cannot fully measure the time it takes for a
350350
/// specific frame to be rendered. This is because Dart code only
351351
/// runs on the UI task runner. That is only a small part of the
352-
/// overall frame workload. The GPU task runner frame workload is
353-
/// executed on a thread where Dart code cannot run (and hence
352+
/// overall frame workload. The raster task runner frame workload
353+
/// is executed on a thread where Dart code cannot run (and hence
354354
/// instrument). Besides, due to the pipelined nature of rendering
355355
/// in Flutter, there may be multiple frame workloads being
356356
/// processed at any given time. However, for non-Timeline based
357357
/// profiling, it is useful for trace collection and processing to
358-
/// happen in Dart. To do this, the GPU task runner frame
358+
/// happen in Dart. To do this, the raster task runner frame
359359
/// workloads need to be instrumented separately. After a set
360360
/// number of these profiles have been gathered, they need to be
361361
/// reported back to Dart code. The engine reports this extra

runtime/runtime_controller.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,13 +275,13 @@ class RuntimeController : public PlatformConfigurationClient {
275275
/// @brief Dart code cannot fully measure the time it takes for a
276276
/// specific frame to be rendered. This is because Dart code only
277277
/// runs on the UI task runner. That is only a small part of the
278-
/// overall frame workload. The GPU task runner frame workload is
279-
/// executed on a thread where Dart code cannot run (and hence
278+
/// overall frame workload. The raster task runner frame workload
279+
/// is executed on a thread where Dart code cannot run (and hence
280280
/// instrument). Besides, due to the pipelined nature of rendering
281281
/// in Flutter, there may be multiple frame workloads being
282282
/// processed at any given time. However, for non-Timeline based
283283
/// profiling, it is useful for trace collection and processing to
284-
/// happen in Dart. To do this, the GPU task runner frame
284+
/// happen in Dart. To do this, the raster task runner frame
285285
/// workloads need to be instrumented separately. After a set
286286
/// number of these profiles have been gathered, they need to be
287287
/// reported back to Dart code. The engine reports this extra

shell/common/engine.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -443,9 +443,9 @@ class Engine final : public RuntimeDelegate,
443443
/// The frame time given as the argument indicates the point at
444444
/// which the current frame interval began. It is very slightly
445445
/// (because of scheduling overhead) in the past. If a new layer
446-
/// tree is not produced and given to the GPU task runner within
447-
/// one frame interval from this point, the Flutter application
448-
/// will jank.
446+
/// tree is not produced and given to the raster task runner
447+
/// within one frame interval from this point, the Flutter
448+
/// application will jank.
449449
///
450450
/// If a root isolate is running, this method calls the
451451
/// `::_beginFrame` method in `hooks.dart`. If a root isolate is
@@ -527,13 +527,13 @@ class Engine final : public RuntimeDelegate,
527527
/// @brief Dart code cannot fully measure the time it takes for a
528528
/// specific frame to be rendered. This is because Dart code only
529529
/// runs on the UI task runner. That is only a small part of the
530-
/// overall frame workload. The GPU task runner frame workload is
531-
/// executed on a thread where Dart code cannot run (and hence
530+
/// overall frame workload. The raster task runner frame workload
531+
/// is executed on a thread where Dart code cannot run (and hence
532532
/// instrument). Besides, due to the pipelined nature of rendering
533533
/// in Flutter, there may be multiple frame workloads being
534534
/// processed at any given time. However, for non-Timeline based
535535
/// profiling, it is useful for trace collection and processing to
536-
/// happen in Dart. To do this, the GPU task runner frame
536+
/// happen in Dart. To do this, the raster task runner frame
537537
/// workloads need to be instrumented separately. After a set
538538
/// number of these profiles have been gathered, they need to be
539539
/// reported back to Dart code. The shell reports this extra

shell/common/engine_unittests.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ class EngineTest : public ::testing::Test {
9898
EngineTest()
9999
: thread_host_("EngineTest",
100100
ThreadHost::Type::Platform | ThreadHost::Type::IO |
101-
ThreadHost::Type::UI | ThreadHost::Type::GPU),
101+
ThreadHost::Type::UI | ThreadHost::Type::RASTER),
102102
task_runners_({
103103
"EngineTest",
104104
thread_host_.platform_thread->GetTaskRunner(), // platform

shell/common/platform_view.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,7 +685,7 @@ class PlatformView {
685685
fml::WeakPtrFactory<PlatformView> weak_factory_;
686686

687687
// Unlike all other methods on the platform view, this is called on the
688-
// GPU task runner.
688+
// raster task runner.
689689
virtual std::unique_ptr<Surface> CreateRenderingSurface();
690690

691691
private:

shell/common/rasterizer.h

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@
2727
namespace flutter {
2828

2929
//------------------------------------------------------------------------------
30-
/// The rasterizer is a component owned by the shell that resides on the GPU
30+
/// The rasterizer is a component owned by the shell that resides on the raster
3131
/// task runner. Each shell owns exactly one instance of a rasterizer. The
32-
/// rasterizer may only be created, used and collected on the GPU task runner.
32+
/// rasterizer may only be created, used and collected on the raster task
33+
/// runner.
3334
///
3435
/// The rasterizer owns the instance of the currently active on-screen render
3536
/// surface. On this surface, it renders the contents of layer trees submitted
@@ -48,8 +49,8 @@ class Rasterizer final : public SnapshotDelegate {
4849
/// It can then forward these events to the engine.
4950
///
5051
/// Like all rasterizer operation, the rasterizer delegate call
51-
/// are made on the GPU task runner. Any delegate must ensure that
52-
/// they can handle the threading implications.
52+
/// are made on the raster task runner. Any delegate must ensure
53+
/// that they can handle the threading implications.
5354
///
5455
class Delegate {
5556
public:
@@ -92,9 +93,9 @@ class Rasterizer final : public SnapshotDelegate {
9293

9394
//----------------------------------------------------------------------------
9495
/// @brief Creates a new instance of a rasterizer. Rasterizers may only
95-
/// be created on the GPU task runner. Rasterizers are currently
96-
/// only created by the shell (which also sets itself up as the
97-
/// rasterizer delegate).
96+
/// be created on the raster task runner. Rasterizers are
97+
/// currently only created by the shell (which also sets itself up
98+
/// as the rasterizer delegate).
9899
///
99100
/// @param[in] delegate The rasterizer delegate.
100101
///
@@ -103,9 +104,9 @@ class Rasterizer final : public SnapshotDelegate {
103104
#if defined(LEGACY_FUCHSIA_EMBEDDER)
104105
//----------------------------------------------------------------------------
105106
/// @brief Creates a new instance of a rasterizer. Rasterizers may only
106-
/// be created on the GPU task runner. Rasterizers are currently
107-
/// only created by the shell (which also sets itself up as the
108-
/// rasterizer delegate).
107+
/// be created on the raster task runner. Rasterizers are
108+
/// currently only created by the shell (which also sets itself up
109+
/// as the rasterizer delegate).
109110
///
110111
/// @param[in] delegate The rasterizer delegate.
111112
/// @param[in] compositor_context The compositor context used to hold all
@@ -116,7 +117,7 @@ class Rasterizer final : public SnapshotDelegate {
116117
#endif
117118

118119
//----------------------------------------------------------------------------
119-
/// @brief Destroys the rasterizer. This must happen on the GPU task
120+
/// @brief Destroys the rasterizer. This must happen on the raster task
120121
/// runner. All GPU resources are collected before this call
121122
/// returns. Any context setup by the embedder to hold these
122123
/// resources can be immediately collected as well.
@@ -158,7 +159,7 @@ class Rasterizer final : public SnapshotDelegate {
158159

159160
//----------------------------------------------------------------------------
160161
/// @brief Gets a weak pointer to the rasterizer. The rasterizer may only
161-
/// be accessed on the GPU task runner.
162+
/// be accessed on the raster task runner.
162163
///
163164
/// @return The weak pointer to the rasterizer.
164165
///

shell/common/rasterizer_unittests.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ TEST(RasterizerTest, drawEmptyPipeline) {
7777
std::string test_name =
7878
::testing::UnitTest::GetInstance()->current_test_info()->name();
7979
ThreadHost thread_host("io.flutter.test." + test_name + ".",
80-
ThreadHost::Type::Platform | ThreadHost::Type::GPU |
80+
ThreadHost::Type::Platform | ThreadHost::Type::RASTER |
8181
ThreadHost::Type::IO | ThreadHost::Type::UI);
8282
TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
8383
thread_host.raster_thread->GetTaskRunner(),
@@ -102,7 +102,7 @@ TEST(RasterizerTest,
102102
std::string test_name =
103103
::testing::UnitTest::GetInstance()->current_test_info()->name();
104104
ThreadHost thread_host("io.flutter.test." + test_name + ".",
105-
ThreadHost::Type::Platform | ThreadHost::Type::GPU |
105+
ThreadHost::Type::Platform | ThreadHost::Type::RASTER |
106106
ThreadHost::Type::IO | ThreadHost::Type::UI);
107107
TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
108108
thread_host.raster_thread->GetTaskRunner(),
@@ -160,7 +160,7 @@ TEST(
160160
std::string test_name =
161161
::testing::UnitTest::GetInstance()->current_test_info()->name();
162162
ThreadHost thread_host("io.flutter.test." + test_name + ".",
163-
ThreadHost::Type::Platform | ThreadHost::Type::GPU |
163+
ThreadHost::Type::Platform | ThreadHost::Type::RASTER |
164164
ThreadHost::Type::IO | ThreadHost::Type::UI);
165165
TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
166166
thread_host.raster_thread->GetTaskRunner(),
@@ -214,7 +214,7 @@ TEST(
214214
std::string test_name =
215215
::testing::UnitTest::GetInstance()->current_test_info()->name();
216216
ThreadHost thread_host("io.flutter.test." + test_name + ".",
217-
ThreadHost::Type::Platform | ThreadHost::Type::GPU |
217+
ThreadHost::Type::Platform | ThreadHost::Type::RASTER |
218218
ThreadHost::Type::IO | ThreadHost::Type::UI);
219219
fml::MessageLoop::EnsureInitializedForCurrentThread();
220220
TaskRunners task_runners("test",
@@ -268,7 +268,7 @@ TEST(RasterizerTest, externalViewEmbedderDoesntEndFrameWhenNoSurfaceIsSet) {
268268
std::string test_name =
269269
::testing::UnitTest::GetInstance()->current_test_info()->name();
270270
ThreadHost thread_host("io.flutter.test." + test_name + ".",
271-
ThreadHost::Type::Platform | ThreadHost::Type::GPU |
271+
ThreadHost::Type::Platform | ThreadHost::Type::RASTER |
272272
ThreadHost::Type::IO | ThreadHost::Type::UI);
273273
TaskRunners task_runners("test", thread_host.platform_thread->GetTaskRunner(),
274274
thread_host.raster_thread->GetTaskRunner(),

shell/common/shell.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ class Shell final : public PlatformView::Delegate,
253253
const TaskRunners& GetTaskRunners() const override;
254254

255255
//----------------------------------------------------------------------------
256-
/// @brief Rasterizers may only be accessed on the GPU task runner.
256+
/// @brief Rasterizers may only be accessed on the raster task runner.
257257
///
258258
/// @return A weak pointer to the rasterizer.
259259
///
@@ -394,7 +394,7 @@ class Shell final : public PlatformView::Delegate,
394394
std::optional<fml::TimePoint> latest_frame_target_time_;
395395
std::unique_ptr<PlatformView> platform_view_; // on platform task runner
396396
std::unique_ptr<Engine> engine_; // on UI task runner
397-
std::unique_ptr<Rasterizer> rasterizer_; // on GPU task runner
397+
std::unique_ptr<Rasterizer> rasterizer_; // on raster task runner
398398
std::unique_ptr<ShellIOManager> io_manager_; // on IO task runner
399399
std::shared_ptr<fml::SyncSwitch> is_gpu_disabled_sync_switch_;
400400

shell/common/shell_benchmarks.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ static void StartupAndShutdownShell(benchmark::State& state,
4444

4545
thread_host = std::make_unique<ThreadHost>(
4646
"io.flutter.bench.", ThreadHost::Type::Platform |
47-
ThreadHost::Type::GPU | ThreadHost::Type::IO |
48-
ThreadHost::Type::UI);
47+
ThreadHost::Type::RASTER |
48+
ThreadHost::Type::IO | ThreadHost::Type::UI);
4949

5050
TaskRunners task_runners("test",
5151
thread_host->platform_thread->GetTaskRunner(),

0 commit comments

Comments
 (0)