Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
impeller
renderer
backend
gles
sampler_library_gles.cc
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
#include "
impeller/renderer/backend/gles/sampler_library_gles.h
"
6
7
#include "
impeller/base/config.h
"
8
#include "
impeller/base/validation.h
"
9
#include "
impeller/core/formats.h
"
10
#include "
impeller/renderer/backend/gles/sampler_gles.h
"
11
12
namespace
impeller
{
13
14
static
const
std::unique_ptr<const Sampler>
kNullSampler
=
nullptr
;
15
16
SamplerLibraryGLES::SamplerLibraryGLES(
bool
supports_decal_sampler_address_mode)
17
: supports_decal_sampler_address_mode_(
18
supports_decal_sampler_address_mode) {}
19
20
// |SamplerLibrary|
21
SamplerLibraryGLES::~SamplerLibraryGLES
() =
default
;
22
23
// |SamplerLibrary|
24
const
std::unique_ptr<const Sampler>&
SamplerLibraryGLES::GetSampler
(
25
SamplerDescriptor
descriptor) {
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
}
42
43
}
// namespace impeller
config.h
impeller::SamplerGLES
Definition
sampler_gles.h:19
impeller::SamplerLibraryGLES::GetSampler
const std::unique_ptr< const Sampler > & GetSampler(SamplerDescriptor descriptor) override
Retrieve a backend specific sampler object for the given sampler descriptor.
Definition
sampler_library_gles.cc:24
impeller::SamplerLibraryGLES::~SamplerLibraryGLES
~SamplerLibraryGLES() override
formats.h
impeller
Definition
texture.h:18
impeller::SamplerAddressMode::kDecal
@ kDecal
decal sampling mode is only supported on devices that pass the Capabilities.SupportsDecalSamplerAddre...
impeller::kNullSampler
static const std::unique_ptr< const Sampler > kNullSampler
Definition
sampler_library_gles.cc:14
sampler_gles.h
sampler_library_gles.h
impeller::SamplerDescriptor
Definition
sampler_descriptor.h:15
impeller::SamplerDescriptor::depth_address_mode
SamplerAddressMode depth_address_mode
Definition
sampler_descriptor.h:22
impeller::SamplerDescriptor::width_address_mode
SamplerAddressMode width_address_mode
Definition
sampler_descriptor.h:20
impeller::SamplerDescriptor::height_address_mode
SamplerAddressMode height_address_mode
Definition
sampler_descriptor.h:21
validation.h
VALIDATION_LOG
#define VALIDATION_LOG
Definition
validation.h:73
Generated on Fri Apr 26 2024 06:14:11 for Flutter Engine by
1.9.8