| 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 kIgnore,
44
45 // Operations used for stencil-then-cover.
46
47 /// Draw the stencil for the NonZero fill path rule.
48 ///
49 /// The stencil ref should always be 0 on commands using this mode.
50 kStencilNonZeroFill,
51 /// Draw the stencil for the EvenOdd fill path rule.
52 ///
53 /// The stencil ref should always be 0 on commands using this mode.
54 kStencilEvenOddFill,
55 /// Draw a stencil which always increments once for everything in the vertex
56 /// coverage regardless of triangle overlap.
57 ///
58 /// The stencil ref should always be 0 on commands using this mode.
59 kStencilIncrementAll,
60 /// Used for draw calls which fill in the stenciled area. Intended to be
61 /// used after `kStencilNonZeroFill` or `kStencilEvenOddFill` is used to set
62 /// up the stencil buffer. Also cleans up the stencil buffer by resetting
63 /// everything to zero.
64 ///
65 /// The stencil ref should always be 0 on commands using this mode.
66 kCoverCompare,
67 /// The opposite of `kCoverCompare`. Used for draw calls which fill in the
68 /// non-stenciled area (intersection clips). Intended to be used after
69 /// `kStencilNonZeroFill` or `kStencilEvenOddFill` is used to set up the
70 /// stencil buffer. Also cleans up the stencil buffer by resetting
71 /// everything to zero.
72 ///
73 /// The stencil ref should always be 0 on commands using this mode.
74 kCoverCompareInverted,
75 };
76
77 SampleCount sample_count = SampleCount::kCount1;
78 BlendMode blend_mode = BlendMode::kSrcOver;
79 CompareFunction depth_compare = CompareFunction::kAlways;
80 StencilMode stencil_mode = ContentContextOptions::StencilMode::kIgnore;
81 PrimitiveType primitive_type = PrimitiveType::kTriangle;
82 PixelFormat color_attachment_pixel_format = PixelFormat::kUnknown;
83 bool has_depth_stencil_attachments = true;
84 bool depth_write_enabled = false;
85 bool is_for_rrect_blur_clear = false;
86
87 constexpr uint64_t ToKey() const {
88 static_assert(sizeof(sample_count) == 1);
89 static_assert(sizeof(blend_mode) == 1);
90 static_assert(sizeof(sample_count) == 1);
91 static_assert(sizeof(depth_compare) == 1);
92 static_assert(sizeof(stencil_mode) == 1);
93 static_assert(sizeof(primitive_type) == 1);
94 static_assert(sizeof(color_attachment_pixel_format) == 1);
95
96 return (is_for_rrect_blur_clear ? 1llu : 0llu) << 0 |
97 (0) << 1 | // // Unused, previously wireframe.
98 (has_depth_stencil_attachments ? 1llu : 0llu) << 2 |
99 (depth_write_enabled ? 1llu : 0llu) << 3 |
100 // enums
101 static_cast<uint64_t>(color_attachment_pixel_format) << 8 |
102 static_cast<uint64_t>(primitive_type) << 16 |
103 static_cast<uint64_t>(stencil_mode) << 24 |
104 static_cast<uint64_t>(depth_compare) << 32 |
105 static_cast<uint64_t>(blend_mode) << 40 |
106 static_cast<uint64_t>(sample_count) << 48;
107 }
108
109 void ApplyToPipelineDescriptor(PipelineDescriptor& desc) const;
110 };
111
112 enum ConicalKind {
113 kConical,
114 kRadial,
115 kStrip,
116 kStripAndRadial,
117 };
118
119 class Tessellator;
120 class RenderTargetCache;
121
122 class ContentContext {
123 public:
124 explicit ContentContext(
125 std::shared_ptr<Context> context,
126 std::shared_ptr<TypographerContext> typographer_context,
127 std::shared_ptr<RenderTargetAllocator> render_target_allocator = nullptr);
128
129 ~ContentContext();
130
131 bool IsValid() const;
132
133 Tessellator& GetTessellator() const;
134
135 // clang-format off
136 PipelineRef GetBlendColorBurnPipeline(ContentContextOptions opts) const;
137 PipelineRef GetBlendColorDodgePipeline(ContentContextOptions opts) const;
138 PipelineRef GetBlendColorPipeline(ContentContextOptions opts) const;
139 PipelineRef GetBlendDarkenPipeline(ContentContextOptions opts) const;
140 PipelineRef GetBlendDifferencePipeline(ContentContextOptions opts) const;
141 PipelineRef GetBlendExclusionPipeline(ContentContextOptions opts) const;
142 PipelineRef GetBlendHardLightPipeline(ContentContextOptions opts) const;
143 PipelineRef GetBlendHuePipeline(ContentContextOptions opts) const;
144 PipelineRef GetBlendLightenPipeline(ContentContextOptions opts) const;
145 PipelineRef GetBlendLuminosityPipeline(ContentContextOptions opts) const;
146 PipelineRef GetBlendMultiplyPipeline(ContentContextOptions opts) const;
147 PipelineRef GetBlendOverlayPipeline(ContentContextOptions opts) const;
148 PipelineRef GetBlendSaturationPipeline(ContentContextOptions opts) const;
149 PipelineRef GetBlendScreenPipeline(ContentContextOptions opts) const;
150 PipelineRef GetBlendSoftLightPipeline(ContentContextOptions opts) const;
151 PipelineRef GetBorderMaskBlurPipeline(ContentContextOptions opts) const;
152 PipelineRef GetCirclePipeline(ContentContextOptions opts) const;
153 PipelineRef GetClearBlendPipeline(ContentContextOptions opts) const;
154 PipelineRef GetClipPipeline(ContentContextOptions opts) const;
155 PipelineRef GetColorMatrixColorFilterPipeline(ContentContextOptions opts) const;
156 PipelineRef GetConicalGradientFillPipeline(ContentContextOptions opts, ConicalKind kind) const;
157 PipelineRef GetConicalGradientSSBOFillPipeline(ContentContextOptions opts, ConicalKind kind) const;
158 PipelineRef GetConicalGradientUniformFillPipeline(ContentContextOptions opts, ConicalKind kind) const;
159 PipelineRef GetDestinationATopBlendPipeline(ContentContextOptions opts) const;
160 PipelineRef GetDestinationBlendPipeline(ContentContextOptions opts) const;
161 PipelineRef GetDestinationInBlendPipeline(ContentContextOptions opts) const;
162 PipelineRef GetDestinationOutBlendPipeline(ContentContextOptions opts) const;
163 PipelineRef GetDestinationOverBlendPipeline(ContentContextOptions opts) const;
164 PipelineRef GetDownsamplePipeline(ContentContextOptions opts) const;
165 PipelineRef GetDrawShadowVerticesPipeline(ContentContextOptions opts) const;
166 PipelineRef GetDownsampleBoundedPipeline(ContentContextOptions opts) const;
167 PipelineRef GetDrawVerticesUberPipeline(BlendMode blend_mode, ContentContextOptions opts) const;
168 PipelineRef GetFastGradientPipeline(ContentContextOptions opts) const;
169 PipelineRef GetFramebufferBlendColorBurnPipeline(ContentContextOptions opts) const;
170 PipelineRef GetFramebufferBlendColorDodgePipeline(ContentContextOptions opts) const;
171 PipelineRef GetFramebufferBlendColorPipeline( ContentContextOptions opts) const;
172 PipelineRef GetFramebufferBlendDarkenPipeline(ContentContextOptions opts) const;
173 PipelineRef GetFramebufferBlendDifferencePipeline(ContentContextOptions opts) const;
174 PipelineRef GetFramebufferBlendExclusionPipeline(ContentContextOptions opts) const;
175 PipelineRef GetFramebufferBlendHardLightPipeline(ContentContextOptions opts) const;
176 PipelineRef GetFramebufferBlendHuePipeline(ContentContextOptions opts) const;
177 PipelineRef GetFramebufferBlendLightenPipeline(ContentContextOptions opts) const;
178 PipelineRef GetFramebufferBlendLuminosityPipeline(ContentContextOptions opts) const;
179 PipelineRef GetFramebufferBlendMultiplyPipeline(ContentContextOptions opts) const;
180 PipelineRef GetFramebufferBlendOverlayPipeline(ContentContextOptions opts) const;
181 PipelineRef GetFramebufferBlendSaturationPipeline(ContentContextOptions opts) const;
182 PipelineRef GetFramebufferBlendScreenPipeline(ContentContextOptions opts) const;
183 PipelineRef GetFramebufferBlendSoftLightPipeline(ContentContextOptions opts) const;
184 PipelineRef GetGaussianBlurPipeline(ContentContextOptions opts) const;
185 PipelineRef GetGlyphAtlasPipeline(ContentContextOptions opts) const;
186 PipelineRef GetLinePipeline(ContentContextOptions opts) const;
187 PipelineRef GetLinearGradientFillPipeline(ContentContextOptions opts) const;
188 PipelineRef GetLinearGradientSSBOFillPipeline(ContentContextOptions opts) const;
189 PipelineRef GetLinearGradientUniformFillPipeline(ContentContextOptions opts) const;
190 PipelineRef GetLinearToSrgbFilterPipeline(ContentContextOptions opts) const;
191 PipelineRef GetModulateBlendPipeline(ContentContextOptions opts) const;
192 PipelineRef GetMorphologyFilterPipeline(ContentContextOptions opts) const;
193 PipelineRef GetPlusBlendPipeline(ContentContextOptions opts) const;
194 PipelineRef GetPorterDuffPipeline(BlendMode mode, ContentContextOptions opts) const;
195 PipelineRef GetRadialGradientFillPipeline(ContentContextOptions opts) const;
196 PipelineRef GetRadialGradientSSBOFillPipeline(ContentContextOptions opts) const;
197 PipelineRef GetRadialGradientUniformFillPipeline(ContentContextOptions opts) const;
198 PipelineRef GetRRectBlurPipeline(ContentContextOptions opts) const;
199 PipelineRef GetRSuperellipseBlurPipeline(ContentContextOptions opts) const;
200 PipelineRef GetScreenBlendPipeline(ContentContextOptions opts) const;
201 PipelineRef GetSolidFillPipeline(ContentContextOptions opts) const;
202 PipelineRef GetSourceATopBlendPipeline(ContentContextOptions opts) const;
203 PipelineRef GetSourceBlendPipeline(ContentContextOptions opts) const;
204 PipelineRef GetSourceInBlendPipeline(ContentContextOptions opts) const;
205 PipelineRef GetSourceOutBlendPipeline(ContentContextOptions opts) const;
206 PipelineRef GetSourceOverBlendPipeline(ContentContextOptions opts) const;
207 PipelineRef GetSrgbToLinearFilterPipeline(ContentContextOptions opts) const;
208 PipelineRef GetSweepGradientFillPipeline(ContentContextOptions opts) const;
209 PipelineRef GetSweepGradientSSBOFillPipeline( ContentContextOptions opts) const;
210 PipelineRef GetSweepGradientUniformFillPipeline(ContentContextOptions opts) const;
211 PipelineRef GetTexturePipeline(ContentContextOptions opts) const;
212 PipelineRef GetTextureStrictSrcPipeline(ContentContextOptions opts) const;
213 PipelineRef GetTiledTexturePipeline(ContentContextOptions opts) const;
214 PipelineRef GetXorBlendPipeline(ContentContextOptions opts) const;
215 PipelineRef GetYUVToRGBFilterPipeline(ContentContextOptions opts) const;
216 #ifdef IMPELLER_ENABLE_OPENGLES
217 #if !defined(FML_OS_EMSCRIPTEN)
218 PipelineRef GetTiledTextureExternalPipeline(ContentContextOptions opts) const;
219 PipelineRef GetTiledTextureUvExternalPipeline(ContentContextOptions opts) const;
220 #endif
221 PipelineRef GetDownsampleTextureGlesPipeline(ContentContextOptions opts) const;
222 #endif // IMPELLER_ENABLE_OPENGLES
223 // clang-format on
224
225 // An empty 1x1 texture for binding drawVertices/drawAtlas or other cases
226 // that don't always have a texture (due to blending).
227 std::shared_ptr<Texture> GetEmptyTexture() const;
228
229 std::shared_ptr<Context> GetContext() const;
230
231 const Capabilities& GetDeviceCapabilities() const;
232
233 using SubpassCallback =
234 std::function<bool(const ContentContext&, RenderPass&)>;
235
236 /// @brief Creates a new texture of size `texture_size` and calls
237 /// `subpass_callback` with a `RenderPass` for drawing to the texture.
238 fml::StatusOr<RenderTarget> MakeSubpass(
239 std::string_view label,
240 ISize texture_size,
241 const std::shared_ptr<CommandBuffer>& command_buffer,
242 const SubpassCallback& subpass_callback,
243 bool msaa_enabled = true,
244 bool depth_stencil_enabled = false,
245 int32_t mip_count = 1) const;
246
247 /// Makes a subpass that will render to `subpass_target`.
248 fml::StatusOr<RenderTarget> MakeSubpass(
249 std::string_view label,
250 const RenderTarget& subpass_target,
251 const std::shared_ptr<CommandBuffer>& command_buffer,
252 const SubpassCallback& subpass_callback) const;
253
254 const std::shared_ptr<LazyGlyphAtlas>& GetLazyGlyphAtlas() const {
255 return lazy_glyph_atlas_;
256 }
257
258 const std::shared_ptr<RenderTargetAllocator>& GetRenderTargetCache() const {
259 return render_target_cache_;
260 }
261
262 /// RuntimeEffect pipelines must be obtained via this method to avoid
263 /// re-creating them every frame.
264 ///
265 /// The unique_entrypoint_name comes from RuntimeEffect::GetEntrypoint.
266 /// Impellerc generates a unique entrypoint name for runtime effect shaders
267 /// based on the input file name and shader stage.
268 ///
269 /// The create_callback is synchronously invoked exactly once if a cached
270 /// pipeline is not found.
271 PipelineRef GetCachedRuntimeEffectPipeline(
272 const std::string& unique_entrypoint_name,
273 const ContentContextOptions& options,
274 const std::function<std::shared_ptr<Pipeline<PipelineDescriptor>>()>&
275 create_callback) const;
276
277 /// Used by hot reload/hot restart to clear a cached pipeline from
278 /// GetCachedRuntimeEffectPipeline.
279 void ClearCachedRuntimeEffectPipeline(
280 const std::string& unique_entrypoint_name) const;
281
282 /// @brief Retrieve the current host buffer for transient storage of indexes
283 /// used for indexed draws.
284 ///
285 /// This may or may not return the same value as `GetTransientsDataBuffer`
286 /// depending on the backend.
287 ///
288 /// This is only safe to use from the raster threads. Other threads should
289 /// allocate their own device buffers.
290 HostBuffer& GetTransientsIndexesBuffer() const {
291 return *indexes_host_buffer_;
292 }
293
294 /// @brief Retrieve the current host buffer for transient storage of other
295 /// non-index data.
296 ///
297 /// This is only safe to use from the raster threads. Other threads should
298 /// allocate their own device buffers.
299 HostBuffer& GetTransientsDataBuffer() const { return *data_host_buffer_; }
300
301 /// @brief Resets the transients buffers held onto by the content context.
302 void ResetTransientsBuffers();
303
304 TextShadowCache& GetTextShadowCache() const { return *text_shadow_cache_; }
305
306 protected:
307 // Visible for testing.
308 void SetTransientsIndexesBuffer(std::shared_ptr<HostBuffer> host_buffer) {
309 indexes_host_buffer_ = std::move(host_buffer);
310 }
311
312 // Visible for testing.
313 void SetTransientsDataBuffer(std::shared_ptr<HostBuffer> host_buffer) {
314 data_host_buffer_ = std::move(host_buffer);
315 }
316
317 private:
318 std::shared_ptr<Context> context_;
319 std::shared_ptr<LazyGlyphAtlas> lazy_glyph_atlas_;
320
321 /// Run backend specific additional setup and create common shader variants.
322 ///
323 /// This bootstrap is intended to improve the performance of several
324 /// first frame benchmarks that are tracked in the flutter device lab.
325 /// The workload includes initializing commonly used but not default
326 /// shader variants, as well as forcing driver initialization.
327 void InitializeCommonlyUsedShadersIfNeeded() const;
328
329 struct RuntimeEffectPipelineKey {
330 std::string unique_entrypoint_name;
331 ContentContextOptions options;
332
333 struct Hash {
334 std::size_t operator()(const RuntimeEffectPipelineKey& key) const {
335 return fml::HashCombine(key.unique_entrypoint_name,
336 key.options.ToKey());
337 }
338 };
339
340 struct Equal {
341 inline bool operator()(const RuntimeEffectPipelineKey& lhs,
342 const RuntimeEffectPipelineKey& rhs) const {
343 return lhs.unique_entrypoint_name == rhs.unique_entrypoint_name &&
344 lhs.options.ToKey() == rhs.options.ToKey();
345 }
346 };
347 };
348
349 mutable std::unordered_map<RuntimeEffectPipelineKey,
350 std::shared_ptr<Pipeline<PipelineDescriptor>>,
351 RuntimeEffectPipelineKey::Hash,
352 RuntimeEffectPipelineKey::Equal>
353 runtime_effect_pipelines_;
354
355 struct Pipelines;
356 std::unique_ptr<Pipelines> pipelines_;
357
358 bool is_valid_ = false;
359 std::shared_ptr<Tessellator> tessellator_;
360 std::shared_ptr<RenderTargetAllocator> render_target_cache_;
361 std::shared_ptr<HostBuffer> data_host_buffer_;
362 std::shared_ptr<HostBuffer> indexes_host_buffer_;
363 std::shared_ptr<Texture> empty_texture_;
364 std::unique_ptr<TextShadowCache> text_shadow_cache_;
365
366 ContentContext(const ContentContext&) = delete;
367
368 ContentContext& operator=(const ContentContext&) = delete;
369 };
370
371 } // namespace impeller
372
373 #endif // FLUTTER_IMPELLER_ENTITY_CONTENTS_CONTENT_CONTEXT_H_
capabilities.h
impeller::Capabilities
Definition: capabilities.h:14
impeller::ContentContext
Definition: content_context.h:122
impeller::ContentContext::GetBlendLuminosityPipeline
PipelineRef GetBlendLuminosityPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1375
impeller::ContentContext::~ContentContext
~ContentContext()
impeller::ContentContext::GetTiledTexturePipeline
PipelineRef GetTiledTexturePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1151
impeller::ContentContext::GetFramebufferBlendColorPipeline
PipelineRef GetFramebufferBlendColorPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1415
impeller::ContentContext::GetDownsamplePipeline
PipelineRef GetDownsamplePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1405
impeller::ContentContext::GetSourceInBlendPipeline
PipelineRef GetSourceInBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1280
impeller::ContentContext::ClearCachedRuntimeEffectPipeline
void ClearCachedRuntimeEffectPipeline(const std::string &unique_entrypoint_name) const
Definition: content_context.cc:985
impeller::ContentContext::GetLinearGradientFillPipeline
PipelineRef GetLinearGradientFillPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1024
impeller::ContentContext::GetFramebufferBlendOverlayPipeline
PipelineRef GetFramebufferBlendOverlayPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1481
impeller::ContentContext::GetBlendColorDodgePipeline
PipelineRef GetBlendColorDodgePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1340
impeller::ContentContext::GetFramebufferBlendColorBurnPipeline
PipelineRef GetFramebufferBlendColorBurnPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1421
impeller::ContentContext::GetPorterDuffPipeline
PipelineRef GetPorterDuffPipeline(BlendMode mode, ContentContextOptions opts) const
Definition: content_context.cc:1200
impeller::ContentContext::GetEmptyTexture
std::shared_ptr< Texture > GetEmptyTexture() const
Definition: content_context.cc:880
impeller::ContentContext::GetSourceOutBlendPipeline
PipelineRef GetSourceOutBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1290
impeller::ContentContext::SetTransientsDataBuffer
void SetTransientsDataBuffer(std::shared_ptr< HostBuffer > host_buffer)
Definition: content_context.h:313
impeller::ContentContext::GetScreenBlendPipeline
PipelineRef GetScreenBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1325
impeller::ContentContext::GetBlendColorPipeline
PipelineRef GetBlendColorPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1330
impeller::ContentContext::GetLinePipeline
PipelineRef GetLinePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1525
impeller::ContentContext::GetFramebufferBlendLuminosityPipeline
PipelineRef GetFramebufferBlendLuminosityPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1469
impeller::ContentContext::GetDownsampleBoundedPipeline
PipelineRef GetDownsampleBoundedPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1410
impeller::ContentContext::GetPlusBlendPipeline
PipelineRef GetPlusBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1315
impeller::ContentContext::GetFastGradientPipeline
PipelineRef GetFastGradientPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1019
impeller::ContentContext::GetLazyGlyphAtlas
const std::shared_ptr< LazyGlyphAtlas > & GetLazyGlyphAtlas() const
Definition: content_context.h:254
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:549
impeller::ContentContext::ResetTransientsBuffers
void ResetTransientsBuffers()
Resets the transients buffers held onto by the content context.
Definition: content_context.cc:1004
impeller::ContentContext::GetSolidFillPipeline
PipelineRef GetSolidFillPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1136
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:884
impeller::ContentContext::GetDeviceCapabilities
const Capabilities & GetDeviceCapabilities() const
Definition: content_context.cc:968
impeller::ContentContext::GetModulateBlendPipeline
PipelineRef GetModulateBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1320
impeller::ContentContext::GetFramebufferBlendHardLightPipeline
PipelineRef GetFramebufferBlendHardLightPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1451
impeller::ContentContext::GetFramebufferBlendColorDodgePipeline
PipelineRef GetFramebufferBlendColorDodgePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1427
impeller::ContentContext::GetSweepGradientUniformFillPipeline
PipelineRef GetSweepGradientUniformFillPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1039
impeller::ContentContext::GetBlendSoftLightPipeline
PipelineRef GetBlendSoftLightPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1400
impeller::ContentContext::GetDestinationATopBlendPipeline
PipelineRef GetDestinationATopBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1305
impeller::ContentContext::GetTextureStrictSrcPipeline
PipelineRef GetTextureStrictSrcPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1146
impeller::ContentContext::GetDrawShadowVerticesPipeline
PipelineRef GetDrawShadowVerticesPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1505
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:972
impeller::ContentContext::GetRadialGradientSSBOFillPipeline
PipelineRef GetRadialGradientSSBOFillPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1050
impeller::ContentContext::GetBlendColorBurnPipeline
PipelineRef GetBlendColorBurnPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1335
impeller::ContentContext::GetSweepGradientSSBOFillPipeline
PipelineRef GetSweepGradientSSBOFillPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1094
impeller::ContentContext::GetLinearGradientUniformFillPipeline
PipelineRef GetLinearGradientUniformFillPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1029
impeller::ContentContext::GetFramebufferBlendScreenPipeline
PipelineRef GetFramebufferBlendScreenPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1493
impeller::ContentContext::GetLinearGradientSSBOFillPipeline
PipelineRef GetLinearGradientSSBOFillPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1044
impeller::ContentContext::GetRadialGradientFillPipeline
PipelineRef GetRadialGradientFillPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1100
impeller::ContentContext::GetTexturePipeline
PipelineRef GetTexturePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1141
impeller::ContentContext::GetBlendHardLightPipeline
PipelineRef GetBlendHardLightPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1360
impeller::ContentContext::GetClearBlendPipeline
PipelineRef GetClearBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1255
impeller::ContentContext::GetCirclePipeline
PipelineRef GetCirclePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1520
impeller::ContentContext::GetConicalGradientUniformFillPipeline
PipelineRef GetConicalGradientUniformFillPipeline(ContentContextOptions opts, ConicalKind kind) const
Definition: content_context.cc:1056
impeller::ContentContext::GetRadialGradientUniformFillPipeline
PipelineRef GetRadialGradientUniformFillPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1034
impeller::ContentContext::GetSweepGradientFillPipeline
PipelineRef GetSweepGradientFillPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1131
impeller::ContentContext::GetFramebufferBlendExclusionPipeline
PipelineRef GetFramebufferBlendExclusionPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1445
impeller::ContentContext::GetFramebufferBlendDarkenPipeline
PipelineRef GetFramebufferBlendDarkenPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1433
impeller::ContentContext::GetBlendSaturationPipeline
PipelineRef GetBlendSaturationPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1390
impeller::ContentContext::GetFramebufferBlendSoftLightPipeline
PipelineRef GetFramebufferBlendSoftLightPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1499
impeller::ContentContext::GetFramebufferBlendLightenPipeline
PipelineRef GetFramebufferBlendLightenPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1463
impeller::ContentContext::GetMorphologyFilterPipeline
PipelineRef GetMorphologyFilterPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1166
impeller::ContentContext::GetTransientsIndexesBuffer
HostBuffer & GetTransientsIndexesBuffer() const
Retrieve the current host buffer for transient storage of indexes used for indexed draws.
Definition: content_context.h:290
impeller::ContentContext::GetFramebufferBlendSaturationPipeline
PipelineRef GetFramebufferBlendSaturationPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1487
impeller::ContentContext::GetBlendDifferencePipeline
PipelineRef GetBlendDifferencePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1350
impeller::ContentContext::GetGaussianBlurPipeline
PipelineRef GetGaussianBlurPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1156
impeller::ContentContext::GetBlendHuePipeline
PipelineRef GetBlendHuePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1365
impeller::ContentContext::GetSrgbToLinearFilterPipeline
PipelineRef GetSrgbToLinearFilterPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1181
impeller::ContentContext::GetDestinationOutBlendPipeline
PipelineRef GetDestinationOutBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1295
impeller::ContentContext::GetYUVToRGBFilterPipeline
PipelineRef GetYUVToRGBFilterPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1195
impeller::ContentContext::GetFramebufferBlendDifferencePipeline
PipelineRef GetFramebufferBlendDifferencePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1439
impeller::ContentContext::GetFramebufferBlendHuePipeline
PipelineRef GetFramebufferBlendHuePipeline(ContentContextOptions opts) const
Definition: content_context.cc:1457
impeller::ContentContext::GetSourceATopBlendPipeline
PipelineRef GetSourceATopBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1300
impeller::ContentContext::GetTransientsDataBuffer
HostBuffer & GetTransientsDataBuffer() const
Retrieve the current host buffer for transient storage of other non-index data.
Definition: content_context.h:299
impeller::ContentContext::GetXorBlendPipeline
PipelineRef GetXorBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1310
impeller::ContentContext::GetGlyphAtlasPipeline
PipelineRef GetGlyphAtlasPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1190
impeller::ContentContext::GetClipPipeline
PipelineRef GetClipPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1186
impeller::ContentContext::GetRenderTargetCache
const std::shared_ptr< RenderTargetAllocator > & GetRenderTargetCache() const
Definition: content_context.h:258
impeller::ContentContext::IsValid
bool IsValid() const
Definition: content_context.cc:876
impeller::ContentContext::SetTransientsIndexesBuffer
void SetTransientsIndexesBuffer(std::shared_ptr< HostBuffer > host_buffer)
Definition: content_context.h:308
impeller::ContentContext::GetRRectBlurPipeline
PipelineRef GetRRectBlurPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1121
impeller::ContentContext::GetBlendScreenPipeline
PipelineRef GetBlendScreenPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1395
impeller::ContentContext::SubpassCallback
std::function< bool(const ContentContext &, RenderPass &)> SubpassCallback
Definition: content_context.h:234
impeller::ContentContext::GetBlendDarkenPipeline
PipelineRef GetBlendDarkenPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1345
impeller::ContentContext::GetSourceBlendPipeline
PipelineRef GetSourceBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1260
impeller::ContentContext::GetLinearToSrgbFilterPipeline
PipelineRef GetLinearToSrgbFilterPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1176
impeller::ContentContext::GetTextShadowCache
TextShadowCache & GetTextShadowCache() const
Definition: content_context.h:304
impeller::ContentContext::GetBlendOverlayPipeline
PipelineRef GetBlendOverlayPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1385
impeller::ContentContext::GetDestinationBlendPipeline
PipelineRef GetDestinationBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1265
impeller::ContentContext::GetDestinationOverBlendPipeline
PipelineRef GetDestinationOverBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1275
impeller::ContentContext::GetFramebufferBlendMultiplyPipeline
PipelineRef GetFramebufferBlendMultiplyPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1475
impeller::ContentContext::GetConicalGradientSSBOFillPipeline
PipelineRef GetConicalGradientSSBOFillPipeline(ContentContextOptions opts, ConicalKind kind) const
Definition: content_context.cc:1075
impeller::ContentContext::GetTessellator
Tessellator & GetTessellator() const
Definition: content_context.cc:960
impeller::ContentContext::GetBlendLightenPipeline
PipelineRef GetBlendLightenPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1370
impeller::ContentContext::GetBlendMultiplyPipeline
PipelineRef GetBlendMultiplyPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1380
impeller::ContentContext::GetSourceOverBlendPipeline
PipelineRef GetSourceOverBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1270
impeller::ContentContext::GetBlendExclusionPipeline
PipelineRef GetBlendExclusionPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1355
impeller::ContentContext::GetColorMatrixColorFilterPipeline
PipelineRef GetColorMatrixColorFilterPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1171
impeller::ContentContext::GetConicalGradientFillPipeline
PipelineRef GetConicalGradientFillPipeline(ContentContextOptions opts, ConicalKind kind) const
Definition: content_context.cc:1105
impeller::ContentContext::GetContext
std::shared_ptr< Context > GetContext() const
Definition: content_context.cc:964
impeller::ContentContext::GetDestinationInBlendPipeline
PipelineRef GetDestinationInBlendPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1285
impeller::ContentContext::GetRSuperellipseBlurPipeline
PipelineRef GetRSuperellipseBlurPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1126
impeller::ContentContext::GetBorderMaskBlurPipeline
PipelineRef GetBorderMaskBlurPipeline(ContentContextOptions opts) const
Definition: content_context.cc:1161
impeller::ContentContext::GetDrawVerticesUberPipeline
PipelineRef GetDrawVerticesUberPipeline(BlendMode blend_mode, ContentContextOptions opts) const
Definition: content_context.cc:1510
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:80
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:355
impeller::PrimitiveType::kTriangle
@ kTriangle
impeller::ConicalKind
ConicalKind
Definition: content_context.h:112
impeller::kStripAndRadial
@ kStripAndRadial
Definition: content_context.h:116
impeller::kStrip
@ kStrip
Definition: content_context.h:115
impeller::kConical
@ kConical
Definition: content_context.h:113
impeller::kRadial
@ kRadial
Definition: content_context.h:114
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:556
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:298
impeller::SampleCount::kCount1
@ kCount1
pipeline.h
pipeline_descriptor.h
render_target.h
impeller::ContentContext::RuntimeEffectPipelineKey::Equal
Definition: content_context.h:340
impeller::ContentContext::RuntimeEffectPipelineKey::Equal::operator()
bool operator()(const RuntimeEffectPipelineKey &lhs, const RuntimeEffectPipelineKey &rhs) const
Definition: content_context.h:341
impeller::ContentContext::RuntimeEffectPipelineKey::Hash
Definition: content_context.h:333
impeller::ContentContext::RuntimeEffectPipelineKey::Hash::operator()
std::size_t operator()(const RuntimeEffectPipelineKey &key) const
Definition: content_context.h:334
impeller::ContentContextOptions
Definition: content_context.h:40
impeller::ContentContextOptions::primitive_type
PrimitiveType primitive_type
Definition: content_context.h:81
impeller::ContentContextOptions::has_depth_stencil_attachments
bool has_depth_stencil_attachments
Definition: content_context.h:83
impeller::ContentContextOptions::stencil_mode
StencilMode stencil_mode
Definition: content_context.h:80
impeller::ContentContextOptions::depth_write_enabled
bool depth_write_enabled
Definition: content_context.h:84
impeller::ContentContextOptions::ApplyToPipelineDescriptor
void ApplyToPipelineDescriptor(PipelineDescriptor &desc) const
Definition: content_context.cc:320
impeller::ContentContextOptions::blend_mode
BlendMode blend_mode
Definition: content_context.h:78
impeller::ContentContextOptions::ToKey
constexpr uint64_t ToKey() const
Definition: content_context.h:87
impeller::ContentContextOptions::color_attachment_pixel_format
PixelFormat color_attachment_pixel_format
Definition: content_context.h:82
impeller::ContentContextOptions::StencilMode
StencilMode
Definition: content_context.h:41
impeller::ContentContextOptions::StencilMode::kStencilEvenOddFill
@ kStencilEvenOddFill
impeller::ContentContextOptions::StencilMode::kStencilIncrementAll
@ kStencilIncrementAll
impeller::ContentContextOptions::StencilMode::kCoverCompareInverted
@ kCoverCompareInverted
impeller::ContentContextOptions::StencilMode::kStencilNonZeroFill
@ kStencilNonZeroFill
impeller::ContentContextOptions::StencilMode::kIgnore
@ kIgnore
Turn the stencil test off. Used when drawing without stencil-then-cover.
impeller::ContentContextOptions::StencilMode::kCoverCompare
@ kCoverCompare
impeller::ContentContextOptions::sample_count
SampleCount sample_count
Definition: content_context.h:77
impeller::ContentContextOptions::is_for_rrect_blur_clear
bool is_for_rrect_blur_clear
Definition: content_context.h:85
impeller::ContentContextOptions::depth_compare
CompareFunction depth_compare
Definition: content_context.h:79
impeller::TSize
Definition: size.h:25
text_shadow_cache.h
typographer_context.h
validation.h