mirror of
https://github.com/servo/servo.git
synced 2025-08-09 15:35:34 +01:00
style: Inline a bunch of trivial stuff we're paying calls for in Geckolib.
This commit is contained in:
parent
10779f0251
commit
fcd6e79659
5 changed files with 23 additions and 0 deletions
|
@ -18,21 +18,25 @@ pub struct GeckoRestyleDamage(nsChangeHint);
|
|||
|
||||
impl GeckoRestyleDamage {
|
||||
/// Trivially construct a new `GeckoRestyleDamage`.
|
||||
#[inline]
|
||||
pub fn new(raw: nsChangeHint) -> Self {
|
||||
GeckoRestyleDamage(raw)
|
||||
}
|
||||
|
||||
/// Get the inner change hint for this damage.
|
||||
#[inline]
|
||||
pub fn as_change_hint(&self) -> nsChangeHint {
|
||||
self.0
|
||||
}
|
||||
|
||||
/// Get an empty change hint, that is (`nsChangeHint(0)`).
|
||||
#[inline]
|
||||
pub fn empty() -> Self {
|
||||
GeckoRestyleDamage(nsChangeHint(0))
|
||||
}
|
||||
|
||||
/// Returns whether this restyle damage represents the empty damage.
|
||||
#[inline]
|
||||
pub fn is_empty(&self) -> bool {
|
||||
self.0 == nsChangeHint(0)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue