Flutter Engine
The Flutter Engine
Classes | Public Types | Public Member Functions | List of all members
flutter::testing::EmbedderTestBackingStoreProducer Class Reference

#include <embedder_test_backingstore_producer.h>

Classes

struct  UserData
 

Public Types

enum class  RenderTargetType {
  kSoftwareBuffer , kSoftwareBuffer2 , kOpenGLFramebuffer , kOpenGLTexture ,
  kMetalTexture , kVulkanImage
}
 

Public Member Functions

 EmbedderTestBackingStoreProducer (sk_sp< GrDirectContext > context, RenderTargetType type, FlutterSoftwarePixelFormat software_pixfmt=kFlutterSoftwarePixelFormatNative32)
 
 ~EmbedderTestBackingStoreProducer ()
 
bool Create (const FlutterBackingStoreConfig *config, FlutterBackingStore *renderer_out)
 

Detailed Description

Definition at line 27 of file embedder_test_backingstore_producer.h.

Member Enumeration Documentation

◆ RenderTargetType

Enumerator
kSoftwareBuffer 
kSoftwareBuffer2 
kOpenGLFramebuffer 
kOpenGLTexture 
kMetalTexture 
kVulkanImage 

Definition at line 34 of file embedder_test_backingstore_producer.h.

34 {
35 kSoftwareBuffer,
36 kSoftwareBuffer2,
37 kOpenGLFramebuffer,
38 kOpenGLTexture,
39 kMetalTexture,
40 kVulkanImage,
41 };

Constructor & Destructor Documentation

◆ EmbedderTestBackingStoreProducer()

flutter::testing::EmbedderTestBackingStoreProducer::EmbedderTestBackingStoreProducer ( sk_sp< GrDirectContext context,
RenderTargetType  type,
FlutterSoftwarePixelFormat  software_pixfmt = kFlutterSoftwarePixelFormatNative32 
)

Definition at line 40 of file embedder_test_backingstore_producer.cc.

44 : context_(std::move(context)),
45 type_(type),
46 software_pixfmt_(software_pixfmt)
47#ifdef SHELL_ENABLE_METAL
48 ,
49 test_metal_context_(std::make_unique<TestMetalContext>())
50#endif
51#ifdef SHELL_ENABLE_VULKAN
52 ,
53 test_vulkan_context_(nullptr)
54#endif
55{
57 software_pixfmt_ != kFlutterSoftwarePixelFormatNative32) {
58 FML_LOG(ERROR) << "Expected pixel format to be the default "
59 "(kFlutterSoftwarePixelFormatNative32) when"
60 "backing store producer should produce deprecated v1 "
61 "software backing "
62 "stores.";
63 std::abort();
64 };
65}
GLenum type
@ kFlutterSoftwarePixelFormatNative32
Definition: embedder.h:363
#define FML_LOG(severity)
Definition: logging.h:82
#define ERROR(message)
Definition: elf_loader.cc:260

◆ ~EmbedderTestBackingStoreProducer()

flutter::testing::EmbedderTestBackingStoreProducer::~EmbedderTestBackingStoreProducer ( )
default

Member Function Documentation

◆ Create()

bool flutter::testing::EmbedderTestBackingStoreProducer::Create ( const FlutterBackingStoreConfig config,
FlutterBackingStore renderer_out 
)

Definition at line 69 of file embedder_test_backingstore_producer.cc.

71 {
72 switch (type_) {
74 return CreateSoftware(config, renderer_out);
76 return CreateSoftware2(config, renderer_out);
77#ifdef SHELL_ENABLE_GL
79 return CreateTexture(config, renderer_out);
81 return CreateFramebuffer(config, renderer_out);
82#endif
83#ifdef SHELL_ENABLE_METAL
85 return CreateMTLTexture(config, renderer_out);
86#endif
87#ifdef SHELL_ENABLE_VULKAN
89 return CreateVulkanImage(config, renderer_out);
90#endif
91 default:
92 return false;
93 }
94}

The documentation for this class was generated from the following files: