@@ -2,7 +2,7 @@ pub use iced_native::text::Hit;
22
33use iced_graphics:: layer:: Text ;
44use iced_native:: alignment;
5- use iced_native:: { Color , Font , Rectangle , Size } ;
5+ use iced_native:: { Font , Rectangle , Size } ;
66
77use rustc_hash:: { FxHashMap , FxHashSet } ;
88use std:: borrow:: Cow ;
@@ -110,7 +110,6 @@ impl Pipeline {
110110 height : ( section. bounds . height * scale_factor)
111111 . ceil ( ) ,
112112 } ,
113- color : section. color ,
114113 } ,
115114 ) ;
116115
@@ -162,6 +161,16 @@ impl Pipeline {
162161 left : left as i32 ,
163162 top : top as i32 ,
164163 bounds,
164+ default_color : {
165+ let [ r, g, b, a] = section. color . into_linear ( ) ;
166+
167+ glyphon:: Color :: rgba (
168+ ( r * 255.0 ) as u8 ,
169+ ( g * 255.0 ) as u8 ,
170+ ( b * 255.0 ) as u8 ,
171+ ( a * 255.0 ) as u8 ,
172+ )
173+ } ,
165174 }
166175 } ) ;
167176
@@ -174,7 +183,6 @@ impl Pipeline {
174183 height : target_size. height ,
175184 } ,
176185 text_areas,
177- glyphon:: Color :: rgb ( 0 , 0 , 0 ) ,
178186 & mut glyphon:: SwashCache :: new ( fields. fonts ) ,
179187 ) ;
180188
@@ -249,7 +257,6 @@ impl Pipeline {
249257 size,
250258 font,
251259 bounds,
252- color : Color :: BLACK ,
253260 } ,
254261 ) ;
255262
@@ -283,7 +290,6 @@ impl Pipeline {
283290 size,
284291 font,
285292 bounds,
286- color : Color :: BLACK ,
287293 } ,
288294 ) ;
289295
@@ -354,7 +360,6 @@ impl<'a> Cache<'a> {
354360 key. font . hash ( & mut hasher) ;
355361 key. bounds . width . to_bits ( ) . hash ( & mut hasher) ;
356362 key. bounds . height . to_bits ( ) . hash ( & mut hasher) ;
357- key. color . into_rgba8 ( ) . hash ( & mut hasher) ;
358363
359364 hasher. finish ( )
360365 } ;
@@ -371,16 +376,6 @@ impl<'a> Cache<'a> {
371376 key. content ,
372377 glyphon:: Attrs :: new ( )
373378 . family ( to_family ( key. font ) )
374- . color ( {
375- let [ r, g, b, a] = key. color . into_linear ( ) ;
376-
377- glyphon:: Color :: rgba (
378- ( r * 255.0 ) as u8 ,
379- ( g * 255.0 ) as u8 ,
380- ( b * 255.0 ) as u8 ,
381- ( a * 255.0 ) as u8 ,
382- )
383- } )
384379 . monospaced ( matches ! ( key. font, Font :: Monospace ) ) ,
385380 ) ;
386381
@@ -412,7 +407,6 @@ struct Key<'a> {
412407 size : f32 ,
413408 font : Font ,
414409 bounds : Size ,
415- color : Color ,
416410}
417411
418412type KeyHash = u64 ;
0 commit comments