| Flutter Impeller |

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 SamplerLibraryGLES::SamplerLibraryGLES() = default;
15
16 // |SamplerLibrary|
17 SamplerLibraryGLES::~SamplerLibraryGLES() = default;
18
19 // |SamplerLibrary|
20 std::shared_ptr<const Sampler> SamplerLibraryGLES::GetSampler(
21 SamplerDescriptor descriptor) {
22 // TODO(bdero): Change this validation once optional support for kDecal is
23 // added to the OpenGLES backend:
24 // https://github.com/flutter/flutter/issues/129358
25 if (descriptor.width_address_mode == SamplerAddressMode::kDecal ||
26 descriptor.height_address_mode == SamplerAddressMode::kDecal ||
27 descriptor.depth_address_mode == SamplerAddressMode::kDecal) {
28 VALIDATION_LOG << "SamplerAddressMode::kDecal is not supported by the "
29 "OpenGLES backend.";
30 return nullptr;
31 }
32
33 auto found = samplers_.find(descriptor);
34 if (found != samplers_.end()) {
35 return found->second;
36 }
37 return samplers_[descriptor] =
38 std::shared_ptr<SamplerGLES>(new SamplerGLES(descriptor));
39 }
40
41 } // namespace impeller
formats.h
validation.h
sampler_gles.h
sampler_library_gles.h
VALIDATION_LOG
#define VALIDATION_LOG
Definition: validation.h:60
impeller::SamplerLibraryGLES::~SamplerLibraryGLES
~SamplerLibraryGLES() override
config.h
impeller
Definition: aiks_context.cc:10
impeller::SamplerAddressMode::kDecal
@ kDecal
decal sampling mode is only supported on devices that pass the Capabilities.SupportsDecalSamplerAddre...