Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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
6
11
12namespace impeller {
13
14static const std::unique_ptr<const Sampler> kNullSampler = nullptr;
15
16SamplerLibraryGLES::SamplerLibraryGLES(bool supports_decal_sampler_address_mode)
17 : supports_decal_sampler_address_mode_(
18 supports_decal_sampler_address_mode) {}
19
20// |SamplerLibrary|
22
23// |SamplerLibrary|
24const std::unique_ptr<const Sampler>& SamplerLibraryGLES::GetSampler(
25 SamplerDescriptor descriptor) {
26 if (!supports_decal_sampler_address_mode_ &&
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
const std::unique_ptr< const Sampler > & GetSampler(SamplerDescriptor descriptor) override
Retrieve a backend specific sampler object for the given sampler descriptor.
@ kDecal
decal sampling mode is only supported on devices that pass the Capabilities.SupportsDecalSamplerAddre...
static const std::unique_ptr< const Sampler > kNullSampler
SamplerAddressMode depth_address_mode
SamplerAddressMode width_address_mode
SamplerAddressMode height_address_mode
#define VALIDATION_LOG
Definition validation.h:73