From 9193f6046f9e49d8ddfd4a5a78f8f6239f593420 Mon Sep 17 00:00:00 2001 From: "jinhyung.jo" Date: Thu, 16 Apr 2015 12:03:18 +0900 Subject: [PATCH] display: Modified the display processing functions 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 --- tizen/src/display/maru_display_processing.c | 15 -------------- tizen/src/display/maru_display_processing.h | 3 --- tizen/src/display/qt5.c | 3 +-- tizen/src/hw/pci/maru_brightness.c | 31 +++++++++++++++++++++++++++++ tizen/src/hw/pci/maru_brightness.h | 5 +++++ 5 files changed, 37 insertions(+), 20 deletions(-) diff --git a/tizen/src/display/maru_display_processing.c b/tizen/src/display/maru_display_processing.c index ac37ca4..9dcd1de 100644 --- a/tizen/src/display/maru_display_processing.c +++ b/tizen/src/display/maru_display_processing.c @@ -28,25 +28,10 @@ #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) diff --git a/tizen/src/display/maru_display_processing.h b/tizen/src/display/maru_display_processing.h index f66b859..11b099c 100644 --- a/tizen/src/display/maru_display_processing.h +++ b/tizen/src/display/maru_display_processing.h @@ -31,9 +31,6 @@ #define MARU_DISPLAY_PROCESSING_H_ #include -#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); diff --git a/tizen/src/display/qt5.c b/tizen/src/display/qt5.c index 6f33a22..fda6b97 100644 --- a/tizen/src/display/qt5.c +++ b/tizen/src/display/qt5.c @@ -27,12 +27,11 @@ * */ -#include #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; diff --git a/tizen/src/hw/pci/maru_brightness.c b/tizen/src/hw/pci/maru_brightness.c index b15f272..1db56ff 100644 --- a/tizen/src/hw/pci/maru_brightness.c +++ b/tizen/src/hw/pci/maru_brightness.c @@ -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) diff --git a/tizen/src/hw/pci/maru_brightness.h b/tizen/src/hw/pci/maru_brightness.h index 96f081a..581ae91 100644 --- a/tizen/src/hw/pci/maru_brightness.h +++ b/tizen/src/hw/pci/maru_brightness.h @@ -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_ */ -- 2.7.4