Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Filters.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2021 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8#include <string>
9
14#include "tests/Test.h"
15
16DEF_TEST(Svg_Filters_NonePaintInputs, r) {
17 const std::string svgText = R"EOF(
18 <svg width="500" height="500" xmlns="http://www.w3.org/2000/svg"
19 xmlns:xlink="http://www.w3.org/1999/xlink">
20 <defs>
21 <filter id="f" x="0" y="0" width="1" height="1">
22 <feComposite operator="arithmetic" in="FillPaint" in2="StrokePaint"
23 k1="0" k2="10" k3="20" k4="0"/>
24 </filter>
25 </defs>
26 <rect fill="none" stroke="none" filter="url(#f)" x="10" y="10" width="100" height="1,0"/>
27 </svg>
28 )EOF";
29
30 auto str = SkMemoryStream::MakeDirect(svgText.c_str(), svgText.size());
31 auto svg_dom = SkSVGDOM::Builder().make(*str);
32 SkNoDrawCanvas canvas(500, 500);
33 svg_dom->render(&canvas);
34}
#define DEF_TEST(name, reporter)
Definition Test.h:312
static std::unique_ptr< SkMemoryStream > MakeDirect(const void *data, size_t length)
Definition SkStream.cpp:310
sk_sp< SkSVGDOM > make(SkStream &) const
Definition SkSVGDOM.cpp:405