aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/gfx/display_list/mod.rs17
1 files changed, 1 insertions, 16 deletions
diff --git a/components/gfx/display_list/mod.rs b/components/gfx/display_list/mod.rs
index 2eec2daea49..c55831bdad5 100644
--- a/components/gfx/display_list/mod.rs
+++ b/components/gfx/display_list/mod.rs
@@ -1238,7 +1238,7 @@ pub struct ImageDisplayItem {
/// Paints a gradient.
-#[derive(Clone, Deserialize, Serialize)]
+#[derive(Clone, Deserialize, HeapSizeOf, Serialize)]
pub struct GradientDisplayItem {
/// Fields common to all display items.
pub base: BaseDisplayItem,
@@ -1253,21 +1253,6 @@ pub struct GradientDisplayItem {
pub stops: Vec<GradientStop>,
}
-
-impl HeapSizeOf for GradientDisplayItem {
- fn heap_size_of_children(&self) -> usize {
- use heapsize::heap_size_of;
- use std::os::raw::c_void;
-
- // We can't measure `stops` via Vec's HeapSizeOf implementation because GradientStop isn't
- // defined in this module, and we don't want to import GradientStop into util::mem where
- // the HeapSizeOf trait is defined. So we measure the elements directly.
- self.base.heap_size_of_children() +
- heap_size_of(self.stops.as_ptr() as *const c_void)
- }
-}
-
-
/// Paints a border.
#[derive(Clone, HeapSizeOf, Deserialize, Serialize)]
pub struct BorderDisplayItem {