hwc: In scaling check, consider out of bounds layers.

In scaling check, consider out of bounds layers, apply trim
and then decide if scaling is necessary or not.

Change-Id: Iad7f662f42096b3f7a4a1c4cfe71048d275f4b5f
diff --git a/libhwcomposer/hwc_utils.h b/libhwcomposer/hwc_utils.h
index 40bf352..fb5e871 100644
--- a/libhwcomposer/hwc_utils.h
+++ b/libhwcomposer/hwc_utils.h
@@ -130,7 +130,7 @@
 bool isSecuring(hwc_context_t* ctx, hwc_layer_1_t const* layer);
 bool isSecureModePolicy(int mdpVersion);
 bool isExternalActive(hwc_context_t* ctx);
-bool needsScaling(hwc_layer_1_t const* layer);
+bool needsScaling(hwc_context_t* ctx, hwc_layer_1_t const* layer, const int& dpy);
 bool isAlphaPresent(hwc_layer_1_t const* layer);
 int hwc_vsync_control(hwc_context_t* ctx, int dpy, int enable);