@@ -27,7 +27,7 @@ use renderer::BlendMode;
27
27
use resource_cache:: ResourceCache ;
28
28
use std:: cmp;
29
29
use std:: collections:: { HashMap } ;
30
- use std:: f32;
30
+ use std:: { i32 , f32} ;
31
31
use std:: mem;
32
32
use std:: hash:: { BuildHasherDefault } ;
33
33
use std:: sync:: atomic:: { AtomicUsize , Ordering } ;
@@ -186,14 +186,13 @@ impl AlphaBatchHelpers for PrimitiveStore {
186
186
let layer_index = layer_index. 0 as i32 ;
187
187
let global_prim_id = prim_index. 0 as i32 ;
188
188
let prim_address = metadata. gpu_prim_index ;
189
- let clip_task_index = {
190
- let mask_key = match metadata. clip_cache_info {
191
- Some ( ref clip_info) => clip_info. key ,
192
- None => MaskCacheKey :: empty ( StackingContextIndex ( 0 ) ) ,
193
- } ;
194
- let cache_task_id = RenderTaskId :: Dynamic ( RenderTaskKey :: CacheMask ( mask_key) ) ;
195
- let cache_task_index = render_tasks. get_task_index ( & cache_task_id, child_pass_index) ;
196
- cache_task_index. 0 as i32
189
+ let clip_task_index = match metadata. clip_cache_info {
190
+ Some ( ref clip_info) => {
191
+ let cache_task_id = RenderTaskId :: Dynamic ( RenderTaskKey :: CacheMask ( clip_info. key ) ) ;
192
+ let cache_task_index = render_tasks. get_task_index ( & cache_task_id, child_pass_index) ;
193
+ cache_task_index. 0 as i32
194
+ } ,
195
+ None => i32:: MAX , //sentinel value for the dummy mask
197
196
} ;
198
197
199
198
match & mut batch. data {
@@ -946,8 +945,8 @@ impl RenderTask {
946
945
}
947
946
948
947
pub fn new_prim_cache ( key : PrimitiveCacheKey ,
949
- size : DeviceSize ,
950
- prim_index : PrimitiveIndex ) -> RenderTask {
948
+ size : DeviceSize ,
949
+ prim_index : PrimitiveIndex ) -> RenderTask {
951
950
RenderTask {
952
951
id : RenderTaskId :: Dynamic ( RenderTaskKey :: CachePrimitive ( key) ) ,
953
952
children : Vec :: new ( ) ,
@@ -1660,19 +1659,6 @@ impl ScreenTile {
1660
1659
let mut sc_stack = Vec :: new ( ) ;
1661
1660
let mut current_task = RenderTask :: new_alpha_batch ( self . rect , ctx) ;
1662
1661
let mut alpha_task_stack = Vec :: new ( ) ;
1663
- let mut empty_mask_task = Some ( RenderTask {
1664
- id : RenderTaskId :: Dynamic ( RenderTaskKey :: CacheMask (
1665
- MaskCacheKey :: empty ( StackingContextIndex ( 0 ) ) //CLIP TODO
1666
- ) ) ,
1667
- children : Vec :: new ( ) ,
1668
- location : RenderTaskLocation :: Dynamic ( None ,
1669
- DeviceSize :: new ( 0 , 0 ) ) ,
1670
- kind : RenderTaskKind :: CacheMask ( CacheMaskTask {
1671
- actual_rect : DeviceRect :: new ( DevicePoint :: new ( 0 , 0 ) ,
1672
- DeviceSize :: new ( 0 , 0 ) ) ,
1673
- image : None ,
1674
- } )
1675
- } ) ;
1676
1662
1677
1663
for cmd in self . cmds {
1678
1664
match cmd {
@@ -1750,10 +1736,6 @@ impl ScreenTile {
1750
1736
// meaning, no pixels will be visible, we can skip it entirely
1751
1737
continue ;
1752
1738
}
1753
- } else {
1754
- if let Some ( mask_task) = empty_mask_task. take ( ) {
1755
- current_task. children . push ( mask_task) ;
1756
- }
1757
1739
}
1758
1740
1759
1741
// Add any dynamic render tasks needed to render this primitive
0 commit comments