Flutter Impeller
sampler_descriptor_unittests.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 "flutter/testing/testing.h"
7 
8 namespace impeller {
9 namespace testing {
10 
11 TEST(SamplerDescriptorTest, ToKeyIncludesAllFields) {
15 
16  b.min_filter = MinMagFilter::kLinear;
18  b = SamplerDescriptor{};
19 
20  b.mag_filter = MinMagFilter::kLinear;
22  b = SamplerDescriptor{};
23 
24  b.mip_filter = MipFilter::kLinear;
26  b = SamplerDescriptor{};
27 
28  b.width_address_mode = SamplerAddressMode::kRepeat;
30  b = SamplerDescriptor{};
31 
32  b.height_address_mode = SamplerAddressMode::kRepeat;
34  b = SamplerDescriptor{};
35 
36  b.depth_address_mode = SamplerAddressMode::kRepeat;
38  b = SamplerDescriptor{};
39 
40  b.max_anisotropy = 16;
42  b.max_anisotropy = 1;
44 }
45 
46 } // namespace testing
47 } // namespace impeller
TEST(AllocationSizeTest, CanCreateTypedAllocations)
@ kLinear
Sample from the two nearest mip levels and linearly interpolate.
static uint64_t ToKey(const SamplerDescriptor &d)