mirror of
https://github.com/servo/servo.git
synced 2025-08-05 05:30:08 +01:00
Get rid of colored boxes.
They were recreating the RNG every frame, which was a bad performance problem.
This commit is contained in:
parent
b536d979cf
commit
077720fc49
1 changed files with 2 additions and 5 deletions
|
@ -28,11 +28,8 @@ trait DefaultStyleMethods {
|
||||||
impl NodeKind : DefaultStyleMethods {
|
impl NodeKind : DefaultStyleMethods {
|
||||||
fn default_color() -> Color {
|
fn default_color() -> Color {
|
||||||
match self {
|
match self {
|
||||||
Text(*) => { white() }
|
Text(*) => white(),
|
||||||
Element(*) => {
|
Element(*) => white()
|
||||||
let r = rand::rng();
|
|
||||||
rgb(r.next() as u8, r.next() as u8, r.next() as u8)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue