Skip to content

Commit f97480c

Browse files
committed
Remove old legacy style primitive code.
1 parent ec129d9 commit f97480c

File tree

8 files changed

+35
-266
lines changed

8 files changed

+35
-266
lines changed

webrender/src/batch.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,6 @@ impl AlphaBatchBuilder {
902902
PrimitiveInstanceKind::Picture { pic_index } => pic_index,
903903
PrimitiveInstanceKind::LineDecoration { .. } |
904904
PrimitiveInstanceKind::TextRun { .. } |
905-
PrimitiveInstanceKind::LegacyPrimitive { .. } |
906905
PrimitiveInstanceKind::NormalBorder { .. } |
907906
PrimitiveInstanceKind::ImageBorder { .. } |
908907
PrimitiveInstanceKind::Rectangle { .. } |
@@ -1401,11 +1400,6 @@ impl AlphaBatchBuilder {
14011400
}
14021401
}
14031402
}
1404-
(
1405-
PrimitiveInstanceKind::LegacyPrimitive { .. },
1406-
PrimitiveTemplateKind::Unused,
1407-
) => {
1408-
}
14091403
(
14101404
PrimitiveInstanceKind::ImageBorder { .. },
14111405
PrimitiveTemplateKind::ImageBorder { request, brush_segments, .. }
@@ -2306,7 +2300,6 @@ impl PrimitiveInstance {
23062300
_ => unreachable!(),
23072301
}
23082302
}
2309-
PrimitiveInstanceKind::LegacyPrimitive { .. } |
23102303
PrimitiveInstanceKind::Picture { .. } |
23112304
PrimitiveInstanceKind::TextRun { .. } |
23122305
PrimitiveInstanceKind::LineDecoration { .. } |

webrender/src/display_list_flattener.rs

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -844,13 +844,9 @@ impl<'a> DisplayListFlattener<'a> {
844844
spatial_node_index: SpatialNodeIndex,
845845
container: PrimitiveContainer,
846846
) -> PrimitiveInstance {
847-
// Build a primitive key, and optionally an old
848-
// style PrimitiveDetails structure from the
849-
// source primitive container.
847+
// Build a primitive key.
850848
let mut info = info.clone();
851-
let (prim_key_kind, prim_details) = container.build(
852-
&mut info,
853-
);
849+
let prim_key_kind = container.build(&mut info);
854850

855851
let prim_key = PrimitiveKey::new(
856852
info.is_backface_visible,
@@ -875,24 +871,7 @@ impl<'a> DisplayListFlattener<'a> {
875871
}
876872
});
877873

878-
// If we are building an old style primitive, add it to
879-
// the prim store, and create a primitive index for it.
880-
// For an interned primitive, use the primitive key to
881-
// create a matching primitive instance kind.
882-
let instance_kind = match prim_details {
883-
Some(prim_details) => {
884-
let prim_index = self.prim_store.add_primitive(
885-
&info.rect,
886-
&info.clip_rect,
887-
prim_details,
888-
);
889-
890-
PrimitiveInstanceKind::LegacyPrimitive { prim_index }
891-
}
892-
None => {
893-
prim_key.to_instance_kind(&mut self.prim_store)
894-
}
895-
};
874+
let instance_kind = prim_key.to_instance_kind(&mut self.prim_store);
896875

897876
PrimitiveInstance::new(
898877
instance_kind,

webrender/src/frame_builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ impl FrameBuilder {
338338
let mut profile_counters = FrameProfileCounters::new();
339339
profile_counters
340340
.total_primitives
341-
.set(self.prim_store.prim_count());
341+
.set(self.prim_store.prim_count);
342342

343343
resource_cache.begin_frame(stamp);
344344
gpu_cache.begin_frame(stamp.frame_id());

webrender/src/picture.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,6 @@ impl TileCache {
441441
}
442442
}
443443
}
444-
PrimitiveInstanceKind::LegacyPrimitive { .. } |
445444
PrimitiveInstanceKind::TextRun { .. } |
446445
PrimitiveInstanceKind::LineDecoration { .. } |
447446
PrimitiveInstanceKind::Clear |

0 commit comments

Comments
 (0)