flutter_flutter/shell/common/null_rasterizer.h
xster f187a5c219 Create platform API for first frame callback. Use for defer hiding splash screens on Android and iOS (#3956)
* Add back launch screen view until first frame on iOS

* improvements

* Move callback plumbing from ios surfaces to the gpu rasterizer. Didn’t wire java JNI yet.

* Android JNI

* Fix ios reference count and let android engine manage a view on top with launch screen

* Hook up Android activity and view

* review notes

* review notes

* Move thread switching upstream. Use weak references for callbacks.

* Some clean up
2017-08-14 15:44:52 -07:00

45 lines
1.3 KiB
C++

// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef FLUTTER_SHELL_COMMON_NULL_RASTERIZER_H_
#define FLUTTER_SHELL_COMMON_NULL_RASTERIZER_H_
#include "flutter/shell/common/rasterizer.h"
#include "lib/ftl/macros.h"
#include "lib/ftl/memory/weak_ptr.h"
namespace shell {
class NullRasterizer : public Rasterizer {
public:
NullRasterizer();
void Setup(std::unique_ptr<Surface> surface_or_null,
ftl::Closure rasterizer_continuation,
ftl::AutoResetWaitableEvent* setup_completion_event) override;
void Teardown(
ftl::AutoResetWaitableEvent* teardown_completion_event) override;
void Clear(SkColor color, const SkISize& size) override;
ftl::WeakPtr<Rasterizer> GetWeakRasterizerPtr() override;
flow::LayerTree* GetLastLayerTree() override;
void Draw(ftl::RefPtr<flutter::Pipeline<flow::LayerTree>> pipeline) override;
void AddNextFrameCallback(ftl::Closure nextFrameCallback) override;
private:
std::unique_ptr<Surface> surface_;
ftl::WeakPtrFactory<NullRasterizer> weak_factory_;
FTL_DISALLOW_COPY_AND_ASSIGN(NullRasterizer);
};
} // namespace shell
#endif // FLUTTER_SHELL_COMMON_NULL_RASTERIZER_H_