mirror of
https://github.com/servo/servo.git
synced 2025-08-07 14:35:33 +01:00
gfx: Implement paint flashing, which will be useful for debugging
invalidation.
This commit is contained in:
parent
7040453358
commit
a0980091cf
7 changed files with 21 additions and 0 deletions
|
@ -26,6 +26,7 @@ use msg::constellation_msg::Msg as ConstellationMsg;
|
|||
use msg::constellation_msg::{ConstellationChan, Failure, PipelineId};
|
||||
use msg::constellation_msg::PipelineExitType;
|
||||
use profile_traits::time::{self, profile};
|
||||
use rand::{self, Rng};
|
||||
use skia::SkiaGrGLNativeContextRef;
|
||||
use std::borrow::ToOwned;
|
||||
use std::mem;
|
||||
|
@ -591,6 +592,14 @@ impl WorkerThread {
|
|||
Au::from_px(size.height))),
|
||||
color);
|
||||
}
|
||||
if opts::get().paint_flashing {
|
||||
// Overlay a random transparent color.
|
||||
let color = *rand::thread_rng().choose(&THREAD_TINT_COLORS[..]).unwrap();
|
||||
paint_context.draw_solid_color(&Rect(Point2D(Au(0), Au(0)),
|
||||
Size2D(Au::from_px(size.width),
|
||||
Au::from_px(size.height))),
|
||||
color);
|
||||
}
|
||||
}
|
||||
|
||||
draw_target
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue