Bug 1565910 - Preserve batch features when merging batches. r=gw

Differential Revision: https://phabricator.services.mozilla.com/D38080

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Nicolas Silva 2019-07-15 21:46:22 +00:00
Родитель 223a1a8c40
Коммит 1e2404a275
1 изменённых файлов: 7 добавлений и 3 удалений

Просмотреть файл

@ -365,6 +365,11 @@ impl PrimitiveBatch {
features: BatchFeatures::empty(),
}
}
fn merge(&mut self, other: PrimitiveBatch) {
self.instances.extend(other.instances);
self.features |= other.features;
}
}
#[cfg_attr(feature = "capture", derive(Serialize))]
@ -407,7 +412,7 @@ impl AlphaBatchContainer {
match batch_index {
Some(batch_index) => {
self.opaque_batches[batch_index].instances.extend(other_batch.instances);
self.opaque_batches[batch_index].merge(other_batch);
}
None => {
self.opaque_batches.push(other_batch);
@ -424,8 +429,7 @@ impl AlphaBatchContainer {
match batch_index {
Some(batch_index) => {
let batch_index = batch_index + min_batch_index;
self.alpha_batches[batch_index].instances.extend(other_batch.instances);
self.alpha_batches[batch_index + min_batch_index].merge(other_batch);
min_batch_index = batch_index;
}
None => {