libhwcomposer: Support for targets where libskia is not present

We now support compilation of the display hal for targets that do not
have libkia available.

Change-Id: I4852d506b3a496496db0cc21869a116daaa68c00
diff --git a/libhwcomposer/Android.mk b/libhwcomposer/Android.mk
index 68da8a0..7dadfe4 100644
--- a/libhwcomposer/Android.mk
+++ b/libhwcomposer/Android.mk
@@ -11,7 +11,12 @@
 LOCAL_SHARED_LIBRARIES        := $(common_libs) libEGL liboverlay \
                                  libexternal libqdutils libhardware_legacy \
                                  libdl libmemalloc libqservice libsync \
-                                 libbinder libmedia libskia libvirtual
+                                 libbinder libmedia libvirtual
+
+ifeq ($(TARGET_USES_QCOM_BSP),true)
+LOCAL_SHARED_LIBRARIES += libskia
+endif #TARGET_USES_QCOM_BSP
+
 LOCAL_CFLAGS                  := $(common_flags) -DLOG_TAG=\"qdhwcomposer\"
 LOCAL_ADDITIONAL_DEPENDENCIES := $(common_deps)
 LOCAL_SRC_FILES               := hwc.cpp          \
diff --git a/libhwcomposer/hwc_dump_layers.cpp b/libhwcomposer/hwc_dump_layers.cpp
index 6d084f3..c8ebac9 100644
--- a/libhwcomposer/hwc_dump_layers.cpp
+++ b/libhwcomposer/hwc_dump_layers.cpp
@@ -36,8 +36,10 @@
 #include <cutils/log.h>
 #include <sys/stat.h>
 #include <comptype.h>
+#ifdef QCOM_BSP
 #include <SkBitmap.h>
 #include <SkImageEncoder.h>
+#endif
 #ifdef STDC_FORMAT_MACROS
 #include <inttypes.h>
 #endif
@@ -308,7 +310,7 @@
     }
 
     getHalPixelFormatStr(hnd->format, pixFormatStr);
-
+#ifdef QCOM_BSP
     if (needDumpPng && hnd->base) {
         bool bResult = false;
         char dumpFilename[PATH_MAX];
@@ -347,7 +349,7 @@
         }
         delete tempSkBmp; // Calls SkBitmap::freePixels() internally.
     }
-
+#endif
     if (needDumpRaw && hnd->base) {
         char dumpFilename[PATH_MAX];
         bool bResult = false;