Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
Loading...
Searching...
No Matches
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
"
6
#include "
impeller/core/sampler_descriptor.h
"
7
8
namespace
impeller
{
9
namespace
testing {
10
11
TEST
(SamplerDescriptorTest, ToKeyIncludesAllFields) {
12
SamplerDescriptor
a;
13
SamplerDescriptor
b;
14
EXPECT_EQ(
SamplerDescriptor::ToKey
(a),
SamplerDescriptor::ToKey
(b));
15
16
b.min_filter =
MinMagFilter::kLinear
;
17
EXPECT_NE(
SamplerDescriptor::ToKey
(a),
SamplerDescriptor::ToKey
(b));
18
b =
SamplerDescriptor
{};
19
20
b.mag_filter =
MinMagFilter::kLinear
;
21
EXPECT_NE(
SamplerDescriptor::ToKey
(a),
SamplerDescriptor::ToKey
(b));
22
b =
SamplerDescriptor
{};
23
24
b.mip_filter =
MipFilter::kLinear
;
25
EXPECT_NE(
SamplerDescriptor::ToKey
(a),
SamplerDescriptor::ToKey
(b));
26
b =
SamplerDescriptor
{};
27
28
b.width_address_mode =
SamplerAddressMode::kRepeat
;
29
EXPECT_NE(
SamplerDescriptor::ToKey
(a),
SamplerDescriptor::ToKey
(b));
30
b =
SamplerDescriptor
{};
31
32
b.height_address_mode =
SamplerAddressMode::kRepeat
;
33
EXPECT_NE(
SamplerDescriptor::ToKey
(a),
SamplerDescriptor::ToKey
(b));
34
b =
SamplerDescriptor
{};
35
36
b.depth_address_mode =
SamplerAddressMode::kRepeat
;
37
EXPECT_NE(
SamplerDescriptor::ToKey
(a),
SamplerDescriptor::ToKey
(b));
38
b =
SamplerDescriptor
{};
39
40
b.max_anisotropy = 16;
41
EXPECT_NE(
SamplerDescriptor::ToKey
(a),
SamplerDescriptor::ToKey
(b));
42
b.max_anisotropy = 1;
43
EXPECT_EQ(
SamplerDescriptor::ToKey
(a),
SamplerDescriptor::ToKey
(b));
44
}
45
46
}
// namespace testing
47
}
// namespace impeller
flutter::TEST
TEST(FrameTimingsRecorderTest, RecordVsync)
Definition
frame_timings_recorder_unittests.cc:22
impeller
Definition
texture.h:16
impeller::SamplerAddressMode::kRepeat
@ kRepeat
impeller::MipFilter::kLinear
@ kLinear
Sample from the two nearest mip levels and linearly interpolate.
impeller::MinMagFilter::kLinear
@ kLinear
sampler_descriptor.h
impeller::SamplerDescriptor
Definition
sampler_descriptor.h:14
impeller::SamplerDescriptor::ToKey
static uint64_t ToKey(const SamplerDescriptor &d)
Definition
sampler_descriptor.h:38
testing.h
impeller
core
sampler_descriptor_unittests.cc
Generated on Tue Jun 30 2026 05:58:58 for Flutter Engine Uber Docs by
1.9.8