Flutter Engine
flutter::TextureRegistry Class Reference

#include <texture.h>

Public Member Functions

 TextureRegistry ()
 
void RegisterTexture (std::shared_ptr< Texture > texture)
 
void UnregisterTexture (int64_t id)
 
std::shared_ptr< TextureGetTexture (int64_t id)
 
void OnGrContextCreated ()
 
void OnGrContextDestroyed ()
 

Detailed Description

Definition at line 50 of file texture.h.

Constructor & Destructor Documentation

◆ TextureRegistry()

flutter::TextureRegistry::TextureRegistry ( )
default

Member Function Documentation

◆ GetTexture()

std::shared_ptr< Texture > flutter::TextureRegistry::GetTexture ( int64_t  id)

Definition at line 43 of file texture.cc.

Referenced by flutter::TextureLayer::Paint(), and flutter::testing::TEST().

43  {
44  auto it = mapping_.find(id);
45  return it != mapping_.end() ? it->second : nullptr;
46 }

◆ OnGrContextCreated()

void flutter::TextureRegistry::OnGrContextCreated ( )

Definition at line 31 of file texture.cc.

Referenced by flutter::testing::TEST().

31  {
32  for (auto& it : mapping_) {
33  it.second->OnGrContextCreated();
34  }
35 }

◆ OnGrContextDestroyed()

void flutter::TextureRegistry::OnGrContextDestroyed ( )

Definition at line 37 of file texture.cc.

Referenced by flutter::testing::TEST().

37  {
38  for (auto& it : mapping_) {
39  it.second->OnGrContextDestroyed();
40  }
41 }

◆ RegisterTexture()

void flutter::TextureRegistry::RegisterTexture ( std::shared_ptr< Texture texture)

Definition at line 15 of file texture.cc.

Referenced by flutter::testing::TEST().

15  {
16  if (!texture) {
17  return;
18  }
19  mapping_[texture->Id()] = texture;
20 }

◆ UnregisterTexture()

void flutter::TextureRegistry::UnregisterTexture ( int64_t  id)

Definition at line 22 of file texture.cc.

Referenced by flutter::testing::TEST().

22  {
23  auto found = mapping_.find(id);
24  if (found == mapping_.end()) {
25  return;
26  }
27  found->second->OnTextureUnregistered();
28  mapping_.erase(found);
29 }

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