mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Compute the necessary texture resolution using more accurate scaling information provided by Mozart scene node metrics events instead of the device pixel ratio provided by the Mozart view properties (which we might remove in the future). This allows us to allocate smaller textures when a Flutter view is being scaled down.
43 lines
1.2 KiB
C++
43 lines
1.2 KiB
C++
// Copyright 2017 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_CONTENT_HANDLER_VULKAN_RASTERIZER_H_
|
|
#define FLUTTER_CONTENT_HANDLER_VULKAN_RASTERIZER_H_
|
|
|
|
#include <memory>
|
|
|
|
#include "flutter/content_handler/rasterizer.h"
|
|
#include "flutter/content_handler/session_connection.h"
|
|
#include "flutter/flow/compositor_context.h"
|
|
#include "lib/ftl/macros.h"
|
|
|
|
namespace flutter_runner {
|
|
|
|
class VulkanRasterizer : public Rasterizer {
|
|
public:
|
|
VulkanRasterizer();
|
|
|
|
~VulkanRasterizer() override;
|
|
|
|
bool IsValid() const;
|
|
|
|
void SetScene(fidl::InterfaceHandle<mozart2::SceneManager> scene_manager,
|
|
mx::eventpair import_token,
|
|
ftl::Closure metrics_changed_callback) override;
|
|
|
|
void Draw(std::unique_ptr<flow::LayerTree> layer_tree,
|
|
ftl::Closure callback) override;
|
|
|
|
private:
|
|
flow::CompositorContext compositor_context_;
|
|
std::unique_ptr<SessionConnection> session_connection_;
|
|
bool valid_;
|
|
|
|
FTL_DISALLOW_COPY_AND_ASSIGN(VulkanRasterizer);
|
|
};
|
|
|
|
} // namespace flutter_runner
|
|
|
|
#endif // FLUTTER_CONTENT_HANDLER_VULKAN_RASTERIZER_H_
|