| Flutter Impeller |

compute_subgroup_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 <future>
6 #include <numeric>
7
8 #include "compute_tessellator.h"
9 #include "flutter/fml/synchronization/waitable_event.h"
10 #include "flutter/fml/time/time_point.h"
11 #include "flutter/testing/testing.h"
12 #include "gmock/gmock.h"
13 #include "impeller/base/strings.h"
14 #include "impeller/core/formats.h"
15 #include "impeller/display_list/skia_conversions.h"
16 #include "impeller/entity/contents/content_context.h"
17 #include "impeller/fixtures/golden_paths.h"
18 #include "impeller/fixtures/sample.comp.h"
19 #include "impeller/fixtures/stage1.comp.h"
20 #include "impeller/fixtures/stage2.comp.h"
21 #include "impeller/geometry/path.h"
22 #include "impeller/geometry/path_builder.h"
23 #include "impeller/geometry/path_component.h"
24 #include "impeller/playground/compute_playground_test.h"
25 #include "impeller/renderer/command_buffer.h"
26 #include "impeller/renderer/compute_command.h"
27 #include "impeller/renderer/compute_pipeline_builder.h"
28 #include "impeller/renderer/compute_tessellator.h"
29 #include "impeller/renderer/path_polyline.comp.h"
30 #include "impeller/renderer/pipeline_library.h"
31 #include "impeller/renderer/render_pass.h"
32 #include "impeller/renderer/stroke.comp.h"
33 #include "third_party/imgui/imgui.h"
34 #include "third_party/skia/include/utils/SkParsePath.h"
35
36 namespace impeller {
37 namespace testing {
38
39 using ComputeSubgroupTest = ComputePlaygroundTest;
40 INSTANTIATE_COMPUTE_SUITE(ComputeSubgroupTest);
41
42 TEST_P(ComputeSubgroupTest, CapabilitiesSuportSubgroups) {
43 auto context = GetContext();
44 ASSERT_TRUE(context);
45 ASSERT_TRUE(context->GetCapabilities()->SupportsComputeSubgroups());
46 }
47
48 TEST_P(ComputeSubgroupTest, PathPlayground) {
49 // Renders stroked SVG paths in an interactive playground.
50 using SS = StrokeComputeShader;
51
52 auto context = GetContext();
53 ASSERT_TRUE(context);
54 ASSERT_TRUE(context->GetCapabilities()->SupportsComputeSubgroups());
55 char svg_path_data[16384] =
56 "M140 20 "
57 "C73 20 20 74 20 140 "
58 "c0 135 136 170 228 303 "
59 "88-132 229-173 229-303 "
60 "0-66-54-120-120-120 "
61 "-48 0-90 28-109 69 "
62 "-19-41-60-69-108-69z";
63 size_t vertex_count = 0;
64 Scalar stroke_width = 1.0;
65
66 auto vertex_buffer = CreateHostVisibleDeviceBuffer<SS::VertexBuffer<2048>>(
67 context, "VertexBuffer");
68 auto vertex_buffer_count =
69 CreateHostVisibleDeviceBuffer<SS::VertexBufferCount>(context,
70 "VertexCount");
71
72 auto callback = [&](RenderPass& pass) -> bool {
73 ::memset(vertex_buffer_count->AsBufferView().contents, 0,
74 sizeof(SS::VertexBufferCount));
75 ::memset(vertex_buffer->AsBufferView().contents, 0,
76 sizeof(SS::VertexBuffer<2048>));
77 const auto* main_viewport = ImGui::GetMainViewport();
78 ImGui::SetNextWindowPos(
79 ImVec2(main_viewport->WorkPos.x + 650, main_viewport->WorkPos.y + 20));
80 ImGui::Begin("Path data", nullptr, ImGuiWindowFlags_AlwaysAutoResize);
81 ImGui::InputTextMultiline("Path", svg_path_data,
82 IM_ARRAYSIZE(svg_path_data));
83 ImGui::DragFloat("Stroke width", &stroke_width, .1, 0.0, 25.0);
84
85 SkPath sk_path;
86 if (SkParsePath::FromSVGString(svg_path_data, &sk_path)) {
87 std::promise<bool> promise;
88 auto future = promise.get_future();
89
90 auto path = skia_conversions::ToPath(sk_path);
91 auto status =
92 ComputeTessellator{}
93 .SetStrokeWidth(stroke_width)
94 .Tessellate(
95 path, context, vertex_buffer->AsBufferView(),
96 vertex_buffer_count->AsBufferView(),
97 [vertex_buffer_count, &vertex_count,
98 &promise](CommandBuffer::Status status) {
99 vertex_count =
100 reinterpret_cast<SS::VertexBufferCount*>(
101 vertex_buffer_count->AsBufferView().contents)
102 ->count;
103 promise.set_value(status ==
104 CommandBuffer::Status::kCompleted);
105 });
106 switch (status) {
107 case ComputeTessellator::Status::kCommandInvalid:
108 ImGui::Text("Failed to submit compute job (invalid command)");
109 break;
110 case ComputeTessellator::Status::kTooManyComponents:
111 ImGui::Text("Failed to submit compute job (too many components) ");
112 break;
113 case ComputeTessellator::Status::kOk:
114 break;
115 }
116 if (!future.get()) {
117 ImGui::Text("Failed to submit compute job.");
118 return false;
119 }
120 if (vertex_count > 0) {
121 ImGui::Text("Vertex count: %zu", vertex_count);
122 }
123 } else {
124 ImGui::Text("Failed to parse path data");
125 }
126 ImGui::End();
127
128 ContentContext renderer(context, nullptr);
129 if (!renderer.IsValid()) {
130 return false;
131 }
132
133 using VS = SolidFillPipeline::VertexShader;
134
135 Command cmd;
136 DEBUG_COMMAND_INFO(cmd, "Draw Stroke");
137 cmd.stencil_reference = 0;
138
139 ContentContextOptions options;
140 options.sample_count = pass.GetRenderTarget().GetSampleCount();
141 options.color_attachment_pixel_format =
142 pass.GetRenderTarget().GetRenderTargetPixelFormat();
143 options.has_stencil_attachment =
144 pass.GetRenderTarget().GetStencilAttachment().has_value();
145 options.blend_mode = BlendMode::kSourceIn;
146 options.primitive_type = PrimitiveType::kTriangleStrip;
147 options.stencil_compare = CompareFunction::kEqual;
148 options.stencil_operation = StencilOperation::kIncrementClamp;
149
150 cmd.pipeline = renderer.GetSolidFillPipeline(options);
151
152 auto count = reinterpret_cast<SS::VertexBufferCount*>(
153 vertex_buffer_count->AsBufferView().contents)
154 ->count;
155
156 cmd.BindVertices(
157 VertexBuffer{.vertex_buffer = vertex_buffer->AsBufferView(),
158 .vertex_count = count,
159 .index_type = IndexType::kNone});
160
161 VS::FrameInfo frame_info;
162 auto world_matrix = Matrix::MakeScale(GetContentScale());
163 frame_info.mvp = pass.GetOrthographicTransform() * world_matrix;
164 frame_info.color = Color::Red().Premultiply();
165 VS::BindFrameInfo(cmd,
166 pass.GetTransientsBuffer().EmplaceUniform(frame_info));
167
168 if (!pass.AddCommand(std::move(cmd))) {
169 return false;
170 }
171
172 return true;
173 };
174 ASSERT_TRUE(OpenPlaygroundHere(callback));
175 }
176
177 TEST_P(ComputeSubgroupTest, LargePath) {
178 // The path in here is large enough to highlight issues around exceeding
179 // subgroup size.
180 using SS = StrokeComputeShader;
181
182 auto context = GetContext();
183 ASSERT_TRUE(context);
184 ASSERT_TRUE(context->GetCapabilities()->SupportsComputeSubgroups());
185 size_t vertex_count = 0;
186 Scalar stroke_width = 1.0;
187
188 auto vertex_buffer = CreateHostVisibleDeviceBuffer<SS::VertexBuffer<2048>>(
189 context, "VertexBuffer");
190 auto vertex_buffer_count =
191 CreateHostVisibleDeviceBuffer<SS::VertexBufferCount>(context,
192 "VertexCount");
193
194 auto complex_path =
195 PathBuilder{}
196 .MoveTo({359.934, 96.6335})
197 .CubicCurveTo({358.189, 96.7055}, {356.436, 96.7908},
198 {354.673, 96.8895})
199 .CubicCurveTo({354.571, 96.8953}, {354.469, 96.9016},
200 {354.367, 96.9075})
201 .CubicCurveTo({352.672, 97.0038}, {350.969, 97.113},
202 {349.259, 97.2355})
203 .CubicCurveTo({349.048, 97.2506}, {348.836, 97.2678},
204 {348.625, 97.2834})
205 .CubicCurveTo({347.019, 97.4014}, {345.407, 97.5299},
206 {343.789, 97.6722})
207 .CubicCurveTo({343.428, 97.704}, {343.065, 97.7402},
208 {342.703, 97.7734})
209 .CubicCurveTo({341.221, 97.9086}, {339.736, 98.0505},
210 {338.246, 98.207})
211 .CubicCurveTo({337.702, 98.2642}, {337.156, 98.3292},
212 {336.612, 98.3894})
213 .CubicCurveTo({335.284, 98.5356}, {333.956, 98.6837},
214 {332.623, 98.8476})
215 .CubicCurveTo({332.495, 98.8635}, {332.366, 98.8818},
216 {332.237, 98.8982})
217 .LineTo({332.237, 102.601})
218 .LineTo({321.778, 102.601})
219 .LineTo({321.778, 100.382})
220 .CubicCurveTo({321.572, 100.413}, {321.367, 100.442},
221 {321.161, 100.476})
222 .CubicCurveTo({319.22, 100.79}, {317.277, 101.123},
223 {315.332, 101.479})
224 .CubicCurveTo({315.322, 101.481}, {315.311, 101.482},
225 {315.301, 101.484})
226 .LineTo({310.017, 105.94})
227 .LineTo({309.779, 105.427})
228 .LineTo({314.403, 101.651})
229 .CubicCurveTo({314.391, 101.653}, {314.379, 101.656},
230 {314.368, 101.658})
231 .CubicCurveTo({312.528, 102.001}, {310.687, 102.366},
232 {308.846, 102.748})
233 .CubicCurveTo({307.85, 102.955}, {306.855, 103.182}, {305.859, 103.4})
234 .CubicCurveTo({305.048, 103.579}, {304.236, 103.75},
235 {303.425, 103.936})
236 .LineTo({299.105, 107.578})
237 .LineTo({298.867, 107.065})
238 .LineTo({302.394, 104.185})
239 .LineTo({302.412, 104.171})
240 .CubicCurveTo({301.388, 104.409}, {300.366, 104.67},
241 {299.344, 104.921})
242 .CubicCurveTo({298.618, 105.1}, {297.89, 105.269}, {297.165, 105.455})
243 .CubicCurveTo({295.262, 105.94}, {293.36, 106.445},
244 {291.462, 106.979})
245 .CubicCurveTo({291.132, 107.072}, {290.802, 107.163},
246 {290.471, 107.257})
247 .CubicCurveTo({289.463, 107.544}, {288.455, 107.839},
248 {287.449, 108.139})
249 .CubicCurveTo({286.476, 108.431}, {285.506, 108.73},
250 {284.536, 109.035})
251 .CubicCurveTo({283.674, 109.304}, {282.812, 109.579},
252 {281.952, 109.859})
253 .CubicCurveTo({281.177, 110.112}, {280.406, 110.377},
254 {279.633, 110.638})
255 .CubicCurveTo({278.458, 111.037}, {277.256, 111.449},
256 {276.803, 111.607})
257 .CubicCurveTo({276.76, 111.622}, {276.716, 111.637},
258 {276.672, 111.653})
259 .CubicCurveTo({275.017, 112.239}, {273.365, 112.836},
260 {271.721, 113.463})
261 .LineTo({271.717, 113.449})
262 .CubicCurveTo({271.496, 113.496}, {271.238, 113.559},
263 {270.963, 113.628})
264 .CubicCurveTo({270.893, 113.645}, {270.822, 113.663},
265 {270.748, 113.682})
266 .CubicCurveTo({270.468, 113.755}, {270.169, 113.834},
267 {269.839, 113.926})
268 .CubicCurveTo({269.789, 113.94}, {269.732, 113.957},
269 {269.681, 113.972})
270 .CubicCurveTo({269.391, 114.053}, {269.081, 114.143},
271 {268.756, 114.239})
272 .CubicCurveTo({268.628, 114.276}, {268.5, 114.314},
273 {268.367, 114.354})
274 .CubicCurveTo({268.172, 114.412}, {267.959, 114.478},
275 {267.752, 114.54})
276 .CubicCurveTo({263.349, 115.964}, {258.058, 117.695},
277 {253.564, 119.252})
278 .CubicCurveTo({253.556, 119.255}, {253.547, 119.258},
279 {253.538, 119.261})
280 .CubicCurveTo({251.844, 119.849}, {250.056, 120.474},
281 {248.189, 121.131})
282 .CubicCurveTo({248, 121.197}, {247.812, 121.264}, {247.621, 121.331})
283 .CubicCurveTo({247.079, 121.522}, {246.531, 121.715},
284 {245.975, 121.912})
285 .CubicCurveTo({245.554, 122.06}, {245.126, 122.212},
286 {244.698, 122.364})
287 .CubicCurveTo({244.071, 122.586}, {243.437, 122.811},
288 {242.794, 123.04})
289 .CubicCurveTo({242.189, 123.255}, {241.58, 123.472},
290 {240.961, 123.693})
291 .CubicCurveTo({240.659, 123.801}, {240.357, 123.909},
292 {240.052, 124.018})
293 .CubicCurveTo({239.12, 124.351}, {238.18, 124.687}, {237.22, 125.032})
294 .LineTo({237.164, 125.003})
295 .CubicCurveTo({236.709, 125.184}, {236.262, 125.358},
296 {235.81, 125.538})
297 .CubicCurveTo({235.413, 125.68}, {234.994, 125.832},
298 {234.592, 125.977})
299 .CubicCurveTo({234.592, 125.977}, {234.591, 125.977},
300 {234.59, 125.977})
301 .CubicCurveTo({222.206, 130.435}, {207.708, 135.753},
302 {192.381, 141.429})
303 .CubicCurveTo({162.77, 151.336}, {122.17, 156.894}, {84.1123, 160})
304 .LineTo({360, 160})
305 .LineTo({360, 119.256})
306 .LineTo({360, 106.332})
307 .LineTo({360, 96.6307})
308 .CubicCurveTo({359.978, 96.6317}, {359.956, 96.6326},
309 {359.934, 96.6335})
310 .Close()
311 .TakePath();
312
313 auto callback = [&](RenderPass& pass) -> bool {
314 ::memset(vertex_buffer_count->AsBufferView().contents, 0,
315 sizeof(SS::VertexBufferCount));
316 ::memset(vertex_buffer->AsBufferView().contents, 0,
317 sizeof(SS::VertexBuffer<2048>));
318
319 ComputeTessellator{}
320 .SetStrokeWidth(stroke_width)
321 .Tessellate(
322 complex_path, context, vertex_buffer->AsBufferView(),
323 vertex_buffer_count->AsBufferView(),
324 [vertex_buffer_count, &vertex_count](CommandBuffer::Status status) {
325 vertex_count = reinterpret_cast<SS::VertexBufferCount*>(
326 vertex_buffer_count->AsBufferView().contents)
327 ->count;
328 });
329
330 ContentContext renderer(context, nullptr);
331 if (!renderer.IsValid()) {
332 return false;
333 }
334
335 using VS = SolidFillPipeline::VertexShader;
336
337 Command cmd;
338 DEBUG_COMMAND_INFO(cmd, "Draw Stroke");
339 cmd.stencil_reference = 0;
340
341 ContentContextOptions options;
342 options.sample_count = pass.GetRenderTarget().GetSampleCount();
343 options.color_attachment_pixel_format =
344 pass.GetRenderTarget().GetRenderTargetPixelFormat();
345 options.has_stencil_attachment =
346 pass.GetRenderTarget().GetStencilAttachment().has_value();
347 options.blend_mode = BlendMode::kSourceIn;
348 options.primitive_type = PrimitiveType::kTriangleStrip;
349 options.stencil_compare = CompareFunction::kEqual;
350 options.stencil_operation = StencilOperation::kIncrementClamp;
351
352 cmd.pipeline = renderer.GetSolidFillPipeline(options);
353
354 auto count = reinterpret_cast<SS::VertexBufferCount*>(
355 vertex_buffer_count->AsBufferView().contents)
356 ->count;
357
358 cmd.BindVertices(
359 VertexBuffer{.vertex_buffer = vertex_buffer->AsBufferView(),
360 .vertex_count = count,
361 .index_type = IndexType::kNone});
362
363 VS::FrameInfo frame_info;
364 auto world_matrix = Matrix::MakeScale(GetContentScale());
365 frame_info.mvp = pass.GetOrthographicTransform() * world_matrix;
366 frame_info.color = Color::Red().Premultiply();
367 VS::BindFrameInfo(cmd,
368 pass.GetTransientsBuffer().EmplaceUniform(frame_info));
369
370 if (!pass.AddCommand(std::move(cmd))) {
371 return false;
372 }
373
374 return true;
375 };
376 ASSERT_TRUE(OpenPlaygroundHere(callback));
377 }
378
379 TEST_P(ComputeSubgroupTest, QuadAndCubicInOnePath) {
380 using SS = StrokeComputeShader;
381
382 auto context = GetContext();
383 ASSERT_TRUE(context);
384 ASSERT_TRUE(context->GetCapabilities()->SupportsComputeSubgroups());
385
386 auto vertex_buffer = CreateHostVisibleDeviceBuffer<SS::VertexBuffer<2048>>(
387 context, "VertexBuffer");
388 auto vertex_buffer_count =
389 CreateHostVisibleDeviceBuffer<SS::VertexBufferCount>(context,
390 "VertexBufferCount");
391
392 auto path = PathBuilder{}
393 .AddCubicCurve({140, 20}, {73, 20}, {20, 74}, {20, 140})
394 .AddQuadraticCurve({20, 140}, {93, 90}, {100, 42})
395 .TakePath();
396
397 auto tessellator = ComputeTessellator{};
398
399 fml::AutoResetWaitableEvent latch;
400
401 auto status = tessellator.Tessellate(
402 path, context, vertex_buffer->AsBufferView(),
403 vertex_buffer_count->AsBufferView(),
404 [&latch](CommandBuffer::Status status) {
405 EXPECT_EQ(status, CommandBuffer::Status::kCompleted);
406 latch.Signal();
407 });
408
409 ASSERT_EQ(status, ComputeTessellator::Status::kOk);
410
411 auto callback = [&](RenderPass& pass) -> bool {
412 ContentContext renderer(context, nullptr);
413 if (!renderer.IsValid()) {
414 return false;
415 }
416
417 using VS = SolidFillPipeline::VertexShader;
418
419 Command cmd;
420 DEBUG_COMMAND_INFO(cmd, "Draw Stroke");
421 cmd.stencil_reference = 0;
422
423 ContentContextOptions options;
424 options.sample_count = pass.GetRenderTarget().GetSampleCount();
425 options.color_attachment_pixel_format =
426 pass.GetRenderTarget().GetRenderTargetPixelFormat();
427 options.has_stencil_attachment =
428 pass.GetRenderTarget().GetStencilAttachment().has_value();
429 options.blend_mode = BlendMode::kSourceIn;
430 options.primitive_type = PrimitiveType::kTriangleStrip;
431 options.stencil_compare = CompareFunction::kEqual;
432 options.stencil_operation = StencilOperation::kIncrementClamp;
433
434 cmd.pipeline = renderer.GetSolidFillPipeline(options);
435
436 auto count = reinterpret_cast<SS::VertexBufferCount*>(
437 vertex_buffer_count->AsBufferView().contents)
438 ->count;
439
440 cmd.BindVertices(
441 VertexBuffer{.vertex_buffer = vertex_buffer->AsBufferView(),
442 .vertex_count = count,
443 .index_type = IndexType::kNone});
444
445 VS::FrameInfo frame_info;
446 auto world_matrix = Matrix::MakeScale(GetContentScale());
447 frame_info.mvp = pass.GetOrthographicTransform() * world_matrix;
448 frame_info.color = Color::Red().Premultiply();
449 VS::BindFrameInfo(cmd,
450 pass.GetTransientsBuffer().EmplaceUniform(frame_info));
451
452 if (!pass.AddCommand(std::move(cmd))) {
453 return false;
454 }
455
456 return true;
457 };
458 ASSERT_TRUE(OpenPlaygroundHere(callback));
459
460 // The latch is down here because it's expected that on Metal the backend
461 // will take care of synchronizing the buffer between the compute and render
462 // pass usages, since it's not MTLHeap allocated. However, if playgrounds
463 // are disabled, no render pass actually gets submitted and we need to do a
464 // CPU latch here.
465 latch.Wait();
466
467 auto vertex_count = reinterpret_cast<SS::VertexBufferCount*>(
468 vertex_buffer_count->AsBufferView().contents)
469 ->count;
470 EXPECT_EQ(vertex_count, golden_cubic_and_quad_points.size());
471 auto vertex_buffer_data = reinterpret_cast<SS::VertexBuffer<2048>*>(
472 vertex_buffer->AsBufferView().contents);
473 for (size_t i = 0; i < vertex_count; i++) {
474 EXPECT_LT(std::abs(golden_cubic_and_quad_points[i].x -
475 vertex_buffer_data->position[i].x),
476 1e-3);
477 EXPECT_LT(std::abs(golden_cubic_and_quad_points[i].y -
478 vertex_buffer_data->position[i].y),
479 1e-3);
480 }
481 }
482
483 } // namespace testing
484 } // namespace impeller
golden_paths.h
impeller::ComputeTessellator::Status::kCommandInvalid
@ kCommandInvalid
path.h
impeller::Command
An object used to specify work to the GPU along with references to resources the GPU will used when d...
Definition: command.h:92
DEBUG_COMMAND_INFO
#define DEBUG_COMMAND_INFO(obj, arg)
Definition: command.h:28
impeller::Scalar
float Scalar
Definition: scalar.h:18
impeller::ComputeTessellator::Status::kTooManyComponents
@ kTooManyComponents
impeller::Color::Red
static constexpr Color Red()
Definition: color.h:264
impeller::CompareFunction::kEqual
@ kEqual
Comparison test passes if new_value == current_value.
impeller::VertexBuffer
Definition: vertex_buffer.h:13
formats.h
impeller::PathBuilder
Definition: path_builder.h:14
impeller::StencilOperation::kIncrementClamp
@ kIncrementClamp
Increment the current stencil value by 1. Clamp it to the maximum.
impeller::ContentContextOptions::blend_mode
BlendMode blend_mode
Definition: content_context.h:278
impeller::ComputePlaygroundTest
Definition: compute_playground_test.h:19
impeller::testing::golden_cubic_and_quad_points
std::vector< Point > golden_cubic_and_quad_points
Definition: golden_paths.h:16
impeller::VertexBuffer::vertex_buffer
BufferView vertex_buffer
Definition: vertex_buffer.h:14
compute_tessellator.h
impeller::ComputeTessellator
A utility that generates triangles of the specified fill type given a path.
Definition: compute_tessellator.h:20
impeller::ContentContextOptions::stencil_compare
CompareFunction stencil_compare
Definition: content_context.h:279
path_builder.h
impeller::ComputeTessellator::Status::kOk
@ kOk
impeller::PrimitiveType::kTriangleStrip
@ kTriangleStrip
impeller::ContentContextOptions::color_attachment_pixel_format
PixelFormat color_attachment_pixel_format
Definition: content_context.h:282
render_pass.h
skia_conversions.h
impeller::ComputeTessellator::SetStrokeWidth
ComputeTessellator & SetStrokeWidth(Scalar value)
Definition: compute_tessellator.cc:37
impeller::Command::BindVertices
bool BindVertices(VertexBuffer buffer)
Specify the vertex and index buffer to use for this command.
Definition: command.cc:15
impeller::ComputeTessellator::Tessellate
Status Tessellate(const Path &path, const std::shared_ptr< Context > &context, BufferView vertex_buffer, BufferView vertex_buffer_count, const CommandBuffer::CompletionCallback &callback=nullptr) const
Generates triangles from the path. If the data needs to be synchronized back to the CPU,...
Definition: compute_tessellator.cc:63
impeller::ContentContext::GetSolidFillPipeline
std::shared_ptr< Pipeline< PipelineDescriptor > > GetSolidFillPipeline(ContentContextOptions opts) const
Definition: content_context.h:405
impeller::PathBuilder::AddCubicCurve
PathBuilder & AddCubicCurve(Point p1, Point cp1, Point cp2, Point p2)
Move to point p1, then insert a cubic curve from p1 to p2 with control points cp1 and cp2.
Definition: path_builder.cc:107
impeller::IndexType::kNone
@ kNone
Does not use the index buffer.
impeller::ContentContextOptions::has_stencil_attachment
bool has_stencil_attachment
Definition: content_context.h:283
compute_pipeline_builder.h
impeller::testing::INSTANTIATE_COMPUTE_SUITE
INSTANTIATE_COMPUTE_SUITE(ComputeSubgroupTest)
strings.h
impeller::ContentContextOptions::primitive_type
PrimitiveType primitive_type
Definition: content_context.h:281
pipeline_library.h
impeller::Close
void Close(PathBuilder *builder)
Definition: tessellator.cc:36
impeller::RenderPass
Render passes encode render commands directed as one specific render target into an underlying comman...
Definition: render_pass.h:29
command_buffer.h
impeller::Command::stencil_reference
uint32_t stencil_reference
Definition: command.h:122
content_context.h
impeller::LineTo
void LineTo(PathBuilder *builder, Scalar x, Scalar y)
Definition: tessellator.cc:22
impeller::ContentContextOptions::sample_count
SampleCount sample_count
Definition: content_context.h:277
impeller::PathBuilder::MoveTo
PathBuilder & MoveTo(Point point, bool relative=false)
Definition: path_builder.cc:37
impeller::BlendMode::kSourceIn
@ kSourceIn
compute_playground_test.h
compute_command.h
impeller::CommandBuffer::Status
Status
Definition: command_buffer.h:49
impeller::Command::pipeline
std::shared_ptr< Pipeline< PipelineDescriptor > > pipeline
Definition: command.h:96
path_component.h
impeller::testing::TEST_P
TEST_P(AiksTest, CanRenderLinearGradientClamp)
Definition: aiks_gradient_unittests.cc:48
impeller::RenderPipelineT::VertexShader
VertexShader_ VertexShader
Definition: pipeline.h:92
impeller::ContentContextOptions
Definition: content_context.h:276
impeller
Definition: aiks_context.cc:10
impeller::ContentContext::IsValid
bool IsValid() const
Definition: content_context.cc:406
impeller::Matrix::MakeScale
static constexpr Matrix MakeScale(const Vector3 &s)
Definition: matrix.h:104
impeller::ContentContext
Definition: content_context.h:332
impeller::skia_conversions::ToPath
Path ToPath(const SkPath &path, Point shift)
Definition: skia_conversions.cc:49
impeller::Color::Premultiply
constexpr Color Premultiply() const
Definition: color.h:214
impeller::ContentContextOptions::stencil_operation
StencilOperation stencil_operation
Definition: content_context.h:280