Bug 1397058 - Make display item type flags compulsary and add them for all item types. r=mstange
authorMatt Woodrow <mwoodrow@mozilla.com>
Tue, 12 Sep 2017 14:13:49 -0400
changeset 380323 951b97610913788ec70a4297b5a76ac785488962
parent 380322 610fbd30a6a37ad15d24d6dbb9a6ff37c07d9f9c
child 380324 b507473b9b75dfcf08e4529483583a169f598ff6
push id94890
push usermwoodrow@mozilla.com
push dateTue, 12 Sep 2017 19:19:26 +0000
treeherdermozilla-inbound@b507473b9b75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1397058
milestone57.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 1397058 - Make display item type flags compulsary and add them for all item types. r=mstange MozReview-Commit-ID: Jp00rblsm7B
layout/painting/nsDisplayItemTypes.h
layout/painting/nsDisplayItemTypesList.h
--- a/layout/painting/nsDisplayItemTypes.h
+++ b/layout/painting/nsDisplayItemTypes.h
@@ -13,56 +13,50 @@
  */
 
 #ifndef NSDISPLAYITEMTYPES_H_
 #define NSDISPLAYITEMTYPES_H_
 
 enum class DisplayItemType {
   TYPE_ZERO = 0, /** Spacer so that the first item starts at 1 */
 
-#define DECLARE_DISPLAY_ITEM_TYPE(name) TYPE_##name,
-#define DECLARE_DISPLAY_ITEM_TYPE_FLAGS(name,flags) TYPE_##name,
+#define DECLARE_DISPLAY_ITEM_TYPE(name,flags) TYPE_##name,
 #include "nsDisplayItemTypesList.h"
 #undef DECLARE_DISPLAY_ITEM_TYPE
-#undef DECLARE_DISPLAY_ITEM_TYPE_FLAGS
 
   TYPE_MAX
 };
 
 enum {
   // Number of bits needed to represent all types
   TYPE_BITS = 8
 };
 
 enum DisplayItemFlags {
   TYPE_RENDERS_NO_IMAGES = 1 << 0
 };
 
 inline const char* DisplayItemTypeName(DisplayItemType aType)
 {
   switch (aType) {
-#define DECLARE_DISPLAY_ITEM_TYPE(name) case DisplayItemType::TYPE_##name: return #name;
-#define DECLARE_DISPLAY_ITEM_TYPE_FLAGS(name,flags) case DisplayItemType::TYPE_##name: return #name;
+#define DECLARE_DISPLAY_ITEM_TYPE(name,flags) case DisplayItemType::TYPE_##name: return #name;
 #include "nsDisplayItemTypesList.h"
 #undef DECLARE_DISPLAY_ITEM_TYPE
-#undef DECLARE_DISPLAY_ITEM_TYPE_FLAGS
 
     default: return "TYPE_UNKNOWN";
   }
 }
 
 inline uint8_t GetDisplayItemFlagsForType(DisplayItemType aType)
 {
   static const uint8_t flags[static_cast<uint32_t>(DisplayItemType::TYPE_MAX)] = {
     0
-#define DECLARE_DISPLAY_ITEM_TYPE(name) ,0
-#define DECLARE_DISPLAY_ITEM_TYPE_FLAGS(name,flags) ,flags
+#define DECLARE_DISPLAY_ITEM_TYPE(name,flags) ,flags
 #include "nsDisplayItemTypesList.h"
 #undef DECLARE_DISPLAY_ITEM_TYPE
-#undef DECLARE_DISPLAY_ITEM_TYPE_FLAGS
   };
 
   return flags[static_cast<uint32_t>(aType)];
 }
 
 inline DisplayItemType GetDisplayItemTypeFromKey(uint32_t aDisplayItemKey)
 {
   static const uint32_t typeMask = (1 << TYPE_BITS) - 1;
--- a/layout/painting/nsDisplayItemTypesList.h
+++ b/layout/painting/nsDisplayItemTypesList.h
@@ -1,99 +1,101 @@
 // IWYU pragma: private, include "nsDisplayList.h"
-DECLARE_DISPLAY_ITEM_TYPE(ALT_FEEDBACK)
-DECLARE_DISPLAY_ITEM_TYPE(BACKGROUND)
-DECLARE_DISPLAY_ITEM_TYPE(THEMED_BACKGROUND)
-DECLARE_DISPLAY_ITEM_TYPE_FLAGS(BACKGROUND_COLOR,TYPE_RENDERS_NO_IMAGES)
-DECLARE_DISPLAY_ITEM_TYPE(BLEND_CONTAINER)
-DECLARE_DISPLAY_ITEM_TYPE(BLEND_MODE)
-DECLARE_DISPLAY_ITEM_TYPE(BORDER)
-DECLARE_DISPLAY_ITEM_TYPE(BOX_SHADOW_OUTER)
-DECLARE_DISPLAY_ITEM_TYPE(BOX_SHADOW_INNER)
-DECLARE_DISPLAY_ITEM_TYPE(BULLET)
-DECLARE_DISPLAY_ITEM_TYPE(BUTTON_BORDER_BACKGROUND)
-DECLARE_DISPLAY_ITEM_TYPE(BUTTON_BOX_SHADOW_OUTER)
-DECLARE_DISPLAY_ITEM_TYPE(BUTTON_FOREGROUND)
-DECLARE_DISPLAY_ITEM_TYPE(CANVAS)
-DECLARE_DISPLAY_ITEM_TYPE(CANVAS_BACKGROUND_COLOR)
-DECLARE_DISPLAY_ITEM_TYPE(CANVAS_THEMED_BACKGROUND)
-DECLARE_DISPLAY_ITEM_TYPE(CANVAS_BACKGROUND_IMAGE)
-DECLARE_DISPLAY_ITEM_TYPE(CANVAS_FOCUS)
-DECLARE_DISPLAY_ITEM_TYPE(CARET)
-DECLARE_DISPLAY_ITEM_TYPE(CHECKED_CHECKBOX)
-DECLARE_DISPLAY_ITEM_TYPE(CHECKED_RADIOBUTTON)
-DECLARE_DISPLAY_ITEM_TYPE(CLEAR_BACKGROUND)
-DECLARE_DISPLAY_ITEM_TYPE(COLUMN_RULE)
-DECLARE_DISPLAY_ITEM_TYPE(COMBOBOX_FOCUS)
-DECLARE_DISPLAY_ITEM_TYPE(EVENT_RECEIVER)
-DECLARE_DISPLAY_ITEM_TYPE(LAYER_EVENT_REGIONS)
-DECLARE_DISPLAY_ITEM_TYPE(FIELDSET_BORDER_BACKGROUND)
-DECLARE_DISPLAY_ITEM_TYPE(FIXED_POSITION)
-DECLARE_DISPLAY_ITEM_TYPE(STICKY_POSITION)
-DECLARE_DISPLAY_ITEM_TYPE(FRAMESET_BORDER)
-DECLARE_DISPLAY_ITEM_TYPE(FRAMESET_BLANK)
-DECLARE_DISPLAY_ITEM_TYPE(HEADER_FOOTER)
-DECLARE_DISPLAY_ITEM_TYPE(IMAGE)
-DECLARE_DISPLAY_ITEM_TYPE(LIST_FOCUS)
-DECLARE_DISPLAY_ITEM_TYPE(OPACITY)
-DECLARE_DISPLAY_ITEM_TYPE(OPTION_EVENT_GRABBER)
-DECLARE_DISPLAY_ITEM_TYPE(OUTLINE)
-DECLARE_DISPLAY_ITEM_TYPE(OWN_LAYER)
-DECLARE_DISPLAY_ITEM_TYPE(PLUGIN)
-DECLARE_DISPLAY_ITEM_TYPE(PLUGIN_READBACK)
-DECLARE_DISPLAY_ITEM_TYPE(PLUGIN_VIDEO)
-DECLARE_DISPLAY_ITEM_TYPE(PRINT_PLUGIN)
-DECLARE_DISPLAY_ITEM_TYPE(RANGE_FOCUS_RING)
-DECLARE_DISPLAY_ITEM_TYPE(REMOTE)
-DECLARE_DISPLAY_ITEM_TYPE(RESOLUTION)
-DECLARE_DISPLAY_ITEM_TYPE(SCROLL_INFO_LAYER)
-DECLARE_DISPLAY_ITEM_TYPE(SELECTION_OVERLAY)
-DECLARE_DISPLAY_ITEM_TYPE(SOLID_COLOR)
-DECLARE_DISPLAY_ITEM_TYPE(SOLID_COLOR_REGION)
-DECLARE_DISPLAY_ITEM_TYPE(SUBDOCUMENT)
-DECLARE_DISPLAY_ITEM_TYPE(MASK)
-DECLARE_DISPLAY_ITEM_TYPE(FILTER)
-DECLARE_DISPLAY_ITEM_TYPE(SVG_OUTER_SVG)
-DECLARE_DISPLAY_ITEM_TYPE(SVG_GEOMETRY)
-DECLARE_DISPLAY_ITEM_TYPE(SVG_TEXT)
-DECLARE_DISPLAY_ITEM_TYPE(TABLE_CELL_BACKGROUND)
-DECLARE_DISPLAY_ITEM_TYPE(TABLE_CELL_SELECTION)
-DECLARE_DISPLAY_ITEM_TYPE(TABLE_BORDER_COLLAPSE)
-DECLARE_DISPLAY_ITEM_TYPE(TEXT)
-DECLARE_DISPLAY_ITEM_TYPE(TEXT_OVERFLOW)
-DECLARE_DISPLAY_ITEM_TYPE_FLAGS(TRANSFORM,TYPE_RENDERS_NO_IMAGES)
-DECLARE_DISPLAY_ITEM_TYPE_FLAGS(PERSPECTIVE,TYPE_RENDERS_NO_IMAGES)
-DECLARE_DISPLAY_ITEM_TYPE(VIDEO)
-DECLARE_DISPLAY_ITEM_TYPE(WRAP_LIST)
-DECLARE_DISPLAY_ITEM_TYPE(ZOOM)
-DECLARE_DISPLAY_ITEM_TYPE(GENERIC)
+DECLARE_DISPLAY_ITEM_TYPE(ALT_FEEDBACK, 0)
+DECLARE_DISPLAY_ITEM_TYPE(BACKGROUND, 0)
+DECLARE_DISPLAY_ITEM_TYPE(THEMED_BACKGROUND, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(BACKGROUND_COLOR, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(BLEND_CONTAINER, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(BLEND_MODE, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(BORDER, 0)
+DECLARE_DISPLAY_ITEM_TYPE(BOX_SHADOW_OUTER, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(BOX_SHADOW_INNER, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(BULLET, 0)
+DECLARE_DISPLAY_ITEM_TYPE(BUTTON_BORDER_BACKGROUND, 0)
+DECLARE_DISPLAY_ITEM_TYPE(BUTTON_BOX_SHADOW_OUTER, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(BUTTON_FOREGROUND, 0)
+DECLARE_DISPLAY_ITEM_TYPE(CANVAS, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(CANVAS_BACKGROUND_COLOR, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(CANVAS_THEMED_BACKGROUND, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(CANVAS_BACKGROUND_IMAGE, 0)
+DECLARE_DISPLAY_ITEM_TYPE(CANVAS_FOCUS, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(CARET, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(CHECKED_CHECKBOX, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(CHECKED_RADIOBUTTON, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(CLEAR_BACKGROUND, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(COLUMN_RULE, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(COMBOBOX_FOCUS, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(EVENT_RECEIVER, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(LAYER_EVENT_REGIONS, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(FIELDSET_BORDER_BACKGROUND, 0)
+DECLARE_DISPLAY_ITEM_TYPE(FIXED_POSITION, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(STICKY_POSITION, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(FRAMESET_BORDER, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(FRAMESET_BLANK, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(HEADER_FOOTER, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(IMAGE, 0)
+DECLARE_DISPLAY_ITEM_TYPE(LIST_FOCUS, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(OPACITY, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(OPTION_EVENT_GRABBER, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(OUTLINE, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(OWN_LAYER, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(PLUGIN, 0)
+DECLARE_DISPLAY_ITEM_TYPE(PLUGIN_READBACK, 0)
+DECLARE_DISPLAY_ITEM_TYPE(PRINT_PLUGIN, 0)
+DECLARE_DISPLAY_ITEM_TYPE(RANGE_FOCUS_RING, 0)
+DECLARE_DISPLAY_ITEM_TYPE(REMOTE, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(RESOLUTION, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(SCROLL_INFO_LAYER, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(SELECTION_OVERLAY, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(SOLID_COLOR, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(SOLID_COLOR_REGION, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(SUBDOCUMENT, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(MASK, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(FILTER, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(SVG_OUTER_SVG, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(SVG_GEOMETRY, 0)
+DECLARE_DISPLAY_ITEM_TYPE(SVG_TEXT, 0)
+DECLARE_DISPLAY_ITEM_TYPE(TABLE_CELL_BACKGROUND, 0)
+DECLARE_DISPLAY_ITEM_TYPE(TABLE_CELL_SELECTION, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(TABLE_BORDER_COLLAPSE, 0)
+DECLARE_DISPLAY_ITEM_TYPE(TABLE_BACKGROUND_COLOR, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(TABLE_BACKGROUND_IMAGE, 0)
+DECLARE_DISPLAY_ITEM_TYPE(TABLE_FIXED_POSITION, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(TEXT, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(TEXT_OVERFLOW, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(TRANSFORM,TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(PERSPECTIVE,TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(VIDEO, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(WRAP_LIST, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(ZOOM, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(GENERIC, TYPE_RENDERS_NO_IMAGES)
 
 #if defined(MOZ_REFLOW_PERF_DSP) && defined(MOZ_REFLOW_PERF)
-DECLARE_DISPLAY_ITEM_TYPE(REFLOW_COUNT)
+DECLARE_DISPLAY_ITEM_TYPE(REFLOW_COUNT, TYPE_RENDERS_NO_IMAGES)
 #endif
 
 #ifdef MOZ_XUL
-DECLARE_DISPLAY_ITEM_TYPE(XUL_EVENT_REDIRECTOR)
-DECLARE_DISPLAY_ITEM_TYPE(XUL_GROUP_BACKGROUND)
-DECLARE_DISPLAY_ITEM_TYPE(XUL_IMAGE)
-DECLARE_DISPLAY_ITEM_TYPE(XUL_TEXT_BOX)
-DECLARE_DISPLAY_ITEM_TYPE(XUL_TREE_BODY)
-DECLARE_DISPLAY_ITEM_TYPE(XUL_TREE_COL_SPLITTER_TARGET)
+DECLARE_DISPLAY_ITEM_TYPE(XUL_EVENT_REDIRECTOR, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(XUL_GROUP_BACKGROUND, 0)
+DECLARE_DISPLAY_ITEM_TYPE(XUL_IMAGE, 0)
+DECLARE_DISPLAY_ITEM_TYPE(XUL_TEXT_BOX, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(XUL_TREE_BODY, 0)
+DECLARE_DISPLAY_ITEM_TYPE(XUL_TREE_COL_SPLITTER_TARGET, TYPE_RENDERS_NO_IMAGES)
 #ifdef DEBUG_LAYOUT
-DECLARE_DISPLAY_ITEM_TYPE(XUL_DEBUG)
+DECLARE_DISPLAY_ITEM_TYPE(XUL_DEBUG, TYPE_RENDERS_NO_IMAGES)
 #endif
 #endif
 
-DECLARE_DISPLAY_ITEM_TYPE(MATHML_BAR)
-DECLARE_DISPLAY_ITEM_TYPE(MATHML_CHAR_FOREGROUND)
-DECLARE_DISPLAY_ITEM_TYPE(MATHML_ERROR)
-DECLARE_DISPLAY_ITEM_TYPE(MATHML_MENCLOSE_NOTATION)
-DECLARE_DISPLAY_ITEM_TYPE(MATHML_SELECTION_RECT)
-DECLARE_DISPLAY_ITEM_TYPE(MATHML_SLASH)
+DECLARE_DISPLAY_ITEM_TYPE(MATHML_BAR, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(MATHML_CHAR_FOREGROUND, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(MATHML_ERROR, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(MATHML_MENCLOSE_NOTATION, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(MATHML_SELECTION_RECT, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(MATHML_SLASH, TYPE_RENDERS_NO_IMAGES)
 #ifdef DEBUG
-DECLARE_DISPLAY_ITEM_TYPE(MATHML_BOUNDING_METRICS)
-DECLARE_DISPLAY_ITEM_TYPE(MATHML_CHAR_DEBUG)
+DECLARE_DISPLAY_ITEM_TYPE(MATHML_BOUNDING_METRICS, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(MATHML_CHAR_DEBUG, TYPE_RENDERS_NO_IMAGES)
 
-DECLARE_DISPLAY_ITEM_TYPE(DEBUG_BORDER)
-DECLARE_DISPLAY_ITEM_TYPE(DEBUG_IMAGE_MAP)
-DECLARE_DISPLAY_ITEM_TYPE(DEBUG_PLACEHOLDER)
-DECLARE_DISPLAY_ITEM_TYPE(EVENT_TARGET_BORDER)
+DECLARE_DISPLAY_ITEM_TYPE(DEBUG_BORDER, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(DEBUG_IMAGE_MAP, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(DEBUG_PLACEHOLDER, TYPE_RENDERS_NO_IMAGES)
+DECLARE_DISPLAY_ITEM_TYPE(EVENT_TARGET_BORDER, TYPE_RENDERS_NO_IMAGES)
 #endif