Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Friends | List of all members
impeller::SamplerLibraryGLES Class Referencefinal

#include <sampler_library_gles.h>

Inheritance diagram for impeller::SamplerLibraryGLES:
impeller::SamplerLibrary

Public Member Functions

 SamplerLibraryGLES (bool supports_decal_sampler_address_mode)
 
 ~SamplerLibraryGLES () override
 
- Public Member Functions inherited from impeller::SamplerLibrary
virtual ~SamplerLibrary ()
 

Private Member Functions

const std::unique_ptr< const Sampler > & GetSampler (SamplerDescriptor descriptor) override
 Retrieve a backend specific sampler object for the given sampler descriptor.
 

Friends

class ContextGLES
 

Additional Inherited Members

- Protected Member Functions inherited from impeller::SamplerLibrary
 SamplerLibrary ()
 

Detailed Description

Definition at line 14 of file sampler_library_gles.h.

Constructor & Destructor Documentation

◆ SamplerLibraryGLES()

impeller::SamplerLibraryGLES::SamplerLibraryGLES ( bool  supports_decal_sampler_address_mode)
explicit

Definition at line 16 of file sampler_library_gles.cc.

17 : supports_decal_sampler_address_mode_(
18 supports_decal_sampler_address_mode) {}

◆ ~SamplerLibraryGLES()

impeller::SamplerLibraryGLES::~SamplerLibraryGLES ( )
overridedefault

Member Function Documentation

◆ GetSampler()

const std::unique_ptr< const Sampler > & impeller::SamplerLibraryGLES::GetSampler ( SamplerDescriptor  descriptor)
overrideprivatevirtual

Retrieve a backend specific sampler object for the given sampler descriptor.

If the descriptor is invalid or there is a loss of rendering context, this method may return a nullptr.

The sampler library implementations must cache this sampler object and guarantee that the reference will continue to be valid throughout the lifetime of the Impeller context.

Implements impeller::SamplerLibrary.

Definition at line 24 of file sampler_library_gles.cc.

25 {
26 if (!supports_decal_sampler_address_mode_ &&
27 (descriptor.width_address_mode == SamplerAddressMode::kDecal ||
28 descriptor.height_address_mode == SamplerAddressMode::kDecal ||
29 descriptor.depth_address_mode == SamplerAddressMode::kDecal)) {
30 VALIDATION_LOG << "SamplerAddressMode::kDecal is not supported by the "
31 "current OpenGLES backend.";
32 return kNullSampler;
33 }
34
35 auto found = samplers_.find(descriptor);
36 if (found != samplers_.end()) {
37 return found->second;
38 }
39 return (samplers_[descriptor] =
40 std::unique_ptr<SamplerGLES>(new SamplerGLES(descriptor)));
41}
@ kDecal
decal sampling mode is only supported on devices that pass the Capabilities.SupportsDecalSamplerAddre...
static const std::unique_ptr< const Sampler > kNullSampler
#define VALIDATION_LOG
Definition validation.h:73

Friends And Related Symbol Documentation

◆ ContextGLES

friend class ContextGLES
friend

Definition at line 21 of file sampler_library_gles.h.


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