Flutter Impeller
uber_sdf_contents_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 "gtest/gtest.h"
6
#include "
impeller/entity/contents/uber_sdf_contents.h
"
7
#include "
impeller/entity/geometry/rect_geometry.h
"
8
#include "
impeller/geometry/rect.h
"
9
10
namespace
impeller
{
11
namespace
testing {
12
13
TEST
(UberSDFContentsTest, ApplyColorFilter) {
14
auto
rect =
Rect::MakeXYWH
(100, 100, 200, 200);
15
FillRectGeometry
geometry(rect);
16
auto
contents =
UberSDFContents::MakeRect
(
Color::Red
(), 0.0f,
Join::kMiter
,
17
false
, &geometry);
18
19
ASSERT_EQ(contents->GetColor(),
Color::Red
());
20
21
bool
result =
22
contents->ApplyColorFilter([](
Color
color) {
return
Color::Blue
(); });
23
24
ASSERT_TRUE(result);
25
ASSERT_EQ(contents->GetColor(),
Color::Blue
());
26
}
27
28
}
// namespace testing
29
}
// namespace impeller
impeller::FillRectGeometry
Definition:
rect_geometry.h:13
impeller::UberSDFContents::MakeRect
static std::unique_ptr< UberSDFContents > MakeRect(Color color, Scalar stroke_width, Join stroke_join, bool stroked, const FillRectGeometry *geometry)
Definition:
uber_sdf_contents.cc:24
impeller::testing::TEST
TEST(AllocationSizeTest, CanCreateTypedAllocations)
Definition:
allocation_size_unittests.cc:10
impeller
Definition:
allocation.cc:12
impeller::Join::kMiter
@ kMiter
rect.h
rect_geometry.h
impeller::Color
Definition:
color.h:124
impeller::Color::Red
static constexpr Color Red()
Definition:
color.h:272
impeller::Color::Blue
static constexpr Color Blue()
Definition:
color.h:276
impeller::TRect< Scalar >::MakeXYWH
constexpr static TRect MakeXYWH(Type x, Type y, Type width, Type height)
Definition:
rect.h:136
uber_sdf_contents.h
impeller
entity
contents
uber_sdf_contents_unittests.cc
Generated by
1.9.1