forked from flutter/engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reland "Share engine layers with the framework" (flutter#6412) (flutt…
…er#6468) This reverts commit 74662ab. This should land after flutter#6442 * Add pragma vm:entry-point Otherwise, an object may be both null and an instance of EnginieLayer at the same time in Dart.
- Loading branch information
Showing
14 changed files
with
140 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Copyright 2018 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. | ||
|
||
#include "flutter/lib/ui/painting/engine_layer.h" | ||
|
||
#include "flutter/flow/layers/container_layer.h" | ||
|
||
#include "third_party/tonic/converter/dart_converter.h" | ||
#include "third_party/tonic/dart_args.h" | ||
#include "third_party/tonic/dart_binding_macros.h" | ||
#include "third_party/tonic/dart_library_natives.h" | ||
|
||
using tonic::ToDart; | ||
|
||
namespace blink { | ||
|
||
EngineLayer::~EngineLayer() = default; | ||
|
||
IMPLEMENT_WRAPPERTYPEINFO(ui, EngineLayer); | ||
|
||
#define FOR_EACH_BINDING(V) // nothing to bind | ||
|
||
DART_BIND_ALL(EngineLayer, FOR_EACH_BINDING) | ||
|
||
} // namespace blink |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright 2018 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_LIB_UI_PAINTING_ENGINE_LAYER_H_ | ||
#define FLUTTER_LIB_UI_PAINTING_ENGINE_LAYER_H_ | ||
|
||
#include "flutter/lib/ui/dart_wrapper.h" | ||
|
||
#include "flutter/flow/layers/layer.h" | ||
|
||
namespace tonic { | ||
class DartLibraryNatives; | ||
} // namespace tonic | ||
|
||
namespace blink { | ||
|
||
class EngineLayer; | ||
|
||
class EngineLayer : public RefCountedDartWrappable<EngineLayer> { | ||
DEFINE_WRAPPERTYPEINFO(); | ||
|
||
public: | ||
~EngineLayer() override; | ||
static fml::RefPtr<EngineLayer> MakeRetained( | ||
std::shared_ptr<flow::ContainerLayer> layer) { | ||
return fml::MakeRefCounted<EngineLayer>(layer); | ||
} | ||
|
||
static void RegisterNatives(tonic::DartLibraryNatives* natives); | ||
|
||
std::shared_ptr<flow::ContainerLayer> Layer() const { return layer_; } | ||
|
||
private: | ||
explicit EngineLayer(std::shared_ptr<flow::ContainerLayer> layer) | ||
: layer_(layer) {} | ||
std::shared_ptr<flow::ContainerLayer> layer_; | ||
|
||
FML_FRIEND_MAKE_REF_COUNTED(EngineLayer); | ||
}; | ||
|
||
} // namespace blink | ||
|
||
#endif // FLUTTER_LIB_UI_PAINTING_ENGINE_LAYER_H_ |