/**************************************************************************
*
* Copyright 2009 Artur Wyszynski <harakash@gmail.com>
- * Copyright 2013 Alexander von Gluck IV <kallisti5@unixzen.com>
+ * Copyright 2013-2014 Alexander von Gluck IV <kallisti5@unixzen.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
*
**************************************************************************/
+#include <stdio.h>
#include "pipe/p_compiler.h"
#include "pipe/p_defines.h"
#include "hgl_sw_winsys.h"
+#ifdef DEBUG
+# define TRACE(x...) printf("hgl:winsys: " x)
+# define CALLED() TRACE("CALLED: %s\n", __PRETTY_FUNCTION__)
+#else
+# define TRACE(x...)
+# define CALLED()
+#endif
+#define ERROR(x...) printf("hgl:winsys: " x)
+
+
struct haiku_displaytarget
{
enum pipe_format format;
unsigned textureUsage, enum pipe_format format)
{
// TODO STUB
- return true;
+ return TRUE;
}
static color_space
switch(format) {
case PIPE_FORMAT_B5G6R5_UNORM:
return B_CMAP8;
- case PIPE_FORMAT_A8R8G8B8_UNORM:
- case PIPE_FORMAT_X8R8G8B8_UNORM:
+ case PIPE_FORMAT_A8B8G8R8_UNORM:
+ case PIPE_FORMAT_X8B8G8R8_UNORM:
default:
return B_RGB32;
}
= CALLOC_STRUCT(haiku_displaytarget);
assert(haikuDisplayTarget);
+ TRACE("%s: %d x %d\n", __func__, width, height);
+
haikuDisplayTarget->colorSpace = hgl_winsys_convert_cs(format);
haikuDisplayTarget->format = format;
haikuDisplayTarget->width = width;
haikuDisplayTarget->size, haikuDisplayTarget->stride,
haikuDisplayTarget->colorSpace);
+ // Dump the rendered bitmap to disk for debugging
+ //dump_bitmap(bitmap);
+
return;
}