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:
Chinmay Garde 2017-07-31 15:16:48 -07:00 committed by GitHub
parent cafbd9b0b5
commit f2af347363
2 changed files with 7 additions and 2 deletions

View File

@ -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

View File

@ -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);
};