@@ -357,21 +357,10 @@ std::optional<Entity> BlendFilterContents::CreateForegroundPorterDuffBlend(
357357 BlendMode blend_mode,
358358 std::optional<Scalar> alpha,
359359 bool absorb_opacity) const {
360- auto dst_snapshot =
361- input->GetSnapshot (" ForegroundPorterDuffBlend" , renderer, entity);
362- if (!dst_snapshot.has_value ()) {
363- return std::nullopt ;
364- }
365-
366360 if (blend_mode == BlendMode::kClear ) {
367361 return std::nullopt ;
368362 }
369363
370- if (blend_mode == BlendMode::kDestination ) {
371- return Entity::FromSnapshot (dst_snapshot, entity.GetBlendMode (),
372- entity.GetStencilDepth ());
373- }
374-
375364 if (blend_mode == BlendMode::kSource ) {
376365 auto contents = std::make_shared<SolidColorContents>();
377366 contents->SetGeometry (Geometry::MakeRect (coverage));
@@ -384,6 +373,17 @@ std::optional<Entity> BlendFilterContents::CreateForegroundPorterDuffBlend(
384373 return foreground_entity;
385374 }
386375
376+ auto dst_snapshot =
377+ input->GetSnapshot (" ForegroundPorterDuffBlend" , renderer, entity);
378+ if (!dst_snapshot.has_value ()) {
379+ return std::nullopt ;
380+ }
381+
382+ if (blend_mode == BlendMode::kDestination ) {
383+ return Entity::FromSnapshot (dst_snapshot, entity.GetBlendMode (),
384+ entity.GetStencilDepth ());
385+ }
386+
387387 RenderProc render_proc = [foreground_color, coverage, dst_snapshot,
388388 blend_mode, absorb_opacity, alpha](
389389 const ContentContext& renderer,
0 commit comments