Rename TimeProfilerCategory variants.

This commit is contained in:
Ms2ger 2015-01-04 11:31:51 +01:00
parent d3e226239e
commit 4d47817bae
5 changed files with 53 additions and 51 deletions

View file

@ -38,7 +38,7 @@ use servo_msg::constellation_msg::{PipelineId, WindowSizeData};
use servo_util::geometry::{PagePx, ScreenPx, ViewportPx};
use servo_util::memory::MemoryProfilerChan;
use servo_util::opts;
use servo_util::time::{profile, TimeProfilerChan};
use servo_util::time::{TimeProfilerCategory, profile, TimeProfilerChan};
use servo_util::{memory, time};
use std::collections::HashMap;
use std::collections::hash_map::{Occupied, Vacant};
@ -1074,7 +1074,7 @@ impl<Window: WindowMethods> IOCompositor<Window> {
gl::bind_texture(gl::TEXTURE_2D, 0);
}
profile(time::CompositingCategory, None, self.time_profiler_chan.clone(), || {
profile(TimeProfilerCategory::Compositing, None, self.time_profiler_chan.clone(), || {
debug!("compositor: compositing");
// Adjust the layer dimensions as necessary to correspond to the size of the window.
self.scene.viewport = Rect {

View file

@ -32,8 +32,7 @@ use servo_util::opts;
use servo_util::smallvec::SmallVec;
use servo_util::task::spawn_named_with_send_on_failure;
use servo_util::task_state;
use servo_util::time::{TimeProfilerChan, profile};
use servo_util::time;
use servo_util::time::{TimeProfilerChan, TimeProfilerCategory, profile};
use std::comm::{Receiver, Sender, channel};
use std::mem;
use std::task::TaskBuilder;
@ -384,7 +383,7 @@ impl<C> PaintTask<C> where C: PaintListener + Send {
mut tiles: Vec<BufferRequest>,
scale: f32,
layer_id: LayerId) {
time::profile(time::PaintingCategory, None, self.time_profiler_chan.clone(), || {
profile(TimeProfilerCategory::Painting, None, self.time_profiler_chan.clone(), || {
// Bail out if there is no appropriate stacking context.
let stacking_context = match self.root_stacking_context {
Some(ref stacking_context) => {
@ -560,7 +559,8 @@ impl WorkerThread {
paint_context.clear();
// Draw the display list.
profile(time::PaintingPerTileCategory, None, self.time_profiler_sender.clone(), || {
profile(TimeProfilerCategory::PaintingPerTile, None,
self.time_profiler_sender.clone(), || {
stacking_context.optimize_and_draw_into_context(&mut paint_context,
&tile.page_rect,
&matrix,

View file

@ -56,7 +56,7 @@ use servo_util::opts;
use servo_util::smallvec::{SmallVec, SmallVec1, VecLike};
use servo_util::task::spawn_named_with_send_on_failure;
use servo_util::task_state;
use servo_util::time::{mod, ProfilerMetadata, TimeProfilerChan, TimerMetadataFrameType};
use servo_util::time::{TimeProfilerCategory, ProfilerMetadata, TimeProfilerChan, TimerMetadataFrameType};
use servo_util::time::{TimerMetadataReflowType, profile};
use servo_util::workqueue::WorkQueue;
use std::cell::Cell;
@ -398,7 +398,7 @@ impl LayoutTask {
Box<LayoutRPC + Send>);
},
Msg::Reflow(data) => {
profile(time::LayoutPerformCategory,
profile(TimeProfilerCategory::LayoutPerform,
self.profiler_metadata(&*data),
self.time_profiler_chan.clone(),
|| self.handle_reflow(&*data, possibly_locked_rw_data));
@ -627,7 +627,7 @@ impl LayoutTask {
shared_layout_context: &mut SharedLayoutContext,
rw_data: &mut RWGuard<'a>) {
let writing_mode = flow::base(&**layout_root).writing_mode;
profile(time::LayoutDispListBuildCategory,
profile(TimeProfilerCategory::LayoutDispListBuild,
self.profiler_metadata(data),
self.time_profiler_chan.clone(),
|| {
@ -771,7 +771,7 @@ impl LayoutTask {
|mut flow| LayoutTask::reflow_all_nodes(flow.deref_mut()));
}
let mut layout_root = profile(time::LayoutStyleRecalcCategory,
let mut layout_root = profile(TimeProfilerCategory::LayoutStyleRecalc,
self.profiler_metadata(data),
self.time_profiler_chan.clone(),
|| {
@ -789,7 +789,7 @@ impl LayoutTask {
self.get_layout_root((*node).clone())
});
profile(time::LayoutRestyleDamagePropagation,
profile(TimeProfilerCategory::LayoutRestyleDamagePropagation,
self.profiler_metadata(data),
self.time_profiler_chan.clone(),
|| {
@ -811,7 +811,7 @@ impl LayoutTask {
// Perform the primary layout passes over the flow tree to compute the locations of all
// the boxes.
profile(time::LayoutMainCategory,
profile(TimeProfilerCategory::LayoutMain,
self.profiler_metadata(data),
self.time_profiler_chan.clone(),
|| {

View file

@ -19,7 +19,7 @@ use wrapper::{PostorderNodeMutTraversal, UnsafeLayoutNode};
use wrapper::{PreorderDomTraversal, PostorderDomTraversal};
use servo_util::opts;
use servo_util::time::{mod, ProfilerMetadata, TimeProfilerChan, profile};
use servo_util::time::{TimeProfilerCategory, ProfilerMetadata, TimeProfilerChan, profile};
use servo_util::workqueue::{WorkQueue, WorkUnit, WorkerProxy};
use std::mem;
use std::ptr;
@ -432,7 +432,8 @@ pub fn traverse_flow_tree_preorder(root: &mut FlowRef,
queue.data = shared_layout_context as *const _;
profile(time::LayoutParallelWarmupCategory, profiler_metadata, time_profiler_chan, || {
profile(TimeProfilerCategory::LayoutParallelWarmup, profiler_metadata,
time_profiler_chan, || {
queue.push(WorkUnit {
fun: assign_inline_sizes,
data: mut_owned_flow_to_unsafe_flow(root),
@ -451,7 +452,8 @@ pub fn build_display_list_for_subtree(root: &mut FlowRef,
queue: &mut WorkQueue<*const SharedLayoutContext,UnsafeFlow>) {
queue.data = shared_layout_context as *const _;
profile(time::LayoutParallelWarmupCategory, profiler_metadata, time_profiler_chan, || {
profile(TimeProfilerCategory::LayoutParallelWarmup, profiler_metadata,
time_profiler_chan, || {
queue.push(WorkUnit {
fun: compute_absolute_positions,
data: mut_owned_flow_to_unsafe_flow(root),

View file

@ -71,21 +71,21 @@ pub enum TimeProfilerMsg {
#[repr(u32)]
#[deriving(PartialEq, Clone, PartialOrd, Eq, Ord)]
pub enum TimeProfilerCategory {
CompositingCategory,
LayoutPerformCategory,
LayoutStyleRecalcCategory,
Compositing,
LayoutPerform,
LayoutStyleRecalc,
LayoutRestyleDamagePropagation,
LayoutNonIncrementalReset,
LayoutSelectorMatchCategory,
LayoutTreeBuilderCategory,
LayoutDamagePropagateCategory,
LayoutMainCategory,
LayoutParallelWarmupCategory,
LayoutShapingCategory,
LayoutDispListBuildCategory,
PaintingPerTileCategory,
PaintingPrepBuffCategory,
PaintingCategory,
LayoutSelectorMatch,
LayoutTreeBuilder,
LayoutDamagePropagate,
LayoutMain,
LayoutParallelWarmup,
LayoutShaping,
LayoutDispListBuild,
PaintingPerTile,
PaintingPrepBuff,
Painting,
}
impl Formatable for TimeProfilerCategory {
@ -93,36 +93,36 @@ impl Formatable for TimeProfilerCategory {
// and should be printed to indicate this
fn format(&self) -> String {
let padding = match *self {
TimeProfilerCategory::LayoutStyleRecalcCategory |
TimeProfilerCategory::LayoutStyleRecalc |
TimeProfilerCategory::LayoutRestyleDamagePropagation |
TimeProfilerCategory::LayoutNonIncrementalReset |
TimeProfilerCategory::LayoutMainCategory |
TimeProfilerCategory::LayoutDispListBuildCategory |
TimeProfilerCategory::LayoutShapingCategory |
TimeProfilerCategory::LayoutDamagePropagateCategory |
TimeProfilerCategory::PaintingPerTileCategory |
TimeProfilerCategory::PaintingPrepBuffCategory => "+ ",
TimeProfilerCategory::LayoutParallelWarmupCategory |
TimeProfilerCategory::LayoutSelectorMatchCategory |
TimeProfilerCategory::LayoutTreeBuilderCategory => "| + ",
TimeProfilerCategory::LayoutMain |
TimeProfilerCategory::LayoutDispListBuild |
TimeProfilerCategory::LayoutShaping |
TimeProfilerCategory::LayoutDamagePropagate |
TimeProfilerCategory::PaintingPerTile |
TimeProfilerCategory::PaintingPrepBuff => "+ ",
TimeProfilerCategory::LayoutParallelWarmup |
TimeProfilerCategory::LayoutSelectorMatch |
TimeProfilerCategory::LayoutTreeBuilder => "| + ",
_ => ""
};
let name = match *self {
TimeProfilerCategory::CompositingCategory => "Compositing",
TimeProfilerCategory::LayoutPerformCategory => "Layout",
TimeProfilerCategory::LayoutStyleRecalcCategory => "Style Recalc",
TimeProfilerCategory::Compositing => "Compositing",
TimeProfilerCategory::LayoutPerform => "Layout",
TimeProfilerCategory::LayoutStyleRecalc => "Style Recalc",
TimeProfilerCategory::LayoutRestyleDamagePropagation => "Restyle Damage Propagation",
TimeProfilerCategory::LayoutNonIncrementalReset => "Non-incremental reset (temporary)",
TimeProfilerCategory::LayoutSelectorMatchCategory => "Selector Matching",
TimeProfilerCategory::LayoutTreeBuilderCategory => "Tree Building",
TimeProfilerCategory::LayoutDamagePropagateCategory => "Damage Propagation",
TimeProfilerCategory::LayoutMainCategory => "Primary Layout Pass",
TimeProfilerCategory::LayoutParallelWarmupCategory => "Parallel Warmup",
TimeProfilerCategory::LayoutShapingCategory => "Shaping",
TimeProfilerCategory::LayoutDispListBuildCategory => "Display List Construction",
TimeProfilerCategory::PaintingPerTileCategory => "Painting Per Tile",
TimeProfilerCategory::PaintingPrepBuffCategory => "Buffer Prep",
TimeProfilerCategory::PaintingCategory => "Painting",
TimeProfilerCategory::LayoutSelectorMatch => "Selector Matching",
TimeProfilerCategory::LayoutTreeBuilder => "Tree Building",
TimeProfilerCategory::LayoutDamagePropagate => "Damage Propagation",
TimeProfilerCategory::LayoutMain => "Primary Layout Pass",
TimeProfilerCategory::LayoutParallelWarmup => "Parallel Warmup",
TimeProfilerCategory::LayoutShaping => "Shaping",
TimeProfilerCategory::LayoutDispListBuild => "Display List Construction",
TimeProfilerCategory::PaintingPerTile => "Painting Per Tile",
TimeProfilerCategory::PaintingPrepBuff => "Buffer Prep",
TimeProfilerCategory::Painting => "Painting",
};
format!("{}{}", padding, name)
}