Merge "sdm: Set surfaceDamage numRects for solid-fill layer"
diff --git a/sdm/libs/hwc/hwc_color_manager.cpp b/sdm/libs/hwc/hwc_color_manager.cpp
index 456fd7d..fcd2a55 100644
--- a/sdm/libs/hwc/hwc_color_manager.cpp
+++ b/sdm/libs/hwc/hwc_color_manager.cpp
@@ -290,6 +290,7 @@
   layer.displayFrame = solid_fill_rect;
   layer.visibleRegionScreen.numRects = 1;
   layer.visibleRegionScreen.rects = &layer.displayFrame;
+  layer.surfaceDamage.numRects = 0;
 
   return ret;
 }
diff --git a/sdm/libs/hwc/hwc_display.cpp b/sdm/libs/hwc/hwc_display.cpp
index 63c19a9..7fe8984 100644
--- a/sdm/libs/hwc/hwc_display.cpp
+++ b/sdm/libs/hwc/hwc_display.cpp
@@ -49,12 +49,12 @@
                                       uint8_t **base_address) {
   if (rect_count) {
     region->rect = reinterpret_cast<LayerRect *>(*base_address);
-    region->count = rect_count;
-    for (size_t i = 0; i < rect_count; i++) {
+    for (uint32_t i = 0; i < rect_count; i++) {
       region->rect[i] = LayerRect();
     }
     *base_address += rect_count * sizeof(LayerRect);
   }
+  region->count = rect_count;
 }
 
 static void ApplyDeInterlaceAdjustment(Layer *layer) {
@@ -499,10 +499,10 @@
     SetRect(hwc_layer.sourceCropf, &layer.src_rect);
     ApplyDeInterlaceAdjustment(&layer);
 
-    for (size_t j = 0; j < hwc_layer.visibleRegionScreen.numRects; j++) {
+    for (uint32_t j = 0; j < layer.visible_regions.count; j++) {
       SetRect(hwc_layer.visibleRegionScreen.rects[j], &layer.visible_regions.rect[j]);
     }
-    for (size_t j = 0; j < hwc_layer.surfaceDamage.numRects; j++) {
+    for (uint32_t j = 0; j < layer.dirty_regions.count; j++) {
       SetRect(hwc_layer.surfaceDamage.rects[j], &layer.dirty_regions.rect[j]);
     }
     SetComposition(hwc_layer.compositionType, &layer.composition);