mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
* Namespaces have been updated to reflect the move from //flutter/sky/shell to //flutter/shell. * shell/BUILD.gn file has been split into smaller GN files for each subcomponent of the shell (common, GPU, diagnostic, testing). * GN dependencies have been rewritten to stop exposing common shell dependencies as public. Duplicates have also been removed. * GPU subcomponent has been updated make it more suitable for Vulkan integration. * The GLFW backend has been resurrected.
52 lines
1.4 KiB
C++
52 lines
1.4 KiB
C++
// 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.
|
|
|
|
#ifndef SHELL_GPU_DIRECT_GPU_RASTERIZER_H_
|
|
#define SHELL_GPU_DIRECT_GPU_RASTERIZER_H_
|
|
|
|
#include "flutter/flow/compositor_context.h"
|
|
#include "flutter/shell/common/rasterizer.h"
|
|
#include "flutter/shell/gpu/ganesh_canvas.h"
|
|
#include "lib/ftl/memory/weak_ptr.h"
|
|
#include "lib/ftl/synchronization/waitable_event.h"
|
|
|
|
namespace shell {
|
|
|
|
class GPURasterizer : public Rasterizer {
|
|
public:
|
|
GPURasterizer();
|
|
|
|
~GPURasterizer() override;
|
|
|
|
void Setup(PlatformView* platform_view,
|
|
ftl::Closure continuation,
|
|
ftl::AutoResetWaitableEvent* setup_completion_event) override;
|
|
|
|
void Clear(SkColor color) override;
|
|
|
|
void Teardown(
|
|
ftl::AutoResetWaitableEvent* teardown_completion_event) override;
|
|
|
|
ftl::WeakPtr<Rasterizer> GetWeakRasterizerPtr() override;
|
|
|
|
flow::LayerTree* GetLastLayerTree() override;
|
|
|
|
void Draw(ftl::RefPtr<flutter::Pipeline<flow::LayerTree>> pipeline) override;
|
|
|
|
private:
|
|
GaneshCanvas ganesh_canvas_;
|
|
flow::CompositorContext compositor_context_;
|
|
std::unique_ptr<flow::LayerTree> last_layer_tree_;
|
|
PlatformView* platform_view_;
|
|
ftl::WeakPtrFactory<GPURasterizer> weak_factory_;
|
|
|
|
void DoDraw(std::unique_ptr<flow::LayerTree> tree);
|
|
|
|
FTL_DISALLOW_COPY_AND_ASSIGN(GPURasterizer);
|
|
};
|
|
|
|
} // namespace shell
|
|
|
|
#endif // SHELL_GPU_DIRECT_GPU_RASTERIZER_H_
|