| Flutter Impeller |

aiks_dl_path_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/impeller/aiks/aiks_unittests.h"
6
7 #include "flutter/display_list/dl_blend_mode.h"
8 #include "flutter/display_list/dl_builder.h"
9 #include "flutter/display_list/dl_color.h"
10 #include "flutter/display_list/dl_paint.h"
11 #include "flutter/display_list/effects/dl_color_filter.h"
12 #include "flutter/testing/testing.h"
13
14 namespace impeller {
15 namespace testing {
16
17 using namespace flutter;
18
19 TEST_P(AiksTest, RotateColorFilteredPath) {
20 DisplayListBuilder builder;
21 builder.Transform(SkMatrix::Translate(300, 300) * SkMatrix::RotateDeg(90));
22
23 SkPath arrow_stem;
24 SkPath arrow_head;
25
26 arrow_stem.moveTo({120, 190}).lineTo({120, 50});
27 arrow_head.moveTo({50, 120}).lineTo({120, 190}).lineTo({190, 120});
28
29 auto filter =
30 DlBlendColorFilter::Make(DlColor::kAliceBlue(), DlBlendMode::kSrcIn);
31
32 DlPaint paint;
33 paint.setStrokeWidth(15.0);
34 paint.setStrokeCap(DlStrokeCap::kRound);
35 paint.setStrokeJoin(DlStrokeJoin::kRound);
36 paint.setDrawStyle(DlDrawStyle::kStroke);
37 paint.setColorFilter(filter);
38 paint.setColor(DlColor::kBlack());
39
40 builder.DrawPath(arrow_stem, paint);
41 builder.DrawPath(arrow_head, paint);
42
43 ASSERT_TRUE(OpenPlaygroundHere(builder.Build()));
44 }
45 } // namespace testing
46 } // namespace impeller
impeller::AiksPlayground
Definition: aiks_playground.h:17
aiks_unittests.h
impeller::testing::TEST_P
TEST_P(AiksTest, CanRenderAdvancedBlendColorFilterWithSaveLayer)
Definition: aiks_blend_unittests.cc:21
flutter
Definition: dl_golden_blur_unittests.cc:14
paint
const Paint & paint
Definition: color_source.cc:38
impeller
Definition: aiks_blend_unittests.cc:18