display: Modified the display processing functions
authorjinhyung.jo <jinhyung.jo@samsung.com>
Thu, 16 Apr 2015 03:03:18 +0000 (12:03 +0900)
committerjinhyung.jo <jinhyung.jo@samsung.com>
Thu, 16 Apr 2015 03:03:18 +0000 (12:03 +0900)
Changed the location of the brightness composite function
from maru_display_processing to maru_brightness.
And added a function for pixel data.

Change-Id: Ia94bee7922231d35961b53030363ba3a74cfe9e4
Signed-off-by: Jinhyung Jo <jinhyung.jo@samsung.com>
tizen/src/display/maru_display_processing.c
tizen/src/display/maru_display_processing.h
tizen/src/display/qt5.c
tizen/src/hw/pci/maru_brightness.c
tizen/src/hw/pci/maru_brightness.h

index ac37ca4..9dcd1de 100644 (file)
 
 #include "emulator_common.h"
 #include "maru_display_processing.h"
-#include "hw/pci/maru_brightness.h"
 #include "debug_ch.h"
 
 MULTI_DEBUG_CHANNEL(tizen, dpy_op);
 
-
-/* Image processing functions using the pixman library */
-void composite_brightness_image(pixman_image_t *dst_image)
-{
-    /* apply the brightness level */
-    if (brightness_level < BRIGHTNESS_MAX) {
-        pixman_image_composite(PIXMAN_OP_OVER,
-                               brightness_image, NULL, dst_image,
-                               0, 0, 0, 0, 0, 0,
-                               pixman_image_get_width(dst_image),
-                               pixman_image_get_height(dst_image));
-    }
-}
-
 /* libpng library */
 png_bytep read_png_file(const char *file_name,
     unsigned int *width_out, unsigned int *height_out)
index f66b859..11b099c 100644 (file)
@@ -31,9 +31,6 @@
 #define MARU_DISPLAY_PROCESSING_H_
 
 #include <png.h>
-#include "ui/qemu-pixman.h"
-
-void composite_brightness_image(pixman_image_t *dst);
 
 png_bytep read_png_file(const char *file_name,
     unsigned int *width_out, unsigned int *height_out);
index 6f33a22..fda6b97 100644 (file)
  *
  */
 
-#include <png.h>
 #include "ui/console.h"
 #include "emul_state.h"
 #include "maru_display.h"
 #include "qt5_supplement.h"
-#include "maru_display_processing.h"
+#include "hw/pci/maru_brightness.h"
 
 extern QemuMutex sdl_mutex;
 extern QemuCond sdl_cond;
index b15f272..1db56ff 100644 (file)
@@ -76,6 +76,37 @@ uint8_t brightness_tbl[] = {155, /* level 0 : for dimming */
 
 QEMUBH *display_bh;
 
+/* Image processing functions using the pixman library */
+void composite_brightness_image(pixman_image_t *dst_image)
+{
+    /* apply the brightness level */
+    if (brightness_level < BRIGHTNESS_MAX) {
+        pixman_image_composite(PIXMAN_OP_OVER,
+                               brightness_image, NULL, dst_image,
+                               0, 0, 0, 0, 0, 0,
+                               pixman_image_get_width(dst_image),
+                               pixman_image_get_height(dst_image));
+    }
+}
+
+void composite_brightness_image_to_pixel(void *pixels,
+                                         uint32_t width,
+                                         uint32_t height)
+{
+    pixman_image_t *image = NULL;
+
+    /* apply the brightness level */
+    if (brightness_level < BRIGHTNESS_MAX) {
+        image = pixman_image_create_bits(PIXMAN_a8r8g8b8,
+                                         width, height,
+                                         pixels, width * 4);
+        pixman_image_composite(PIXMAN_OP_OVER,
+                               brightness_image, NULL, image,
+                               0, 0, 0, 0, 0, 0, width, height);
+        pixman_image_unref(image);
+    }
+}
+
 static uint64_t brightness_reg_read(void *opaque,
                                     hwaddr addr,
                                     unsigned size)
index 96f081a..581ae91 100644 (file)
@@ -43,4 +43,9 @@ extern bool display_off;
 extern uint8_t brightness_tbl[];
 extern pixman_image_t *brightness_image;
 
+void composite_brightness_image(pixman_image_t *dst_image);
+void composite_brightness_image_to_pixel(void *pixels,
+                                         uint32_t width,
+                                         uint32_t height);
+
 #endif /* MARU_BRIGHTNESS_H_ */