Bug 1127170 - Add TYPE_RENDERS_NO_IMAGES for display item with transform type to bypass invalidation during image decode. r=mattwoodrow
authorpeter chang <pchang@mozilla.com>
Sun, 22 Mar 2015 23:32:00 -0400
changeset 269189 3ecb7edda780fe2a85a2056a6062159bc16d1fbe
parent 269188 a1af4116dc057e87a3f4ec48ec4aceed6dd5cfec
child 269190 6d13676c54dda5a1af151b60ec3bd6f8d2205b25
push id4830
push userjlund@mozilla.com
push dateMon, 29 Jun 2015 20:18:48 +0000
treeherdermozilla-beta@4c2175bb0420 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmattwoodrow
bugs1127170
milestone40.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1127170 - Add TYPE_RENDERS_NO_IMAGES for display item with transform type to bypass invalidation during image decode. r=mattwoodrow
layout/base/nsDisplayItemTypesList.h
layout/style/ImageLoader.cpp
--- a/layout/base/nsDisplayItemTypesList.h
+++ b/layout/base/nsDisplayItemTypesList.h
@@ -59,17 +59,17 @@ DECLARE_DISPLAY_ITEM_TYPE(TABLE_CELL_BAC
 DECLARE_DISPLAY_ITEM_TYPE(TABLE_CELL_SELECTION)
 DECLARE_DISPLAY_ITEM_TYPE(TABLE_ROW_BACKGROUND)
 DECLARE_DISPLAY_ITEM_TYPE(TABLE_ROW_GROUP_BACKGROUND)
 DECLARE_DISPLAY_ITEM_TYPE(TABLE_BORDER_BACKGROUND)
 DECLARE_DISPLAY_ITEM_TYPE(TEXT)
 DECLARE_DISPLAY_ITEM_TYPE(TEXT_DECORATION)
 DECLARE_DISPLAY_ITEM_TYPE(TEXT_OVERFLOW)
 DECLARE_DISPLAY_ITEM_TYPE(TEXT_SHADOW)
-DECLARE_DISPLAY_ITEM_TYPE(TRANSFORM)
+DECLARE_DISPLAY_ITEM_TYPE_FLAGS(TRANSFORM,TYPE_RENDERS_NO_IMAGES)
 DECLARE_DISPLAY_ITEM_TYPE(VIDEO)
 DECLARE_DISPLAY_ITEM_TYPE(WRAP_LIST)
 DECLARE_DISPLAY_ITEM_TYPE(ZOOM)
 DECLARE_DISPLAY_ITEM_TYPE(EXCLUDE_GLASS_FRAME)
 
 #if defined(MOZ_REFLOW_PERF_DSP) && defined(MOZ_REFLOW_PERF)
 DECLARE_DISPLAY_ITEM_TYPE(REFLOW_COUNT)
 #endif
--- a/layout/style/ImageLoader.cpp
+++ b/layout/style/ImageLoader.cpp
@@ -345,16 +345,20 @@ void InvalidateImagesCallback(nsIFrame* 
 {
   nsDisplayItem::Type type = nsDisplayItem::GetDisplayItemTypeFromKey(aItem->GetDisplayItemKey());
   uint8_t flags = nsDisplayItem::GetDisplayItemFlagsForType(type);
 
   if (flags & nsDisplayItem::TYPE_RENDERS_NO_IMAGES) {
     return;
   }
 
+  if (nsLayoutUtils::InvalidationDebuggingIsEnabled()) {
+    printf_stderr("Invalidating display item(type=%d) based on frame %p \
+      because it might contain an invalidated image\n", type, aFrame);
+  }
   aItem->Invalidate();
   aFrame->SchedulePaint();
 
   // Update ancestor rendering observers (-moz-element etc)
   nsIFrame *f = aFrame;
   while (f && !f->HasAnyStateBits(NS_FRAME_DESCENDANT_NEEDS_PAINT)) {
     nsSVGEffects::InvalidateDirectRenderingObservers(f);
     f = nsLayoutUtils::GetCrossDocParentFrame(f);