Flutter Engine
embedder_test_backingstore_producer.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_SHELL_PLATFORM_EMBEDDER_TESTS_EMBEDDER_TEST_BACKINGSTORE_PRODUCER_H_
6 #define FLUTTER_SHELL_PLATFORM_EMBEDDER_TESTS_EMBEDDER_TEST_BACKINGSTORE_PRODUCER_H_
7 
8 #include <memory>
9 #include "flutter/fml/macros.h"
10 #include "flutter/shell/platform/embedder/embedder.h"
11 #include "third_party/skia/include/gpu/GrDirectContext.h"
12 
13 #ifdef SHELL_ENABLE_METAL
14 #include "flutter/testing/test_metal_context.h"
15 #endif
16 
17 namespace flutter {
18 namespace testing {
19 
21  public:
22  enum class RenderTargetType {
27  };
28 
29  EmbedderTestBackingStoreProducer(sk_sp<GrDirectContext> context,
32 
33  bool Create(const FlutterBackingStoreConfig* config,
34  FlutterBackingStore* renderer_out);
35 
36  private:
37  bool CreateFramebuffer(const FlutterBackingStoreConfig* config,
38  FlutterBackingStore* renderer_out);
39 
40  bool CreateTexture(const FlutterBackingStoreConfig* config,
41  FlutterBackingStore* renderer_out);
42 
43  bool CreateSoftware(const FlutterBackingStoreConfig* config,
44  FlutterBackingStore* backing_store_out);
45 
46  bool CreateMTLTexture(const FlutterBackingStoreConfig* config,
47  FlutterBackingStore* renderer_out);
48 
49  sk_sp<GrDirectContext> context_;
50  RenderTargetType type_;
51 
52 #ifdef SHELL_ENABLE_METAL
53  std::unique_ptr<TestMetalContext> test_metal_context_;
54 #endif
55 
57 };
58 
59 } // namespace testing
60 } // namespace flutter
61 
62 #endif // FLUTTER_SHELL_PLATFORM_EMBEDDER_TESTS_EMBEDDER_TEST_BACKINGSTORE_PRODUCER_H_
KeyCallType type
EmbedderTestBackingStoreProducer(sk_sp< GrDirectContext > context, RenderTargetType type)
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition: macros.h:27
bool Create(const FlutterBackingStoreConfig *config, FlutterBackingStore *renderer_out)