@@ -36,15 +36,14 @@ void ColorSourceTextContents::SetTextPosition(Point position) {
3636bool ColorSourceTextContents::Render (const ContentContext& renderer,
3737 const Entity& entity,
3838 RenderPass& pass) const {
39- auto coverage = text_contents_->GetCoverage (entity );
40- if (!coverage .has_value ()) {
39+ auto text_bounds = text_contents_->GetTextFrameBounds ( );
40+ if (!text_bounds .has_value ()) {
4141 return true ;
4242 }
43- auto transform = entity.GetTransformation ();
4443
4544 text_contents_->SetColor (Color::Black ());
4645 color_source_contents_->SetGeometry (
47- Geometry::MakeRect (Rect::MakeSize (coverage ->size )));
46+ Geometry::MakeRect (Rect::MakeSize (text_bounds ->size )));
4847
4948 // offset the color source so it behaves as if it were drawn in the original
5049 // position.
@@ -53,10 +52,9 @@ bool ColorSourceTextContents::Render(const ContentContext& renderer,
5352 color_source_contents_->SetEffectTransform (effect_transform);
5453
5554 auto new_texture = renderer.MakeSubpass (
56- " Text Color Blending" , ISize::Ceil (coverage .value ().size ),
55+ " Text Color Blending" , ISize::Ceil (text_bounds .value ().size ),
5756 [&](const ContentContext& context, RenderPass& pass) {
5857 Entity sub_entity;
59- sub_entity.SetTransformation (transform);
6058 sub_entity.SetContents (text_contents_);
6159 sub_entity.SetBlendMode (BlendMode::kSource );
6260 if (!sub_entity.Render (context, pass)) {
@@ -71,9 +69,7 @@ bool ColorSourceTextContents::Render(const ContentContext& renderer,
7169 return false ;
7270 }
7371
74- auto dest_rect = Rect::MakeSize (new_texture->GetSize ())
75- .TransformBounds (transform.Invert ())
76- .Shift (position_);
72+ auto dest_rect = Rect::MakeSize (new_texture->GetSize ()).Shift (position_);
7773
7874 auto texture_contents = TextureContents::MakeRect (dest_rect);
7975 texture_contents->SetTexture (new_texture);
0 commit comments