Commit 7d0ea09e authored by Kenneth Moreland's avatar Kenneth Moreland
Browse files

Add option to render images, even if they are empty.

parent cfd4f22b
......@@ -140,7 +140,7 @@ static void icetSparseImageSetActualSize(IceTSparseImage image,
* to the last run length. This parameter is optional. If set to NULL,
* it is assumed that out_data_p will initially point to a run length.
* This parameter is ignored if out_data_p is NULL.
*/
*/
static void icetSparseImageScanPixels(const IceTVoid **in_data_p,
IceTSizeType *inactive_before_p,
IceTSizeType *active_till_next_runl_p,
......@@ -693,7 +693,7 @@ IceTFloat *icetImageGetColorf(IceTImage image)
{
const IceTFloat *const_buffer = icetImageGetColorcf(image);
/* This const cast is OK because we actually got the pointer from a
non-const image. */
return (IceTFloat *)const_buffer;
......@@ -725,7 +725,7 @@ IceTVoid *icetImageGetDepthVoid(IceTImage image, IceTSizeType *pixel_size)
/* This const cast is OK because we actually got the pointer from a
non-const image. */
return (IceTVoid *)const_buffer;
return (IceTVoid *)const_buffer;
}
const IceTFloat *icetImageGetDepthcf(const IceTImage image)
{
......@@ -743,7 +743,7 @@ IceTFloat *icetImageGetDepthf(IceTImage image)
{
const IceTFloat *const_buffer = icetImageGetDepthcf(image);
/* This const cast is OK because we actually got the pointer from a
non-const image. */
return (IceTFloat *)const_buffer;
......@@ -1261,7 +1261,7 @@ static void icetSparseImageScanPixels(const IceTVoid **in_data_p,
out_data += RUN_LENGTH_SIZE; \
INACTIVE_RUN_LENGTH(last_out_run_length) = 0; \
ACTIVE_RUN_LENGTH(last_out_run_length) = 0; \
}
}
if (out_data_p != NULL) {
out_data = *out_data_p;
......@@ -2344,8 +2344,10 @@ static IceTImage renderTile(int tile,
screen_viewport[1] = target_viewport[1] = 0;
screen_viewport[2] = target_viewport[2] = 0;
screen_viewport[3] = target_viewport[3] = 0;
/* Don't bother to render. */
return tile_buffer;
if (!icetIsEnabled(ICET_RENDER_EMPTY_IMAGES)) {
/* Don't bother to render. */
return tile_buffer;
}
#if 1
} else if ( (contained_viewport[0] >= tile_viewport[0])
&& (contained_viewport[1] >= tile_viewport[1])
......@@ -2536,7 +2538,7 @@ static IceTImage getRenderBuffer(void)
IceTVoid *buffer;
icetRaiseDebug("Last render should still be good.");
icetGetPointerv(ICET_RENDER_BUFFER_HOLD, &buffer);
return icetImageUnpackageFromReceive(buffer);
return icetImageUnpackageFromReceive(buffer);
} else {
IceTInt dim[2];
IceTImage image;
......
......@@ -194,6 +194,7 @@ void icetStateSetDefaults(void)
icetEnable(ICET_COMPOSITE_ONE_BUFFER);
icetEnable(ICET_INTERLACE_IMAGES);
icetEnable(ICET_COLLECT_IMAGES);
icetDisable(ICET_RENDER_EMPTY_IMAGES);
icetStateSetBoolean(ICET_IS_DRAWING_FRAME, 0);
icetStateSetBoolean(ICET_RENDER_BUFFER_SIZE, 0);
......@@ -612,9 +613,9 @@ static void *icetUnsafeStateGet(IceTEnum pname, IceTEnum type)
stateCheck(pname, icetGetState());
if (icetGetState()[pname].type != type) {
icetRaiseError("Mismatched types in unsafe state get.",
ICET_SANITY_CHECK_FAIL);
return NULL;
icetRaiseError("Mismatched types in unsafe state get.",
ICET_SANITY_CHECK_FAIL);
return NULL;
}
return icetGetState()[pname].data;
}
......
......@@ -350,6 +350,7 @@ ICET_EXPORT void icetDiagnostics(IceTBitField mask);
#define ICET_COMPOSITE_ONE_BUFFER (ICET_STATE_ENABLE_START | (IceTEnum)0x0004)
#define ICET_INTERLACE_IMAGES (ICET_STATE_ENABLE_START | (IceTEnum)0x0005)
#define ICET_COLLECT_IMAGES (ICET_STATE_ENABLE_START | (IceTEnum)0x0006)
#define ICET_RENDER_EMPTY_IMAGES (ICET_STATE_ENABLE_START | (IceTEnum)0x0007)
/* This set of enable state variables are reserved for the rendering layer. */
#define ICET_RENDER_LAYER_ENABLE_START (ICET_STATE_ENABLE_START | (IceTEnum)0x0030)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment