| Flutter Impeller |

playground_test.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef FLUTTER_IMPELLER_TOOLKIT_INTEROP_PLAYGROUND_TEST_H_
6 #define FLUTTER_IMPELLER_TOOLKIT_INTEROP_PLAYGROUND_TEST_H_
7
8 #include <functional>
9
10 #include "impeller/playground/playground_test.h"
11 #include "impeller/toolkit/interop/context.h"
12 #include "impeller/toolkit/interop/impeller.hpp"
13 #include "impeller/toolkit/interop/surface.h"
14
15 namespace impeller::interop::testing {
16
17 class PlaygroundTest : public ::impeller::PlaygroundTest {
18 public:
19 PlaygroundTest();
20
21 // |PlaygroundTest|
22 ~PlaygroundTest() override;
23
24 PlaygroundTest(const PlaygroundTest&) = delete;
25
26 PlaygroundTest& operator=(const PlaygroundTest&) = delete;
27
28 // |PlaygroundTest|
29 void SetUp() override;
30
31 // |PlaygroundTest|
32 void TearDown() override;
33
34 ScopedObject<Context> CreateContext() const;
35
36 ScopedObject<Context> GetInteropContext();
37
38 hpp::Context GetHPPContext();
39
40 hpp::Texture OpenAssetAsHPPTexture(std::string asset_name);
41
42 using InteropPlaygroundCallback =
43 std::function<bool(const ScopedObject<Context>& context,
44 const ScopedObject<Surface>& surface)>;
45 bool OpenPlaygroundHere(InteropPlaygroundCallback callback);
46
47 std::unique_ptr<hpp::Mapping> OpenAssetAsHPPMapping(
48 std::string asset_name) const;
49
50 private:
51 ScopedObject<Context> interop_context_;
52 };
53
54 } // namespace impeller::interop::testing
55
56 #endif // FLUTTER_IMPELLER_TOOLKIT_INTEROP_PLAYGROUND_TEST_H_
impeller::PlaygroundTest
Definition: playground_test.h:22
impeller::interop::ScopedObject
Definition: object.h:67
impeller::interop::testing::PlaygroundTest
Definition: playground_test.h:17
impeller::interop::testing::PlaygroundTest::OpenAssetAsHPPTexture
hpp::Texture OpenAssetAsHPPTexture(std::string asset_name)
Definition: playground_test.cc:200
impeller::interop::testing::PlaygroundTest::SetUp
void SetUp() override
Definition: playground_test.cc:50
impeller::interop::testing::PlaygroundTest::CreateContext
ScopedObject< Context > CreateContext() const
Definition: playground_test.cc:59
impeller::interop::testing::PlaygroundTest::OpenAssetAsHPPMapping
std::unique_ptr< hpp::Mapping > OpenAssetAsHPPMapping(std::string asset_name) const
Definition: playground_test.cc:187
impeller::interop::testing::PlaygroundTest::GetInteropContext
ScopedObject< Context > GetInteropContext()
Definition: playground_test.cc:168
impeller::interop::testing::PlaygroundTest::~PlaygroundTest
~PlaygroundTest() override
impeller::interop::testing::PlaygroundTest::TearDown
void TearDown() override
Definition: playground_test.cc:55
impeller::interop::testing::PlaygroundTest::operator=
PlaygroundTest & operator=(const PlaygroundTest &)=delete
impeller::interop::testing::PlaygroundTest::InteropPlaygroundCallback
std::function< bool(const ScopedObject< Context > &context, const ScopedObject< Surface > &surface)> InteropPlaygroundCallback
Definition: playground_test.h:44
impeller::interop::testing::PlaygroundTest::GetHPPContext
hpp::Context GetHPPContext()
Definition: playground_test.cc:181
impeller::interop::testing::PlaygroundTest::OpenPlaygroundHere
bool OpenPlaygroundHere(InteropPlaygroundCallback callback)
Definition: playground_test.cc:127
impeller::interop::testing::PlaygroundTest::PlaygroundTest
PlaygroundTest()
Definition: playground_test.cc:43
impeller::interop::testing::PlaygroundTest::PlaygroundTest
PlaygroundTest(const PlaygroundTest &)=delete
impeller.hpp
impeller::interop::testing
Definition: impeller_unittests.cc:25
playground_test.h
context.h
surface.h