|
4 | 4 |
|
5 | 5 | use app_units::Au;
|
6 | 6 | use batch_builder::BorderSideHelpers;
|
7 |
| -use device::{TextureId}; |
8 | 7 | use euclid::{Point2D, Point4D, Rect, Matrix4D, Size2D};
|
9 | 8 | use fnv::FnvHasher;
|
10 | 9 | use frame::FrameId;
|
@@ -152,18 +151,19 @@ impl AlphaBatchHelpers for PrimitiveStore {
|
152 | 151 | device_pixel_ratio: f32) -> bool {
|
153 | 152 | let metadata = self.get_metadata(prim_index);
|
154 | 153 |
|
| 154 | + // bail out if the clip rectangle is outside of the tile |
| 155 | + if let Some(ref clip_info) = metadata.clip_cache_info { |
| 156 | + if !clip_info.device_rect.intersects(tile_rect) { |
| 157 | + return false; |
| 158 | + } |
| 159 | + } |
| 160 | + |
155 | 161 | match metadata.prim_kind {
|
156 | 162 | PrimitiveKind::Rectangle |
|
157 | 163 | PrimitiveKind::TextRun |
|
158 | 164 | PrimitiveKind::Image |
|
159 | 165 | PrimitiveKind::Gradient |
|
160 |
| - PrimitiveKind::BoxShadow => { |
161 |
| - if let Some(ref clip_info) = metadata.clip_cache_info { |
162 |
| - clip_info.device_rect.intersects(tile_rect) |
163 |
| - } else { |
164 |
| - true |
165 |
| - } |
166 |
| - } |
| 166 | + PrimitiveKind::BoxShadow => true, |
167 | 167 | PrimitiveKind::Border => {
|
168 | 168 | let border = &self.cpu_borders[metadata.cpu_prim_index.0];
|
169 | 169 | let inner_rect = TransformedRect::new(&border.inner_rect,
|
@@ -589,7 +589,7 @@ impl AlphaBatcher {
|
589 | 589 | pub struct ClipBatcher {
|
590 | 590 | pub clears: Vec<CacheClipInstance>,
|
591 | 591 | pub rectangles: Vec<CacheClipInstance>,
|
592 |
| - pub images: HashMap<TextureId, Vec<CacheClipInstance>>, |
| 592 | + pub images: HashMap<SourceTexture, Vec<CacheClipInstance>>, |
593 | 593 | }
|
594 | 594 |
|
595 | 595 | impl ClipBatcher {
|
@@ -1729,13 +1729,9 @@ impl ScreenTile {
|
1729 | 1729 |
|
1730 | 1730 | // Add a task to render the updated image mask
|
1731 | 1731 | if let Some(ref clip_info) = prim_metadata.clip_cache_info {
|
1732 |
| - if let Some(mask_task) = RenderTask::new_mask(self.rect, clip_info) { |
1733 |
| - current_task.children.push(mask_task); |
1734 |
| - } else { |
1735 |
| - // The primitive has clip items but their intersection is empty |
1736 |
| - // meaning, no pixels will be visible, we can skip it entirely |
1737 |
| - continue; |
1738 |
| - } |
| 1732 | + let mask_task = RenderTask::new_mask(self.rect, clip_info) |
| 1733 | + .expect("Primitive should have been culled by `prim_affects_tile` alread"); |
| 1734 | + current_task.children.push(mask_task); |
1739 | 1735 | }
|
1740 | 1736 |
|
1741 | 1737 | // Add any dynamic render tasks needed to render this primitive
|
|
0 commit comments