Flutter Engine
 
Loading...
Searching...
No Matches
mock_texture_registrar.cc File Reference

Go to the source code of this file.

Classes

struct  _FlMockTextureRegistrar
 

Functions

static void fl_mock_texture_registrar_iface_init (FlTextureRegistrarInterface *iface)
 
 G_DEFINE_TYPE_WITH_CODE (FlMockTextureRegistrar, fl_mock_texture_registrar, G_TYPE_OBJECT, G_IMPLEMENT_INTERFACE(fl_texture_registrar_get_type(), fl_mock_texture_registrar_iface_init)) static gboolean register_texture(FlTextureRegistrar *registrar
 
 if (self->texture !=nullptr)
 
static FlTexture * lookup_texture (FlTextureRegistrar *registrar, int64_t texture_id)
 
static gboolean mark_texture_frame_available (FlTextureRegistrar *registrar, FlTexture *texture)
 
static gboolean unregister_texture (FlTextureRegistrar *registrar, FlTexture *texture)
 
static void fl_mock_texture_registrar_dispose (GObject *object)
 
static void fl_mock_texture_registrar_class_init (FlMockTextureRegistrarClass *klass)
 
static void fl_mock_texture_registrar_init (FlMockTextureRegistrar *self)
 
FlMockTextureRegistrar * fl_mock_texture_registrar_new ()
 
FlTexture * fl_mock_texture_registrar_get_texture (FlMockTextureRegistrar *self)
 
gboolean fl_mock_texture_registrar_get_frame_available (FlMockTextureRegistrar *self)
 

Variables

FlTexture * texture
 
return TRUE
 

Function Documentation

◆ fl_mock_texture_registrar_class_init()

static void fl_mock_texture_registrar_class_init ( FlMockTextureRegistrarClass *  klass)
static

Definition at line 79 of file mock_texture_registrar.cc.

80 {
81 G_OBJECT_CLASS(klass)->dispose = fl_mock_texture_registrar_dispose;
82}
static void fl_mock_texture_registrar_dispose(GObject *object)

References fl_mock_texture_registrar_dispose().

◆ fl_mock_texture_registrar_dispose()

static void fl_mock_texture_registrar_dispose ( GObject *  object)
static

Definition at line 73 of file mock_texture_registrar.cc.

73 {
74 FlMockTextureRegistrar* self = FL_MOCK_TEXTURE_REGISTRAR(object);
75 g_clear_object(&self->texture);
76 G_OBJECT_CLASS(fl_mock_texture_registrar_parent_class)->dispose(object);
77}

References self.

Referenced by fl_mock_texture_registrar_class_init().

◆ fl_mock_texture_registrar_get_frame_available()

gboolean fl_mock_texture_registrar_get_frame_available ( FlMockTextureRegistrar *  self)

Definition at line 95 of file mock_texture_registrar.cc.

96 {
97 return self->frame_available;
98}

References self.

Referenced by TEST().

◆ fl_mock_texture_registrar_get_texture()

FlTexture * fl_mock_texture_registrar_get_texture ( FlMockTextureRegistrar *  self)

Definition at line 91 of file mock_texture_registrar.cc.

91 {
92 return self->texture;
93}

References self.

Referenced by TEST().

◆ fl_mock_texture_registrar_iface_init()

static void fl_mock_texture_registrar_iface_init ( FlTextureRegistrarInterface *  iface)
static

Definition at line 65 of file mock_texture_registrar.cc.

66 {
67 iface->register_texture = register_texture;
68 iface->lookup_texture = lookup_texture;
69 iface->mark_texture_frame_available = mark_texture_frame_available;
70 iface->unregister_texture = unregister_texture;
71}
static gboolean register_texture(FlTextureRegistrar *registrar, FlTexture *texture)
static gboolean mark_texture_frame_available(FlTextureRegistrar *registrar, FlTexture *texture)
static FlTexture * lookup_texture(FlTextureRegistrar *registrar, int64_t texture_id)
static gboolean unregister_texture(FlTextureRegistrar *registrar, FlTexture *texture)

References lookup_texture(), mark_texture_frame_available(), register_texture(), and unregister_texture().

◆ fl_mock_texture_registrar_init()

static void fl_mock_texture_registrar_init ( FlMockTextureRegistrar *  self)
static

Definition at line 84 of file mock_texture_registrar.cc.

84{}

◆ fl_mock_texture_registrar_new()

FlMockTextureRegistrar * fl_mock_texture_registrar_new ( )

Definition at line 86 of file mock_texture_registrar.cc.

86 {
87 return FL_MOCK_TEXTURE_REGISTRAR(
88 g_object_new(fl_mock_texture_registrar_get_type(), nullptr));
89}

Referenced by TEST().

◆ G_DEFINE_TYPE_WITH_CODE()

G_DEFINE_TYPE_WITH_CODE ( FlMockTextureRegistrar  ,
fl_mock_texture_registrar  ,
G_TYPE_OBJECT  ,
G_IMPLEMENT_INTERFACE(fl_texture_registrar_get_type(), fl_mock_texture_registrar_iface_init  
)

◆ if()

if ( self->texture = nullptr)

Definition at line 26 of file mock_texture_registrar.cc.

26 {
27 return FALSE;
28 }

◆ lookup_texture()

static FlTexture * lookup_texture ( FlTextureRegistrar *  registrar,
int64_t  texture_id 
)
static

Definition at line 33 of file mock_texture_registrar.cc.

34 {
35 FlMockTextureRegistrar* self = FL_MOCK_TEXTURE_REGISTRAR(registrar);
36 if (self->texture != nullptr &&
37 fl_texture_get_id(self->texture) == texture_id) {
38 return self->texture;
39 }
40 return nullptr;
41}
G_MODULE_EXPORT int64_t fl_texture_get_id(FlTexture *self)
Definition fl_texture.cc:20
int64_t texture_id

References fl_texture_get_id(), self, and texture_id.

Referenced by fl_mock_texture_registrar_iface_init(), and mark_texture_frame_available().

◆ mark_texture_frame_available()

static gboolean mark_texture_frame_available ( FlTextureRegistrar *  registrar,
FlTexture *  texture 
)
static

Definition at line 43 of file mock_texture_registrar.cc.

44 {
45 FlMockTextureRegistrar* self = FL_MOCK_TEXTURE_REGISTRAR(registrar);
46 if (lookup_texture(registrar, fl_texture_get_id(texture)) == nullptr) {
47 return FALSE;
48 }
49 self->frame_available = TRUE;
50 return TRUE;
51}
FlTexture * texture
return TRUE

References fl_texture_get_id(), lookup_texture(), self, texture, and TRUE.

Referenced by fl_mock_texture_registrar_iface_init().

◆ unregister_texture()

static gboolean unregister_texture ( FlTextureRegistrar *  registrar,
FlTexture *  texture 
)
static

Definition at line 53 of file mock_texture_registrar.cc.

54 {
55 FlMockTextureRegistrar* self = FL_MOCK_TEXTURE_REGISTRAR(registrar);
56 if (self->texture != texture) {
57 return FALSE;
58 }
59
60 g_clear_object(&self->texture);
61
62 return TRUE;
63}

References self, texture, and TRUE.

Referenced by fl_mock_texture_registrar_iface_init().

Variable Documentation

◆ texture

self texture
Initial value:
{
FlMockTextureRegistrar* self = FL_MOCK_TEXTURE_REGISTRAR(registrar)

Definition at line 24 of file mock_texture_registrar.cc.

Referenced by _glBindTexture(), impeller::AHBSwapchainImplVK::AcquireNextDrawable(), add_mock_texture_to_registrar(), impeller::AddMipmapGeneration(), FlutterTextInputPlugin()::addToInputParentViewIfNeeded:, impeller::Bind(), impeller::testing::RecordingRenderPass::BindDynamicResource(), impeller::RenderPass::BindDynamicResource(), impeller::testing::RecordingRenderPass::BindResource(), impeller::RenderPass::BindResource(), flutter::egl::ProcTable::BindTexture(), impeller::BulkUpdateAtlasBitmap(), impeller::SamplerGLES::ConfigureBoundTexture(), impeller::ConfigureFBO(), flutter::ImageEncodingImpeller::ConvertDlImageToSkImage(), impeller::TextureMTL::Create(), impeller::Paint::CreateContents(), impeller::DlPlayground::CreateDlImageForFixture(), impeller::GoldenPlaygroundTest::CreateDlImageForFixture(), impeller::compiler::ShaderBundleData::CreateFlatbuffer(), flutter::testing::TestMetalContext::CreateMetalTexture(), impeller::CreateTexture(), impeller::Playground::CreateTextureCubeForFixture(), impeller::CreateTextureForDecompressedImage(), impeller::Playground::CreateTextureForFixture(), flutter::UnrefQueue< T >::DeleteTexture(), flutter::gpu::RenderPass::Draw(), impeller::DlDispatcherBase::drawImage(), impeller::interop::DisplayListBuilder::DrawTexture(), impeller::interop::DisplayListBuilder::DrawTextureRect(), impeller::Canvas::DrawVertices(), flutter::testing::EmbedderTestContextMetal::EmbedderTestContextMetal(), impeller::BlitGenerateMipmapCommandGLES::Encode(), fl_engine_gl_external_texture_frame_callback(), fl_pixel_buffer_texture_get_id(), fl_pixel_buffer_texture_populate(), fl_test_texture_populate(), fl_texture_gl_get_id(), fl_texture_registrar_mark_texture_frame_available(), fl_texture_registrar_register_texture(), fl_texture_registrar_unregister_texture(), FlutterEngineInitialize(), G_DECLARE_DERIVABLE_TYPE(), G_DECLARE_INTERFACE(), impeller::TextureMTL::GenerateMipmap(), impeller::BlitPass::GenerateMipmap(), flutter::ImageEncodingImpeller::GetColorSpace(), flutter::testing::EmbedderTestContextMetal::GetNextDrawable(), impeller::RenderTarget::GetRenderTargetPixelFormat(), flutter::GPUSurfaceMetalImpeller::GetSurfaceData(), flutter::testing::GetSurfaceFromTexture(), impeller::interop::ImpellerDisplayListBuilderDrawTexture(), impeller::interop::ImpellerDisplayListBuilderDrawTextureRect(), flutter::testing::DlMetalSurfaceProvider::ImpellerSnapshot(), impeller::interop::ImpellerTextureCreateWithContentsNew(), impeller::interop::ImpellerTextureCreateWithOpenGLTextureHandleNew(), impeller::interop::ImpellerTextureGetOpenGLHandle(), impeller::interop::ImpellerTextureRelease(), impeller::interop::ImpellerTextureRetain(), InferMetalPlatformViewCreationCallback(), InternalFlutterGpu_RenderPass_BindTexture(), InternalFlutterGpu_RenderPass_SetColorAttachment(), InternalFlutterGpu_RenderPass_SetDepthStencilAttachment(), InternalFlutterGpu_Texture_Initialize(), InternalFlutterGpu_Texture_Overwrite(), lookup_texture(), impeller::FilterInput::Make(), impeller::DlImageImpeller::Make(), impeller::FilterInput::Make(), impeller::SurfaceMTL::MakeFromTexture(), impeller::testing::MetalScreenshotter::MakeScreenshot(), impeller::testing::VulkanScreenshotter::MakeScreenshot(), MakeSkSurfaceFromBackingStore(), mark_texture_frame_available(), mark_texture_frame_available(), flutter::EmbedderEngine::MarkTextureFrameAvailable(), impeller::testing::mockIsTexture(), impeller::GoldenPlaygroundTest::OpenPlaygroundHere(), flutter::gpu::Texture::Overwrite(), flutter::TextureLayer::Paint(), flutter::FlutterWindowsTextureRegistrar::PopulateTexture(), impeller::AHBTexturePoolVK::Push(), register_texture(), flutter::PlatformViewIOS::RegisterExternalTexture(), flutter::TextureRegistry::RegisterTexture(), flutter::EmbedderEngine::RegisterTexture(), flutter::PlatformView::RegisterTexture(), flutter::TextureRegistrarImpl::RegisterTexture(), impeller::VerticesSimpleBlendContents::Render(), impeller::testing::RendererDartTest::RenderDartToPlayground(), impeller::testing::RendererDartTest::RendererDartTest(), impeller::PassBindingsCacheMTL::SetTexture(), impeller::TextureContents::SetTexture(), impeller::TiledTextureContents::SetTexture(), impeller::VerticesSimpleBlendContents::SetTexture(), impeller::GlyphAtlas::SetTexture(), impeller::ComputePassBindingsCacheMTL::SetTexture(), flutter::SetTextureLayout(), impeller::testing::TEST(), impeller::TEST(), impeller::testing::TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), flutter::testing::TEST(), impeller::testing::TEST(), flutter::TEST(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), flutter::testing::TEST_F(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::interop::testing::TEST_P(), impeller::interop::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::testing::TEST_P(), impeller::interop::Texture::Texture(), impeller::CommandBufferVK::Track(), impeller::CommandBufferVK::Track(), impeller::TrackedObjectsVK::Track(), unregister_texture(), unregister_texture(), flutter::EmbedderEngine::UnregisterTexture(), impeller::UpdateAtlasBitmap(), flutter::ImageDecoderImpeller::UploadTextureToStorage(), impeller::TextureGLES::WrapFBO(), impeller::WrapInput(), impeller::TextureMTL::Wrapper(), impeller::TextureGLES::WrapTexture(), impeller::WrapTextureMTL(), and impeller::WrapTextureWithRenderTarget().

◆ TRUE

return TRUE

Definition at line 30 of file mock_texture_registrar.cc.

Referenced by mark_texture_frame_available(), and unregister_texture().