summaryrefslogtreecommitdiff
path: root/source/fitz/test-device.c
diff options
context:
space:
mode:
authorRay Johnston <ray.johnston@artifex.com>2014-07-17 09:41:03 -0700
committerRay Johnston <ray.johnston@artifex.com>2014-07-17 09:41:03 -0700
commit126d1639c94fe97e2fc3f849279640ad78bc379d (patch)
tree78a37f98c387c3efe44747d2ce5cb9a68a46384a /source/fitz/test-device.c
parent21b8f3b454732f0a68f66eba223ee8afe754ced1 (diff)
downloadmupdf-126d1639c94fe97e2fc3f849279640ad78bc379d.tar.xz
Minor optimization in test_device.
Don't convert and compare color if we already know the page has color.
Diffstat (limited to 'source/fitz/test-device.c')
-rw-r--r--source/fitz/test-device.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/fitz/test-device.c b/source/fitz/test-device.c
index e128e053..fd1fcd73 100644
--- a/source/fitz/test-device.c
+++ b/source/fitz/test-device.c
@@ -10,7 +10,7 @@ fz_test_colorspace(fz_context *ctx, fz_colorspace *colorspace, int *iscolor)
static void
fz_test_color(fz_context *ctx, fz_colorspace *colorspace, float *color, int *iscolor)
{
- if (colorspace && colorspace != fz_device_gray(ctx))
+ if (*iscolor != 0 && colorspace && colorspace != fz_device_gray(ctx))
{
float rgb[3];
fz_convert_color(ctx, fz_device_rgb(ctx), rgb, colorspace, color);