mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Always consume items from the pipeline in the null rasterizer. (#3937)
Now, frame requests past the pipeline depth will never be deferred due to back pressure. This backend is only used in the test runner.
This commit is contained in:
parent
cafbd9b0b5
commit
f2af347363
@ -39,7 +39,12 @@ void NullRasterizer::Clear(SkColor color, const SkISize& size) {
|
||||
|
||||
void NullRasterizer::Draw(
|
||||
ftl::RefPtr<flutter::Pipeline<flow::LayerTree>> pipeline) {
|
||||
// Null rasterizer. Nothing to do.
|
||||
FTL_ALLOW_UNUSED_LOCAL(
|
||||
pipeline->Consume([](std::unique_ptr<flow::LayerTree>) {
|
||||
// Drop the layer tree on the floor. We only need the pipeline empty so
|
||||
// that frame requests are not deferred indefinitely due to
|
||||
// backpressure.
|
||||
}));
|
||||
}
|
||||
|
||||
} // namespace shell
|
||||
|
||||
@ -31,8 +31,8 @@ class NullRasterizer : public Rasterizer {
|
||||
void Draw(ftl::RefPtr<flutter::Pipeline<flow::LayerTree>> pipeline) override;
|
||||
|
||||
private:
|
||||
ftl::WeakPtrFactory<NullRasterizer> weak_factory_;
|
||||
std::unique_ptr<Surface> surface_;
|
||||
ftl::WeakPtrFactory<NullRasterizer> weak_factory_;
|
||||
|
||||
FTL_DISALLOW_COPY_AND_ASSIGN(NullRasterizer);
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user