Bug 1954798 - Add debug markers in WR's display list. r=emilio
And use DebugMarker(1) to signify that the next item is a view-transition snapshot. This specific marker is not meant to stay forever (although the infrastructure is), but it is useful right now. Differential Revision: https://phabricator.services.mozilla.com/D242023
This commit is contained in:
@@ -1783,6 +1783,10 @@ void DisplayListBuilder::PushBoxShadow(
|
|||||||
aBorderRadius, aClipMode);
|
aBorderRadius, aClipMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DisplayListBuilder::PushDebug(uint32_t aVal) {
|
||||||
|
wr_dp_push_debug(mWrState, aVal);
|
||||||
|
}
|
||||||
|
|
||||||
void DisplayListBuilder::StartGroup(nsPaintedDisplayItem* aItem) {
|
void DisplayListBuilder::StartGroup(nsPaintedDisplayItem* aItem) {
|
||||||
if (!mDisplayItemCache || mDisplayItemCache->IsFull()) {
|
if (!mDisplayItemCache || mDisplayItemCache->IsFull()) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -793,6 +793,8 @@ class DisplayListBuilder final {
|
|||||||
const wr::BorderRadius& aBorderRadius,
|
const wr::BorderRadius& aBorderRadius,
|
||||||
const wr::BoxShadowClipMode& aClipMode);
|
const wr::BoxShadowClipMode& aClipMode);
|
||||||
|
|
||||||
|
void PushDebug(uint32_t aVal);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notifies the DisplayListBuilder that it can group together WR display items
|
* Notifies the DisplayListBuilder that it can group together WR display items
|
||||||
* that are pushed until |CancelGroup()| or |FinishGroup()| call.
|
* that are pushed until |CancelGroup()| or |FinishGroup()| call.
|
||||||
|
|||||||
@@ -3039,6 +3039,11 @@ pub extern "C" fn wr_dp_push_stacking_context(
|
|||||||
result
|
result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[no_mangle]
|
||||||
|
pub extern "C" fn wr_dp_push_debug(state: &mut WrState, val: u32) {
|
||||||
|
state.frame_builder.dl_builder.push_debug(val);
|
||||||
|
}
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn wr_dp_pop_stacking_context(state: &mut WrState, is_reference_frame: bool) {
|
pub extern "C" fn wr_dp_pop_stacking_context(state: &mut WrState, is_reference_frame: bool) {
|
||||||
debug_assert!(unsafe { !is_in_render_thread() });
|
debug_assert!(unsafe { !is_in_render_thread() });
|
||||||
|
|||||||
@@ -1949,6 +1949,7 @@ impl<'a> SceneBuilder<'a> {
|
|||||||
|
|
||||||
self.pop_all_shadows();
|
self.pop_all_shadows();
|
||||||
}
|
}
|
||||||
|
DisplayItem::DebugMarker(..) => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -205,6 +205,9 @@ pub enum DisplayItem {
|
|||||||
|
|
||||||
ReuseItems(ItemKey),
|
ReuseItems(ItemKey),
|
||||||
RetainedItems(ItemKey),
|
RetainedItems(ItemKey),
|
||||||
|
|
||||||
|
// For debugging purposes.
|
||||||
|
DebugMarker(u32),
|
||||||
}
|
}
|
||||||
|
|
||||||
/// This is a "complete" version of the DisplayItem, with all implicit trailing
|
/// This is a "complete" version of the DisplayItem, with all implicit trailing
|
||||||
@@ -247,6 +250,8 @@ pub enum DebugDisplayItem {
|
|||||||
PopReferenceFrame,
|
PopReferenceFrame,
|
||||||
PopStackingContext,
|
PopStackingContext,
|
||||||
PopAllShadows,
|
PopAllShadows,
|
||||||
|
|
||||||
|
DebugMarker(u32)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Copy, Debug, Default, Deserialize, PartialEq, Serialize, PeekPoke)]
|
#[derive(Clone, Copy, Debug, Default, Deserialize, PartialEq, Serialize, PeekPoke)]
|
||||||
@@ -2294,6 +2299,7 @@ impl DisplayItem {
|
|||||||
DisplayItem::Text(..) => "text",
|
DisplayItem::Text(..) => "text",
|
||||||
DisplayItem::YuvImage(..) => "yuv_image",
|
DisplayItem::YuvImage(..) => "yuv_image",
|
||||||
DisplayItem::BackdropFilter(..) => "backdrop_filter",
|
DisplayItem::BackdropFilter(..) => "backdrop_filter",
|
||||||
|
DisplayItem::DebugMarker(..) => "debug",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -709,6 +709,7 @@ impl BuiltDisplayList {
|
|||||||
Real::PopAllShadows => Debug::PopAllShadows,
|
Real::PopAllShadows => Debug::PopAllShadows,
|
||||||
Real::ReuseItems(_) |
|
Real::ReuseItems(_) |
|
||||||
Real::RetainedItems(_) => unreachable!("Unexpected item"),
|
Real::RetainedItems(_) => unreachable!("Unexpected item"),
|
||||||
|
Real::DebugMarker(val) => Debug::DebugMarker(val),
|
||||||
};
|
};
|
||||||
debug_items.push(serial_di);
|
debug_items.push(serial_di);
|
||||||
}
|
}
|
||||||
@@ -1921,6 +1922,10 @@ impl DisplayListBuilder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn push_debug(&mut self, val: u32) {
|
||||||
|
self.push_item(&di::DisplayItem::DebugMarker(val));
|
||||||
|
}
|
||||||
|
|
||||||
fn generate_clip_index(&mut self) -> di::ClipId {
|
fn generate_clip_index(&mut self) -> di::ClipId {
|
||||||
self.next_clip_index += 1;
|
self.next_clip_index += 1;
|
||||||
di::ClipId(self.next_clip_index - 1, self.pipeline_id)
|
di::ClipId(self.next_clip_index - 1, self.pipeline_id)
|
||||||
|
|||||||
@@ -2374,6 +2374,7 @@ void nsDisplayImage::MaybeCreateWebRenderCommandsForViewTransition(
|
|||||||
const auto destRect =
|
const auto destRect =
|
||||||
wr::ToLayoutRect(LayoutDeviceRect::FromAppUnits(destAppUnits, factor));
|
wr::ToLayoutRect(LayoutDeviceRect::FromAppUnits(destAppUnits, factor));
|
||||||
auto rendering = wr::ToImageRendering(frame->UsedImageRendering());
|
auto rendering = wr::ToImageRendering(frame->UsedImageRendering());
|
||||||
|
aBuilder.PushDebug(1);
|
||||||
aBuilder.PushImage(destRect, destRect, !BackfaceIsHidden(),
|
aBuilder.PushImage(destRect, destRect, !BackfaceIsHidden(),
|
||||||
/* aForceAntiAliasing = */ false, rendering, key);
|
/* aForceAntiAliasing = */ false, rendering, key);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user