@@ -10,7 +10,7 @@ use api::{GlyphInstance, GlyphOptions, GradientStop, HitTestFlags, HitTestItem,
10
10
use api:: { ImageKey , ImageRendering , ItemRange , ItemTag , LayerPoint , LayerPrimitiveInfo , LayerRect } ;
11
11
use api:: { LayerSize , LayerToScrollTransform , LayerVector2D , LayoutVector2D , LineOrientation } ;
12
12
use api:: { LineStyle , LocalClip , POINT_RELATIVE_TO_PIPELINE_VIEWPORT , PipelineId , RepeatMode } ;
13
- use api:: { ScrollSensitivity , SubpixelDirection , TextShadow , TileOffset , TransformStyle } ;
13
+ use api:: { ScrollSensitivity , SubpixelDirection , Shadow , TileOffset , TransformStyle } ;
14
14
use api:: { WorldPixel , WorldPoint , YuvColorSpace , YuvData , device_length} ;
15
15
use app_units:: Au ;
16
16
use border:: ImageBorderSegment ;
@@ -26,7 +26,7 @@ use prim_store::{BoxShadowPrimitiveCpu, TexelRect, YuvImagePrimitiveCpu};
26
26
use prim_store:: { GradientPrimitiveCpu , ImagePrimitiveCpu , LinePrimitive , PrimitiveKind } ;
27
27
use prim_store:: { PrimitiveContainer , PrimitiveIndex } ;
28
28
use prim_store:: { PrimitiveStore , RadialGradientPrimitiveCpu } ;
29
- use prim_store:: { RectanglePrimitive , TextRunPrimitiveCpu , TextShadowPrimitiveCpu } ;
29
+ use prim_store:: { RectanglePrimitive , TextRunPrimitiveCpu , ShadowPrimitiveCpu } ;
30
30
use profiler:: { FrameProfileCounters , GpuCacheProfileCounters , TextureCacheProfileCounters } ;
31
31
use render_task:: { AlphaRenderItem , ClipWorkItem , RenderTask } ;
32
32
use render_task:: { RenderTaskId , RenderTaskLocation , RenderTaskTree } ;
@@ -100,7 +100,7 @@ pub struct FrameBuilder {
100
100
clip_scroll_group_indices : FastHashMap < ClipAndScrollInfo , usize > ,
101
101
packed_layers : Vec < PackedLayer > ,
102
102
103
- // A stack of the current text- shadow primitives.
103
+ // A stack of the current shadow primitives.
104
104
shadow_prim_stack : Vec < PrimitiveIndex > ,
105
105
106
106
scrollbar_prims : Vec < ScrollbarPrimitive > ,
@@ -578,33 +578,33 @@ impl FrameBuilder {
578
578
self . reference_frame_stack . pop ( ) ;
579
579
}
580
580
581
- pub fn push_text_shadow (
581
+ pub fn push_shadow (
582
582
& mut self ,
583
- shadow : TextShadow ,
583
+ shadow : Shadow ,
584
584
clip_and_scroll : ClipAndScrollInfo ,
585
585
info : & LayerPrimitiveInfo ,
586
586
) {
587
- let prim = TextShadowPrimitiveCpu {
587
+ let prim = ShadowPrimitiveCpu {
588
588
shadow,
589
589
primitives : Vec :: new ( ) ,
590
590
render_task_id : None ,
591
591
} ;
592
592
593
- // Create an empty text- shadow primitive. Insert it into
593
+ // Create an empty shadow primitive. Insert it into
594
594
// the draw lists immediately so that it will be drawn
595
595
// before any visual text elements that are added as
596
- // part of this text- shadow context.
596
+ // part of this shadow context.
597
597
let prim_index = self . add_primitive (
598
598
clip_and_scroll,
599
599
info,
600
600
Vec :: new ( ) ,
601
- PrimitiveContainer :: TextShadow ( prim) ,
601
+ PrimitiveContainer :: Shadow ( prim) ,
602
602
) ;
603
603
604
604
self . shadow_prim_stack . push ( prim_index) ;
605
605
}
606
606
607
- pub fn pop_text_shadow ( & mut self ) {
607
+ pub fn pop_shadow ( & mut self ) {
608
608
let prim_index = self . shadow_prim_stack
609
609
. pop ( )
610
610
. expect ( "invalid shadow push/pop count" ) ;
@@ -614,7 +614,7 @@ impl FrameBuilder {
614
614
// safe to offset the local rect by the offset of the shadow, which
615
615
// is then used when blitting the shadow to the final location.
616
616
let metadata = & mut self . prim_store . cpu_metadata [ prim_index. 0 ] ;
617
- let prim = & self . prim_store . cpu_text_shadows [ metadata. cpu_prim_index . 0 ] ;
617
+ let prim = & self . prim_store . cpu_shadows [ metadata. cpu_prim_index . 0 ] ;
618
618
619
619
metadata. local_rect = metadata. local_rect . translate ( & prim. shadow . offset ) ;
620
620
}
@@ -683,15 +683,15 @@ impl FrameBuilder {
683
683
orientation : orientation,
684
684
} ;
685
685
686
- let mut fast_text_shadow_prims = Vec :: new ( ) ;
686
+ let mut fast_shadow_prims = Vec :: new ( ) ;
687
687
for shadow_prim_index in & self . shadow_prim_stack {
688
688
let shadow_metadata = & self . prim_store . cpu_metadata [ shadow_prim_index. 0 ] ;
689
- let shadow_prim = & self . prim_store . cpu_text_shadows [ shadow_metadata. cpu_prim_index . 0 ] ;
689
+ let shadow_prim = & self . prim_store . cpu_shadows [ shadow_metadata. cpu_prim_index . 0 ] ;
690
690
if shadow_prim. shadow . blur_radius == 0.0 {
691
- fast_text_shadow_prims . push ( shadow_prim. shadow ) ;
691
+ fast_shadow_prims . push ( shadow_prim. shadow ) ;
692
692
}
693
693
}
694
- for shadow in fast_text_shadow_prims {
694
+ for shadow in fast_shadow_prims {
695
695
let mut line = line. clone ( ) ;
696
696
line. color = shadow. color ;
697
697
let mut info = info. clone ( ) ;
@@ -720,9 +720,9 @@ impl FrameBuilder {
720
720
721
721
for shadow_prim_index in & self . shadow_prim_stack {
722
722
let shadow_metadata = & mut self . prim_store . cpu_metadata [ shadow_prim_index. 0 ] ;
723
- debug_assert_eq ! ( shadow_metadata. prim_kind, PrimitiveKind :: TextShadow ) ;
723
+ debug_assert_eq ! ( shadow_metadata. prim_kind, PrimitiveKind :: Shadow ) ;
724
724
let shadow_prim =
725
- & mut self . prim_store . cpu_text_shadows [ shadow_metadata. cpu_prim_index . 0 ] ;
725
+ & mut self . prim_store . cpu_shadows [ shadow_metadata. cpu_prim_index . 0 ] ;
726
726
727
727
// Only run real blurs here (fast path zero blurs are handled above).
728
728
if shadow_prim. shadow . blur_radius > 0.0 {
@@ -1208,10 +1208,10 @@ impl FrameBuilder {
1208
1208
// *before* the visual text primitive in order to get the correct paint
1209
1209
// order. Store them in a Vec first to work around borrowck issues.
1210
1210
// TODO(gw): Refactor to avoid having to store them in a Vec first.
1211
- let mut fast_text_shadow_prims = Vec :: new ( ) ;
1211
+ let mut fast_shadow_prims = Vec :: new ( ) ;
1212
1212
for shadow_prim_index in & self . shadow_prim_stack {
1213
1213
let shadow_metadata = & self . prim_store . cpu_metadata [ shadow_prim_index. 0 ] ;
1214
- let shadow_prim = & self . prim_store . cpu_text_shadows [ shadow_metadata. cpu_prim_index . 0 ] ;
1214
+ let shadow_prim = & self . prim_store . cpu_shadows [ shadow_metadata. cpu_prim_index . 0 ] ;
1215
1215
if shadow_prim. shadow . blur_radius == 0.0 {
1216
1216
let mut text_prim = prim. clone ( ) ;
1217
1217
if font. render_mode != FontRenderMode :: Bitmap {
@@ -1225,10 +1225,10 @@ impl FrameBuilder {
1225
1225
}
1226
1226
text_prim. color = shadow_prim. shadow . color ;
1227
1227
text_prim. offset += shadow_prim. shadow . offset ;
1228
- fast_text_shadow_prims . push ( text_prim) ;
1228
+ fast_shadow_prims . push ( text_prim) ;
1229
1229
}
1230
1230
}
1231
- for text_prim in fast_text_shadow_prims {
1231
+ for text_prim in fast_shadow_prims {
1232
1232
let rect = info. rect ;
1233
1233
let mut info = info. clone ( ) ;
1234
1234
info. rect = rect. translate ( & text_prim. offset ) ;
@@ -1258,15 +1258,15 @@ impl FrameBuilder {
1258
1258
// Now add this primitive index to all the currently active text shadow
1259
1259
// primitives. Although we're adding the indices *after* the visual
1260
1260
// primitive here, they will still draw before the visual text, since
1261
- // the text- shadow primitive itself has been added to the draw cmd
1262
- // list *before* the visual element, during push_text_shadow . We need
1261
+ // the shadow primitive itself has been added to the draw cmd
1262
+ // list *before* the visual element, during push_shadow . We need
1263
1263
// the primitive index of the visual element here before we can add
1264
1264
// the indices as sub-primitives to the shadow primitives.
1265
1265
for shadow_prim_index in & self . shadow_prim_stack {
1266
1266
let shadow_metadata = & mut self . prim_store . cpu_metadata [ shadow_prim_index. 0 ] ;
1267
- debug_assert_eq ! ( shadow_metadata. prim_kind, PrimitiveKind :: TextShadow ) ;
1267
+ debug_assert_eq ! ( shadow_metadata. prim_kind, PrimitiveKind :: Shadow ) ;
1268
1268
let shadow_prim =
1269
- & mut self . prim_store . cpu_text_shadows [ shadow_metadata. cpu_prim_index . 0 ] ;
1269
+ & mut self . prim_store . cpu_shadows [ shadow_metadata. cpu_prim_index . 0 ] ;
1270
1270
1271
1271
// Only run real blurs here (fast path zero blurs are handled above).
1272
1272
if shadow_prim. shadow . blur_radius > 0.0 {
0 commit comments