rasterizer.h 1.2 KB
Newer Older
A
Adam Barth 已提交
1 2 3 4
// Copyright 2015 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.

5 6
#ifndef SHELL_COMMON_RASTERIZER_H_
#define SHELL_COMMON_RASTERIZER_H_
A
Adam Barth 已提交
7 8

#include <memory>
A
Adam Barth 已提交
9

10
#include "flutter/flow/layers/layer_tree.h"
11
#include "flutter/shell/common/surface.h"
12 13
#include "flutter/synchronization/pipeline.h"
#include "lib/ftl/functional/closure.h"
14 15
#include "lib/ftl/memory/weak_ptr.h"
#include "lib/ftl/synchronization/waitable_event.h"
A
Adam Barth 已提交
16 17 18

namespace shell {

19
class Rasterizer {
A
Adam Barth 已提交
20
 public:
21
  virtual ~Rasterizer();
22

23
  virtual void Setup(std::unique_ptr<Surface> surface_or_null,
24 25
                     ftl::Closure rasterizer_continuation,
                     ftl::AutoResetWaitableEvent* setup_completion_event) = 0;
26

27 28
  virtual void Teardown(
      ftl::AutoResetWaitableEvent* teardown_completion_event) = 0;
29

30 31
  virtual void Clear(SkColor color, const SkISize& size) = 0;

32
  virtual ftl::WeakPtr<Rasterizer> GetWeakRasterizerPtr() = 0;
A
Adam Barth 已提交
33

34 35
  virtual flow::LayerTree* GetLastLayerTree() = 0;

36 37
  virtual void Draw(
      ftl::RefPtr<flutter::Pipeline<flow::LayerTree>> pipeline) = 0;
A
Adam Barth 已提交
38 39 40 41
};

}  // namespace shell

42
#endif  // SHELL_COMMON_RASTERIZER_H_