mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
When Flutter engine connects to Scenic, Scenic has already checked the display and graphics device availability before Scenic starts; so it is guaranteed that display devices are available and surface is valid when it is created. Thus this change removes the device watching details from flutter surface on Fuchsia so that it doesn't need to do duplicated checks and hides the device-specific details.
49 lines
1.3 KiB
C++
49 lines
1.3 KiB
C++
// Copyright 2013 The Flutter Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#pragma once
|
|
|
|
#include "flutter/flow/surface.h"
|
|
#include "flutter/fml/macros.h"
|
|
#include "flutter/fml/memory/weak_ptr.h"
|
|
|
|
namespace flutter_runner {
|
|
|
|
// The interface between the Flutter rasterizer and the underlying platform. May
|
|
// be constructed on any thread but will be used by the engine only on the
|
|
// raster thread.
|
|
class Surface final : public flutter::Surface {
|
|
public:
|
|
Surface(std::string debug_label,
|
|
flutter::ExternalViewEmbedder* view_embedder,
|
|
GrDirectContext* gr_context);
|
|
|
|
~Surface() override;
|
|
|
|
private:
|
|
const std::string debug_label_;
|
|
flutter::ExternalViewEmbedder* view_embedder_;
|
|
GrDirectContext* gr_context_;
|
|
|
|
// |flutter::Surface|
|
|
bool IsValid() override;
|
|
|
|
// |flutter::Surface|
|
|
std::unique_ptr<flutter::SurfaceFrame> AcquireFrame(
|
|
const SkISize& size) override;
|
|
|
|
// |flutter::Surface|
|
|
GrDirectContext* GetContext() override;
|
|
|
|
// |flutter::Surface|
|
|
SkMatrix GetRootTransformation() const override;
|
|
|
|
// |flutter::Surface|
|
|
flutter::ExternalViewEmbedder* GetExternalViewEmbedder() override;
|
|
|
|
FML_DISALLOW_COPY_AND_ASSIGN(Surface);
|
|
};
|
|
|
|
} // namespace flutter_runner
|