Flutter Impeller
solid_rrect_blur_contents.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 
6 #include <optional>
7 
14 
15 namespace impeller {
16 
18  const ContentContext& renderer,
19  PassContext& pass_context) const {
21 
22  FS::FragInfo frag_info;
23  frag_info.color = GetColor();
24  frag_info.center_adjust = Concat(pass_context.center, pass_context.adjust);
25  frag_info.r1_exponent_exponentInv =
26  Vector3(pass_context.r1, pass_context.exponent, pass_context.exponentInv);
27  frag_info.sInv_minEdge_scale =
28  Vector3(pass_context.sInv, pass_context.minEdge, pass_context.scale);
29 
30  auto& host_buffer = renderer.GetTransientsBuffer();
31  pass.SetCommandLabel("RRect Shadow");
32  pass.SetPipeline(renderer.GetRRectBlurPipeline(pass_context.opts));
33 
34  FS::BindFragInfo(pass, host_buffer.EmplaceUniform(frag_info));
35  return true;
36 }
37 
39 
41 
42 } // namespace impeller
HostBuffer & GetTransientsBuffer() const
Retrieve the currnent host buffer for transient storage.
PipelineRef GetRRectBlurPipeline(ContentContextOptions opts) const
Render passes encode render commands directed as one specific render target into an underlying comman...
Definition: render_pass.h:30
virtual void SetPipeline(PipelineRef pipeline)
The pipeline to use for this command.
Definition: render_pass.cc:86
virtual void SetCommandLabel(std::string_view label)
The debugging label to use for the command.
Definition: render_pass.cc:97
FragmentShader_ FragmentShader
Definition: pipeline.h:164
bool SetPassInfo(RenderPass &pass, const ContentContext &renderer, PassContext &pass_context) const override
static Vector4 Concat(Vector2 &a, Vector2 &b)
LinePipeline::FragmentShader FS