From f2af347363ddb5b4ed9598b285d4f5ce000331d5 Mon Sep 17 00:00:00 2001 From: Chinmay Garde Date: Mon, 31 Jul 2017 15:16:48 -0700 Subject: [PATCH] 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. --- shell/common/null_rasterizer.cc | 7 ++++++- shell/common/null_rasterizer.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/shell/common/null_rasterizer.cc b/shell/common/null_rasterizer.cc index 670e4238038..81c0e1f458b 100644 --- a/shell/common/null_rasterizer.cc +++ b/shell/common/null_rasterizer.cc @@ -39,7 +39,12 @@ void NullRasterizer::Clear(SkColor color, const SkISize& size) { void NullRasterizer::Draw( ftl::RefPtr> pipeline) { - // Null rasterizer. Nothing to do. + FTL_ALLOW_UNUSED_LOCAL( + pipeline->Consume([](std::unique_ptr) { + // 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 diff --git a/shell/common/null_rasterizer.h b/shell/common/null_rasterizer.h index 4b120a9d304..eba9a57e4f3 100644 --- a/shell/common/null_rasterizer.h +++ b/shell/common/null_rasterizer.h @@ -31,8 +31,8 @@ class NullRasterizer : public Rasterizer { void Draw(ftl::RefPtr> pipeline) override; private: - ftl::WeakPtrFactory weak_factory_; std::unique_ptr surface_; + ftl::WeakPtrFactory weak_factory_; FTL_DISALLOW_COPY_AND_ASSIGN(NullRasterizer); };