Flutter Impeller
filter_input_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 <memory>
6 #include "flutter/testing/testing.h"
7 #include "gtest/gtest.h"
11 
12 namespace impeller {
13 namespace testing {
14 
15 TEST(FilterInputTest, CanSetLocalTransformForTexture) {
16  std::shared_ptr<Texture> texture = nullptr;
17  auto input =
18  FilterInput::Make(texture, Matrix::MakeTranslation({1.0, 0.0, 0.0}));
19  Entity e;
20  e.SetTransform(Matrix::MakeTranslation({0.0, 2.0, 0.0}));
21 
22  ASSERT_MATRIX_NEAR(input->GetLocalTransform(e),
23  Matrix::MakeTranslation({1.0, 0.0, 0.0}));
24  ASSERT_MATRIX_NEAR(input->GetTransform(e),
25  Matrix::MakeTranslation({1.0, 2.0, 0.0}));
26 }
27 
28 } // namespace testing
29 } // namespace impeller
void SetTransform(const Matrix &transform)
Set the global transform matrix for this Entity.
Definition: entity.cc:60
static FilterInput::Ref Make(Variant input, bool msaa_enabled=true)
Definition: filter_input.cc:19
#define ASSERT_MATRIX_NEAR(a, b)
TEST(AllocationSizeTest, CanCreateTypedAllocations)
static constexpr Matrix MakeTranslation(const Vector3 &t)
Definition: matrix.h:95