Fix a couple issues with the new hwcomposer HAL

- we now clear the framebuffer upon request from the HAL
- the HAL list size could get out of sync with reality
- there was also an issue where sometime we could run past the list

Change-Id: Ic3a34314aed24181f2d8cc787096af83c046ef27
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.h b/services/surfaceflinger/DisplayHardware/HWComposer.h
index 729f23b..c5d5c2b 100644
--- a/services/surfaceflinger/DisplayHardware/HWComposer.h
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.h
@@ -49,16 +49,14 @@
     status_t commit() const;
 
 
-    typedef hwc_layer_t const * const_iterator;
-    typedef hwc_layer_t* iterator;
-
-    iterator begin();
-    iterator end();
+    size_t getNumLayers() const;
+    hwc_layer_t* getLayers() const;
 
 private:
     hw_module_t const*      mModule;
     hwc_composer_device_t*  mHwc;
     hwc_layer_list_t*       mList;
+    size_t                  mCapacity;
     hwc_display_t           mDpy;
     hwc_surface_t           mSur;
 };