Flutter Engine
Loading...
Searching...
No Matches
canvas_test.h
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
#ifndef FLUTTER_TESTING_CANVAS_TEST_H_
6
#define FLUTTER_TESTING_CANVAS_TEST_H_
7
8
#include "
flutter/fml/macros.h
"
9
#include "gtest/gtest.h"
10
#include "third_party/skia/include/core/SkColorSpace.h"
11
12
namespace
flutter::testing
{
13
14
// This fixture allows creating tests that make use of a mock |SkCanvas|.
15
template
<
typename
BaseT>
16
class
CanvasTestBase
:
public
BaseT {
17
public
:
18
CanvasTestBase
() =
default
;
19
20
sk_sp<SkColorSpace>
mock_color_space
() {
return
color_space_; }
21
22
private
:
23
sk_sp<SkColorSpace> color_space_ = SkColorSpace::MakeSRGB();
24
25
FML_DISALLOW_COPY_AND_ASSIGN
(
CanvasTestBase
);
26
};
27
using
CanvasTest
=
CanvasTestBase<::testing::Test>
;
28
29
}
// namespace flutter::testing
30
31
#endif
// FLUTTER_TESTING_CANVAS_TEST_H_
flutter::testing::CanvasTestBase
Definition
canvas_test.h:16
flutter::testing::CanvasTestBase::mock_color_space
sk_sp< SkColorSpace > mock_color_space()
Definition
canvas_test.h:20
flutter::testing::CanvasTestBase::CanvasTestBase
CanvasTestBase()=default
macros.h
FML_DISALLOW_COPY_AND_ASSIGN
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition
macros.h:27
flutter::testing
Definition
native_assets_unittests.cc:10
testing
canvas_test.h
Generated on Thu Nov 6 2025 16:11:29 for Flutter Engine by
1.9.8