| Flutter Impeller |

content_context.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_IMPELLER_ENTITY_CONTENTS_CONTENT_CONTEXT_H_
6 #define FLUTTER_IMPELLER_ENTITY_CONTENTS_CONTENT_CONTEXT_H_
7
8 #include <initializer_list>
9 #include <memory>
10 #include <optional>
11 #include <unordered_map>
12 #include <utility>
13
14 #include "flutter/fml/logging.h"
15 #include "flutter/fml/status_or.h"
16 #include "impeller/base/validation.h"
17 #include "impeller/core/formats.h"
18 #include "impeller/core/host_buffer.h"
19 #include "impeller/entity/contents/text_shadow_cache.h"
20 #include "impeller/geometry/color.h"
21 #include "impeller/renderer/capabilities.h"
22 #include "impeller/renderer/command_buffer.h"
23 #include "impeller/renderer/pipeline.h"
24 #include "impeller/renderer/pipeline_descriptor.h"
25 #include "impeller/renderer/render_target.h"
26 #include "impeller/typographer/lazy_glyph_atlas.h"
27 #include "impeller/typographer/typographer_context.h"
28
29 namespace impeller {
30 /// Pipeline state configuration.
31 ///
32 /// Each unique combination of these options requires a different pipeline state
33 /// object to be built. This struct is used as a key for the per-pipeline
34 /// variant cache.
35 ///
36 /// When adding fields to this key, reliant features should take care to limit
37 /// the combinatorical explosion of variations. A sufficiently complicated
38 /// Flutter application may easily require building hundreds of PSOs in total,
39 /// but they shouldn't require e.g. 10s of thousands.
40 struct ContentContextOptions {
41 enum class StencilMode : uint8_t {
42 /// Turn the stencil test off. Used when drawing without stencil-then-cover
43 /// or overdraw prevention.
44 kIgnore,
45
46 // Operations used for stencil-then-cover.
47
48 /// Draw the stencil for the NonZero fill path rule.
49 ///
50 /// The stencil ref should always be 0 on commands using this mode.
51 kStencilNonZeroFill,
52 /// Draw the stencil for the EvenOdd fill path rule.
53 ///
54 /// The stencil ref should always be 0 on commands using this mode.
55 kStencilEvenOddFill,
56 /// Used for draw calls which fill in the stenciled area. Intended to be
57 /// used after `kStencilNonZeroFill` or `kStencilEvenOddFill` is used to set
58 /// up the stencil buffer. Also cleans up the stencil buffer by resetting
59 /// everything to zero.
60 ///
61 /// The stencil ref should always be 0 on commands using this mode.
62 kCoverCompare,
63 /// The opposite of `kCoverCompare`. Used for draw calls which fill in the
64 /// non-stenciled area (intersection clips). Intended to be used after
65 /// `kStencilNonZeroFill` or `kStencilEvenOddFill` is used to set up the
66 /// stencil buffer. Also cleans up the stencil buffer by resetting
67 /// everything to zero.
68 ///
69 /// The stencil ref should always be 0 on commands using this mode.
70 kCoverCompareInverted,
71
72 // Operations used for the "overdraw prevention" mechanism. This is used for
73 // drawing strokes.
74
75 /// For each fragment, increment the stencil value if it's currently zero.
76 /// Discard fragments when the value is non-zero. This prevents
77 /// self-overlapping strokes from drawing over themselves.
78 ///
79 /// Note that this is done for rendering correctness, not performance. If a
80 /// stroke is drawn with a backdrop-reliant blend and self-intersects, then
81 /// the intersected geometry will render incorrectly when overdrawn because
82 /// we don't adjust the geometry prevent self-intersection.
83 ///
84 /// The stencil ref should always be 0 on commands using this mode.
85 kOverdrawPreventionIncrement,
86 /// Reset the stencil to a new maximum value specified by the ref (currently
87 /// always 0).
88 ///
89 /// The stencil ref should always be 0 on commands using this mode.
90 kOverdrawPreventionRestore,
91 };
92
93 SampleCount sample_count = SampleCount::kCount1;
94 BlendMode blend_mode = BlendMode::kSrcOver;
95 CompareFunction depth_compare = CompareFunction::kAlways;
96 StencilMode stencil_mode = ContentContextOptions::StencilMode::kIgnore;
97 PrimitiveType primitive_type = PrimitiveType::kTriangle;
98 PixelFormat color_attachment_pixel_format = PixelFormat::kUnknown;
99 bool has_depth_stencil_attachments = true;
100 bool depth_write_enabled = false;
101 bool is_for_rrect_blur_clear = false;
102
103 constexpr uint64_t ToKey() const {
104 static_assert(sizeof(sample_count) == 1);
105 static_assert(sizeof(blend_mode) == 1);
106 static_assert(sizeof(sample_count) == 1);
107 static_assert(sizeof(depth_compare) == 1);
108 static_assert(sizeof(stencil_mode) == 1);
109 static_assert(sizeof(primitive_type) == 1);
110 static_assert(sizeof(color_attachment_pixel_format) == 1);
111
112 return (is_for_rrect_blur_clear ? 1llu : 0llu) << 0 |
113 (0) << 1 | // // Unused, previously wireframe.
114 (has_depth_stencil_attachments ? 1llu : 0llu) << 2 |
115 (depth_write_enabled ? 1llu : 0llu) << 3 |
116 // enums
117 static_cast<uint64_t>(color_attachment_pixel_format) << 8 |
118 static_cast<uint64_t>(primitive_type) << 16 |
119 static_cast<uint64_t>(stencil_mode) << 24 |
120 static_cast<uint64_t>(depth_compare) << 32 |
121 static_cast<uint64_t>(blend_mode) << 40 |
122 static_cast<uint64_t>(sample_count) << 48;
123 }
124
125 void ApplyToPipelineDescriptor(PipelineDescriptor& desc) const;
126 };
127
128 enum ConicalKind {
129 kConical,
130 kRadial,
131 kStrip,
132 kStripAndRadial,
133 };
134
135 class Tessellator;
136 class RenderTargetCache;
137
138 class ContentContext {
139 public:
140 explicit ContentContext(
141 std::shared_ptr<Context> context,
142 std::shared_ptr<TypographerContext> typographer_context,
143 std::shared_ptr<RenderTargetAllocator> render_target_allocator = nullptr);
144
145 ~ContentContext();
146
147 bool IsValid() const;
148
149 Tessellator& GetTessellator() const;
150
151 // clang-format off
152 PipelineRef GetBlendColorBurnPipeline(ContentContextOptions opts) const;
153 PipelineRef GetBlendColorDodgePipeline(ContentContextOptions opts) const;
154 PipelineRef GetBlendColorPipeline(ContentContextOptions opts) const;
155 PipelineRef GetBlendDarkenPipeline(ContentContextOptions opts) const;
156 PipelineRef GetBlendDifferencePipeline(ContentContextOptions opts) const;
157 PipelineRef GetBlendExclusionPipeline(ContentContextOptions opts) const;
158 PipelineRef GetBlendHardLightPipeline(ContentContextOptions opts) const;
159 PipelineRef GetBlendHuePipeline(ContentContextOptions opts) const;
160 PipelineRef GetBlendLightenPipeline(ContentContextOptions opts) const;
161 PipelineRef GetBlendLuminosityPipeline(ContentContextOptions opts) const;
162 PipelineRef GetBlendMultiplyPipeline(ContentContextOptions opts) const;
163 PipelineRef GetBlendOverlayPipeline(ContentContextOptions opts) const;
164 PipelineRef GetBlendSaturationPipeline(ContentContextOptions opts) const;
165 PipelineRef GetBlendScreenPipeline(ContentContextOptions opts) const;
166 PipelineRef GetBlendSoftLightPipeline(ContentContextOptions opts) const;
167 PipelineRef GetBorderMaskBlurPipeline(ContentContextOptions opts) const;
168 PipelineRef GetClearBlendPipeline(ContentContextOptions opts) const;
169 PipelineRef GetClipPipeline(ContentContextOptions opts) const;
170 PipelineRef GetColorMatrixColorFilterPipeline(ContentContextOptions opts) const;
171 PipelineRef GetConicalGradientFillPipeline(ContentContextOptions opts, ConicalKind kind) const;
172 PipelineRef GetConicalGradientSSBOFillPipeline(ContentContextOptions opts, ConicalKind kind) const;
173 PipelineRef GetConicalGradientUniformFillPipeline(ContentContextOptions opts, ConicalKind kind) const;
174 PipelineRef GetDestinationATopBlendPipeline(ContentContextOptions opts) const;
175 PipelineRef GetDestinationBlendPipeline(ContentContextOptions opts) const;
176 PipelineRef GetDestinationInBlendPipeline(ContentContextOptions opts) const;
177 PipelineRef GetDestinationOutBlendPipeline(ContentContextOptions opts) const;
178 PipelineRef GetDestinationOverBlendPipeline(ContentContextOptions opts) const;
179 PipelineRef GetDownsamplePipeline(ContentContextOptions opts) const;
180 PipelineRef GetDrawVerticesUberPipeline(BlendMode blend_mode, ContentContextOptions opts) const;
181 PipelineRef GetFastGradientPipeline(ContentContextOptions opts) const;
182 PipelineRef GetFramebufferBlendColorBurnPipeline(ContentContextOptions opts) const;
183 PipelineRef GetFramebufferBlendColorDodgePipeline(ContentContextOptions opts) const;
184 PipelineRef GetFramebufferBlendColorPipeline( ContentContextOptions opts) const;
185 PipelineRef GetFramebufferBlendDarkenPipeline(ContentContextOptions opts) const;
186 PipelineRef GetFramebufferBlendDifferencePipeline(ContentContextOptions opts) const;
187 PipelineRef GetFramebufferBlendExclusionPipeline(ContentContextOptions opts) const;
188 PipelineRef GetFramebufferBlendHardLightPipeline(ContentContextOptions opts) const;
189 PipelineRef GetFramebufferBlendHuePipeline(ContentContextOptions opts) const;
190 PipelineRef GetFramebufferBlendLightenPipeline(ContentContextOptions opts) const;
191 PipelineRef GetFramebufferBlendLuminosityPipeline(ContentContextOptions opts) const;
192 PipelineRef GetFramebufferBlendMultiplyPipeline(ContentContextOptions opts) const;
193 PipelineRef GetFramebufferBlendOverlayPipeline(ContentContextOptions opts) const;
194 PipelineRef GetFramebufferBlendSaturationPipeline(ContentContextOptions opts) const;
195 PipelineRef GetFramebufferBlendScreenPipeline(ContentContextOptions opts) const;
196 PipelineRef GetFramebufferBlendSoftLightPipeline(ContentContextOptions opts) const;
197 PipelineRef GetGaussianBlurPipeline(ContentContextOptions opts) const;
198 PipelineRef GetGlyphAtlasPipeline(ContentContextOptions opts) const;
199 PipelineRef GetLinePipeline(ContentContextOptions opts) const;
200 PipelineRef GetLinearGradientFillPipeline(ContentContextOptions opts) const;
201 PipelineRef GetLinearGradientSSBOFillPipeline(ContentContextOptions opts) const;
202 PipelineRef GetLinearGradientUniformFillPipeline(ContentContextOptions opts) const;
203 PipelineRef GetLinearToSrgbFilterPipeline(ContentContextOptions opts) const;
204 PipelineRef GetModulateBlendPipeline(ContentContextOptions opts) const;
205 PipelineRef GetMorphologyFilterPipeline(ContentContextOptions opts) const;
206 PipelineRef GetPlusBlendPipeline(ContentContextOptions opts) const;
207 PipelineRef GetPorterDuffPipeline(BlendMode mode, ContentContextOptions opts) const;
208 PipelineRef GetRadialGradientFillPipeline(ContentContextOptions opts) const;
209 PipelineRef GetRadialGradientSSBOFillPipeline(ContentContextOptions opts) const;
210 PipelineRef GetRadialGradientUniformFillPipeline(ContentContextOptions opts) const;
211 PipelineRef GetRRectBlurPipeline(ContentContextOptions opts) const;
212 PipelineRef GetRSuperellipseBlurPipeline(ContentContextOptions opts) const;
213 PipelineRef GetScreenBlendPipeline(ContentContextOptions opts) const;
214 PipelineRef GetSolidFillPipeline(ContentContextOptions opts) const;
215 PipelineRef GetSourceATopBlendPipeline(ContentContextOptions opts) const;
216 PipelineRef GetSourceBlendPipeline(ContentContextOptions opts) const;
217 PipelineRef GetSourceInBlendPipeline(ContentContextOptions opts) const;
218 PipelineRef GetSourceOutBlendPipeline(ContentContextOptions opts) const;
219 PipelineRef GetSourceOverBlendPipeline(ContentContextOptions opts) const;
220 PipelineRef GetSrgbToLinearFilterPipeline(ContentContextOptions opts) const;
221 PipelineRef GetSweepGradientFillPipeline(ContentContextOptions opts) const;
222 PipelineRef GetSweepGradientSSBOFillPipeline( ContentContextOptions opts) const;
223 PipelineRef GetSweepGradientUniformFillPipeline(ContentContextOptions opts) const;
224 PipelineRef GetTexturePipeline(ContentContextOptions opts) const;
225 PipelineRef GetTextureStrictSrcPipeline(ContentContextOptions opts) const;
226 PipelineRef GetTiledTexturePipeline(ContentContextOptions opts) const;
227 PipelineRef GetXorBlendPipeline(ContentContextOptions opts) const;
228 PipelineRef GetYUVToRGBFilterPipeline(ContentContextOptions opts) const;
229 #ifdef IMPELLER_ENABLE_OPENGLES
230 PipelineRef GetDownsampleTextureGlesPipeline(ContentContextOptions opts) const;
231 PipelineRef GetTiledTextureExternalPipeline(ContentContextOptions opts) const;
232 PipelineRef GetTiledTextureUvExternalPipeline(ContentContextOptions opts) const;
233 #endif // IMPELLER_ENABLE_OPENGLES
234 // clang-format on
235
236 // An empty 1x1 texture for binding drawVertices/drawAtlas or other cases
237 // that don't always have a texture (due to blending).
238 std::shared_ptr<Texture> GetEmptyTexture() const;
239
240 std::shared_ptr<Context> GetContext() const;
241
242 const Capabilities& GetDeviceCapabilities() const;
243
244 using SubpassCallback =
245 std::function<bool(const ContentContext&, RenderPass&)>;
246
247 /// @brief Creates a new texture of size `texture_size` and calls
248 /// `subpass_callback` with a `RenderPass` for drawing to the texture.
249 fml::StatusOr<RenderTarget> MakeSubpass(
250 std::string_view label,
251 ISize texture_size,
252 const std::shared_ptr<CommandBuffer>& command_buffer,
253 const SubpassCallback& subpass_callback,
254 bool msaa_enabled = true,
255 bool depth_stencil_enabled = false,
256 int32_t mip_count = 1) const;
257
258 /// Makes a subpass that will render to `subpass_target`.
259 fml::StatusOr<RenderTarget> MakeSubpass(
260 std::string_view label,
261 const RenderTarget& subpass_target,
262 const std::shared_ptr<CommandBuffer>& command_buffer,
263 const SubpassCallback& subpass_callback) const;
264
265 const std::shared_ptr<LazyGlyphAtlas>& GetLazyGlyphAtlas() const {
266 return lazy_glyph_atlas_;
267 }
268
269 const std::shared_ptr<RenderTargetAllocator>& GetRenderTargetCache() const {
270 return render_target_cache_;
271 }
272
273 /// RuntimeEffect pipelines must be obtained via this method to avoid
274 /// re-creating them every frame.
275 ///
276 /// The unique_entrypoint_name comes from RuntimeEffect::GetEntrypoint.
277 /// Impellerc generates a unique entrypoint name for runtime effect shaders
278 /// based on the input file name and shader stage.
279 ///
280 /// The create_callback is synchronously invoked exactly once if a cached
281 /// pipeline is not found.
282 PipelineRef GetCachedRuntimeEffectPipeline(
283 const std::string& unique_entrypoint_name,
284 const ContentContextOptions& options,
285 const std::function<std::shared_ptr<Pipeline<PipelineDescriptor>>()>&
286 create_callback) const;
287
288 /// Used by hot reload/hot restart to clear a cached pipeline from
289 /// GetCachedRuntimeEffectPipeline.
290 void ClearCachedRuntimeEffectPipeline(
291 const std::string& unique_entrypoint_name) const;
292
293 /// @brief Retrieve the currnent host buffer for transient storage.
294 ///
295 /// This is only safe to use from the raster threads. Other threads should
296 /// allocate their own device buffers.
297 HostBuffer& GetTransientsBuffer() const { return *host_buffer_; }
298
299 TextShadowCache& GetTextShadowCache() const { return *text_shadow_cache_; }
300
301 private:
302 std::shared_ptr<Context> context_;
303 std::shared_ptr<LazyGlyphAtlas> lazy_glyph_atlas_;
304
305 /// Run backend specific additional setup and create common shader variants.
306 ///
307 /// This bootstrap is intended to improve the performance of several
308 /// first frame benchmarks that are tracked in the flutter device lab.
309 /// The workload includes initializing commonly used but not default
310 /// shader variants, as well as forcing driver initialization.
311 void InitializeCommonlyUsedShadersIfNeeded() const;
312
313 struct RuntimeEffectPipelineKey {
314 std::string unique_entrypoint_name;
315 ContentContextOptions options;
316
317 struct Hash {
318 std::size_t operator()(const RuntimeEffectPipelineKey& key) const {
319 return fml::HashCombine(key.unique_entrypoint_name,
320 key.options.ToKey());
321 }
322 };
323
324 struct Equal {
325 inline bool operator()(const RuntimeEffectPipelineKey& lhs,
326 const RuntimeEffectPipelineKey& rhs) const {
327 return lhs.unique_entrypoint_name == rhs.unique_entrypoint_name &&
328 lhs.options.ToKey() == rhs.options.ToKey();
329 }
330 };
331 };
332
333 mutable std::unordered_map<RuntimeEffectPipelineKey,
334 std::shared_ptr<Pipeline<PipelineDescriptor>>,
335 RuntimeEffectPipelineKey::Hash,
336 RuntimeEffectPipelineKey::Equal>
337 runtime_effect_pipelines_;
338
339 struct Pipelines;
340 std::unique_ptr<Pipelines> pipelines_;
341
342 bool is_valid_ = false;
343 std::shared_ptr<Tessellator> tessellator_;
344 std::shared_ptr<RenderTargetAllocator> render_target_cache_;
345 std::shared_ptr<HostBuffer> host_buffer_;
346 std::shared_ptr<Texture> empty_texture_;
347 std::unique_ptr<TextShadowCache> text_shadow_cache_;
348
349 ContentContext(const ContentContext&) = delete;
350
351 ContentContext& operator=(const ContentContext&) = delete;
352 };
353
354 } // namespace impeller
355
356 #endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_CONTENT_CONTEXT_H_
capabilities.h
impeller::Capabilities
Definition: capabilities.h:14
impeller::ContentContext
Definition: content_context.h:138
impeller::ContentContext::GetBlendLuminosityPipeline
PipelineRef GetBlendLuminosityPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1342
impeller::ContentContext::GetTransientsBuffer
HostBuffer & GetTransientsBuffer() const
Retrieve the currnent host buffer for transient storage.
Definition: content_context.h:297
impeller::ContentContext::~ContentContext
~ContentContext()
impeller::ContentContext::GetTiledTexturePipeline
PipelineRef GetTiledTexturePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1118
impeller::ContentContext::GetFramebufferBlendColorPipeline
PipelineRef GetFramebufferBlendColorPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1377
impeller::ContentContext::GetDownsamplePipeline
PipelineRef GetDownsamplePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1372
impeller::ContentContext::GetSourceInBlendPipeline
PipelineRef GetSourceInBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1247
impeller::ContentContext::ClearCachedRuntimeEffectPipeline
void ClearCachedRuntimeEffectPipeline(const std::string &unique_entrypoint_name) const
Definition: content_context.cc:960
impeller::ContentContext::GetLinearGradientFillPipeline
PipelineRef GetLinearGradientFillPipeline(ContentContextOptions opts) const
Definition: content_context.cc:991
impeller::ContentContext::GetFramebufferBlendOverlayPipeline
PipelineRef GetFramebufferBlendOverlayPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1443
impeller::ContentContext::GetBlendColorDodgePipeline
PipelineRef GetBlendColorDodgePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1307
impeller::ContentContext::GetFramebufferBlendColorBurnPipeline
PipelineRef GetFramebufferBlendColorBurnPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1383
impeller::ContentContext::GetPorterDuffPipeline
PipelineRef GetPorterDuffPipeline(BlendMode mode, ContentContextOptions opts) const
Definition: content_context.cc:1167
impeller::ContentContext::GetEmptyTexture
std::shared_ptr< Texture > GetEmptyTexture() const
Definition: content_context.cc:863
impeller::ContentContext::GetSourceOutBlendPipeline
PipelineRef GetSourceOutBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1257
impeller::ContentContext::GetScreenBlendPipeline
PipelineRef GetScreenBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1292
impeller::ContentContext::GetBlendColorPipeline
PipelineRef GetBlendColorPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1297
impeller::ContentContext::GetLinePipeline
PipelineRef GetLinePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1477
impeller::ContentContext::GetFramebufferBlendLuminosityPipeline
PipelineRef GetFramebufferBlendLuminosityPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1431
impeller::ContentContext::GetPlusBlendPipeline
PipelineRef GetPlusBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1282
impeller::ContentContext::GetFastGradientPipeline
PipelineRef GetFastGradientPipeline(ContentContextOptions opts) const
Definition: content_context.cc:986
impeller::ContentContext::GetLazyGlyphAtlas
const std::shared_ptr< LazyGlyphAtlas > & GetLazyGlyphAtlas() const
Definition: content_context.h:265
impeller::ContentContext::ContentContext
ContentContext(std::shared_ptr< Context > context, std::shared_ptr< TypographerContext > typographer_context, std::shared_ptr< RenderTargetAllocator > render_target_allocator=nullptr)
Definition: content_context.cc:544
impeller::ContentContext::GetSolidFillPipeline
PipelineRef GetSolidFillPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1103
impeller::ContentContext::MakeSubpass
fml::StatusOr< RenderTarget > MakeSubpass(std::string_view label, ISize texture_size, const std::shared_ptr< CommandBuffer > &command_buffer, const SubpassCallback &subpass_callback, bool msaa_enabled=true, bool depth_stencil_enabled=false, int32_t mip_count=1) const
Creates a new texture of size texture_size and calls subpass_callback with a RenderPass for drawing t...
Definition: content_context.cc:867
impeller::ContentContext::GetDeviceCapabilities
const Capabilities & GetDeviceCapabilities() const
Definition: content_context.cc:943
impeller::ContentContext::GetModulateBlendPipeline
PipelineRef GetModulateBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1287
impeller::ContentContext::GetFramebufferBlendHardLightPipeline
PipelineRef GetFramebufferBlendHardLightPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1413
impeller::ContentContext::GetFramebufferBlendColorDodgePipeline
PipelineRef GetFramebufferBlendColorDodgePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1389
impeller::ContentContext::GetSweepGradientUniformFillPipeline
PipelineRef GetSweepGradientUniformFillPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1006
impeller::ContentContext::GetBlendSoftLightPipeline
PipelineRef GetBlendSoftLightPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1367
impeller::ContentContext::GetDestinationATopBlendPipeline
PipelineRef GetDestinationATopBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1272
impeller::ContentContext::GetTextureStrictSrcPipeline
PipelineRef GetTextureStrictSrcPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1113
impeller::ContentContext::GetCachedRuntimeEffectPipeline
PipelineRef GetCachedRuntimeEffectPipeline(const std::string &unique_entrypoint_name, const ContentContextOptions &options, const std::function< std::shared_ptr< Pipeline< PipelineDescriptor >>()> &create_callback) const
Definition: content_context.cc:947
impeller::ContentContext::GetRadialGradientSSBOFillPipeline
PipelineRef GetRadialGradientSSBOFillPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1017
impeller::ContentContext::GetBlendColorBurnPipeline
PipelineRef GetBlendColorBurnPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1302
impeller::ContentContext::GetSweepGradientSSBOFillPipeline
PipelineRef GetSweepGradientSSBOFillPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1061
impeller::ContentContext::GetLinearGradientUniformFillPipeline
PipelineRef GetLinearGradientUniformFillPipeline(ContentContextOptions opts) const
Definition: content_context.cc:996
impeller::ContentContext::GetFramebufferBlendScreenPipeline
PipelineRef GetFramebufferBlendScreenPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1455
impeller::ContentContext::GetLinearGradientSSBOFillPipeline
PipelineRef GetLinearGradientSSBOFillPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1011
impeller::ContentContext::GetRadialGradientFillPipeline
PipelineRef GetRadialGradientFillPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1067
impeller::ContentContext::GetTexturePipeline
PipelineRef GetTexturePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1108
impeller::ContentContext::GetBlendHardLightPipeline
PipelineRef GetBlendHardLightPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1327
impeller::ContentContext::GetClearBlendPipeline
PipelineRef GetClearBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1222
impeller::ContentContext::GetConicalGradientUniformFillPipeline
PipelineRef GetConicalGradientUniformFillPipeline(ContentContextOptions opts, ConicalKind kind) const
Definition: content_context.cc:1023
impeller::ContentContext::GetRadialGradientUniformFillPipeline
PipelineRef GetRadialGradientUniformFillPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1001
impeller::ContentContext::GetSweepGradientFillPipeline
PipelineRef GetSweepGradientFillPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1098
impeller::ContentContext::GetFramebufferBlendExclusionPipeline
PipelineRef GetFramebufferBlendExclusionPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1407
impeller::ContentContext::GetFramebufferBlendDarkenPipeline
PipelineRef GetFramebufferBlendDarkenPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1395
impeller::ContentContext::GetBlendSaturationPipeline
PipelineRef GetBlendSaturationPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1357
impeller::ContentContext::GetFramebufferBlendSoftLightPipeline
PipelineRef GetFramebufferBlendSoftLightPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1461
impeller::ContentContext::GetFramebufferBlendLightenPipeline
PipelineRef GetFramebufferBlendLightenPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1425
impeller::ContentContext::GetMorphologyFilterPipeline
PipelineRef GetMorphologyFilterPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1133
impeller::ContentContext::GetFramebufferBlendSaturationPipeline
PipelineRef GetFramebufferBlendSaturationPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1449
impeller::ContentContext::GetBlendDifferencePipeline
PipelineRef GetBlendDifferencePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1317
impeller::ContentContext::GetGaussianBlurPipeline
PipelineRef GetGaussianBlurPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1123
impeller::ContentContext::GetBlendHuePipeline
PipelineRef GetBlendHuePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1332
impeller::ContentContext::GetSrgbToLinearFilterPipeline
PipelineRef GetSrgbToLinearFilterPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1148
impeller::ContentContext::GetDestinationOutBlendPipeline
PipelineRef GetDestinationOutBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1262
impeller::ContentContext::GetYUVToRGBFilterPipeline
PipelineRef GetYUVToRGBFilterPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1162
impeller::ContentContext::GetFramebufferBlendDifferencePipeline
PipelineRef GetFramebufferBlendDifferencePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1401
impeller::ContentContext::GetFramebufferBlendHuePipeline
PipelineRef GetFramebufferBlendHuePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1419
impeller::ContentContext::GetSourceATopBlendPipeline
PipelineRef GetSourceATopBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1267
impeller::ContentContext::GetXorBlendPipeline
PipelineRef GetXorBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1277
impeller::ContentContext::GetGlyphAtlasPipeline
PipelineRef GetGlyphAtlasPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1157
impeller::ContentContext::GetClipPipeline
PipelineRef GetClipPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1153
impeller::ContentContext::GetRenderTargetCache
const std::shared_ptr< RenderTargetAllocator > & GetRenderTargetCache() const
Definition: content_context.h:269
impeller::ContentContext::IsValid
bool IsValid() const
Definition: content_context.cc:859
impeller::ContentContext::GetRRectBlurPipeline
PipelineRef GetRRectBlurPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1088
impeller::ContentContext::GetBlendScreenPipeline
PipelineRef GetBlendScreenPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1362
impeller::ContentContext::SubpassCallback
std::function< bool(const ContentContext &, RenderPass &)> SubpassCallback
Definition: content_context.h:245
impeller::ContentContext::GetBlendDarkenPipeline
PipelineRef GetBlendDarkenPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1312
impeller::ContentContext::GetSourceBlendPipeline
PipelineRef GetSourceBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1227
impeller::ContentContext::GetLinearToSrgbFilterPipeline
PipelineRef GetLinearToSrgbFilterPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1143
impeller::ContentContext::GetTextShadowCache
TextShadowCache & GetTextShadowCache() const
Definition: content_context.h:299
impeller::ContentContext::GetBlendOverlayPipeline
PipelineRef GetBlendOverlayPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1352
impeller::ContentContext::GetDestinationBlendPipeline
PipelineRef GetDestinationBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1232
impeller::ContentContext::GetDestinationOverBlendPipeline
PipelineRef GetDestinationOverBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1242
impeller::ContentContext::GetFramebufferBlendMultiplyPipeline
PipelineRef GetFramebufferBlendMultiplyPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1437
impeller::ContentContext::GetConicalGradientSSBOFillPipeline
PipelineRef GetConicalGradientSSBOFillPipeline(ContentContextOptions opts, ConicalKind kind) const
Definition: content_context.cc:1042
impeller::ContentContext::GetTessellator
Tessellator & GetTessellator() const
Definition: content_context.cc:935
impeller::ContentContext::GetBlendLightenPipeline
PipelineRef GetBlendLightenPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1337
impeller::ContentContext::GetBlendMultiplyPipeline
PipelineRef GetBlendMultiplyPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1347
impeller::ContentContext::GetSourceOverBlendPipeline
PipelineRef GetSourceOverBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1237
impeller::ContentContext::GetBlendExclusionPipeline
PipelineRef GetBlendExclusionPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1322
impeller::ContentContext::GetColorMatrixColorFilterPipeline
PipelineRef GetColorMatrixColorFilterPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1138
impeller::ContentContext::GetConicalGradientFillPipeline
PipelineRef GetConicalGradientFillPipeline(ContentContextOptions opts, ConicalKind kind) const
Definition: content_context.cc:1072
impeller::ContentContext::GetContext
std::shared_ptr< Context > GetContext() const
Definition: content_context.cc:939
impeller::ContentContext::GetDestinationInBlendPipeline
PipelineRef GetDestinationInBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1252
impeller::ContentContext::GetRSuperellipseBlurPipeline
PipelineRef GetRSuperellipseBlurPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1093
impeller::ContentContext::GetBorderMaskBlurPipeline
PipelineRef GetBorderMaskBlurPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1128
impeller::ContentContext::GetDrawVerticesUberPipeline
PipelineRef GetDrawVerticesUberPipeline(BlendMode blend_mode, ContentContextOptions opts) const
Definition: content_context.cc:1467
impeller::HostBuffer
Definition: host_buffer.h:26
impeller::PipelineDescriptor
Definition: pipeline_descriptor.h:24
impeller::Pipeline< PipelineDescriptor >
impeller::RenderPass
Render passes encode render commands directed as one specific render target into an underlying comman...
Definition: render_pass.h:30
impeller::RenderTarget
Definition: render_target.h:38
impeller::Tessellator
A utility that generates triangles of the specified fill type given a polyline. This happens on the C...
Definition: tessellator.h:37
impeller::TextShadowCache
A cache for blurred text that re-uses these across frames.
Definition: text_shadow_cache.h:31
impeller::raw_ptr< Pipeline< PipelineDescriptor > >
color.h
command_buffer.h
pipelines_
std::vector< std::pair< uint64_t, std::unique_ptr< GenericRenderPipelineHandle > > > pipelines_
Definition: content_context.cc:78
formats.h
host_buffer.h
lazy_glyph_atlas.h
impeller
Definition: allocation.cc:12
impeller::PrimitiveType
PrimitiveType
Decides how backend draws pixels based on input vertices.
Definition: formats.h:352
impeller::PrimitiveType::kTriangle
@ kTriangle
impeller::ConicalKind
ConicalKind
Definition: content_context.h:128
impeller::kStripAndRadial
@ kStripAndRadial
Definition: content_context.h:132
impeller::kStrip
@ kStrip
Definition: content_context.h:131
impeller::kConical
@ kConical
Definition: content_context.h:129
impeller::kRadial
@ kRadial
Definition: content_context.h:130
impeller::PixelFormat
PixelFormat
The Pixel formats supported by Impeller. The naming convention denotes the usage of the component,...
Definition: formats.h:99
impeller::PixelFormat::kUnknown
@ kUnknown
impeller::CompareFunction
CompareFunction
Definition: formats.h:552
impeller::CompareFunction::kAlways
@ kAlways
Comparison test passes always passes.
impeller::BlendMode
BlendMode
Definition: color.h:58
impeller::BlendMode::kSrcOver
@ kSrcOver
impeller::SampleCount
SampleCount
Definition: formats.h:295
impeller::SampleCount::kCount1
@ kCount1
pipeline.h
pipeline_descriptor.h
render_target.h
impeller::ContentContext::RuntimeEffectPipelineKey::Equal
Definition: content_context.h:324
impeller::ContentContext::RuntimeEffectPipelineKey::Equal::operator()
bool operator()(const RuntimeEffectPipelineKey &lhs, const RuntimeEffectPipelineKey &rhs) const
Definition: content_context.h:325
impeller::ContentContext::RuntimeEffectPipelineKey::Hash
Definition: content_context.h:317
impeller::ContentContext::RuntimeEffectPipelineKey::Hash::operator()
std::size_t operator()(const RuntimeEffectPipelineKey &key) const
Definition: content_context.h:318
impeller::ContentContextOptions
Definition: content_context.h:40
impeller::ContentContextOptions::primitive_type
PrimitiveType primitive_type
Definition: content_context.h:97
impeller::ContentContextOptions::has_depth_stencil_attachments
bool has_depth_stencil_attachments
Definition: content_context.h:99
impeller::ContentContextOptions::stencil_mode
StencilMode stencil_mode
Definition: content_context.h:96
impeller::ContentContextOptions::depth_write_enabled
bool depth_write_enabled
Definition: content_context.h:100
impeller::ContentContextOptions::ApplyToPipelineDescriptor
void ApplyToPipelineDescriptor(PipelineDescriptor &desc) const
Definition: content_context.cc:310
impeller::ContentContextOptions::blend_mode
BlendMode blend_mode
Definition: content_context.h:94
impeller::ContentContextOptions::ToKey
constexpr uint64_t ToKey() const
Definition: content_context.h:103
impeller::ContentContextOptions::color_attachment_pixel_format
PixelFormat color_attachment_pixel_format
Definition: content_context.h:98
impeller::ContentContextOptions::StencilMode
StencilMode
Definition: content_context.h:41
impeller::ContentContextOptions::StencilMode::kOverdrawPreventionRestore
@ kOverdrawPreventionRestore
impeller::ContentContextOptions::StencilMode::kStencilEvenOddFill
@ kStencilEvenOddFill
impeller::ContentContextOptions::StencilMode::kOverdrawPreventionIncrement
@ kOverdrawPreventionIncrement
impeller::ContentContextOptions::StencilMode::kCoverCompareInverted
@ kCoverCompareInverted
impeller::ContentContextOptions::StencilMode::kStencilNonZeroFill
@ kStencilNonZeroFill
impeller::ContentContextOptions::StencilMode::kIgnore
@ kIgnore
impeller::ContentContextOptions::StencilMode::kCoverCompare
@ kCoverCompare
impeller::ContentContextOptions::sample_count
SampleCount sample_count
Definition: content_context.h:93
impeller::ContentContextOptions::is_for_rrect_blur_clear
bool is_for_rrect_blur_clear
Definition: content_context.h:101
impeller::ContentContextOptions::depth_compare
CompareFunction depth_compare
Definition: content_context.h:95
impeller::TSize
Definition: size.h:25
text_shadow_cache.h
typographer_context.h
validation.h