Skip to content

Commit

Permalink
color: Add enum value for the largest stock color.
Browse files Browse the repository at this point in the history
Useful if we wish to keep a cache of patterns for the very common stock
colors...
  • Loading branch information
Chris Wilson committed Jan 22, 2010
1 parent b7b65b5 commit 9c98656
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
13 changes: 7 additions & 6 deletions src/cairo-color.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,14 @@ _cairo_stock_color (cairo_stock_t stock)
return &cairo_color_black;
case CAIRO_STOCK_TRANSPARENT:
return &cairo_color_transparent;
}

ASSERT_NOT_REACHED;

/* If the user can get here somehow, give a color that indicates a
* problem. */
return &cairo_color_magenta;
case CAIRO_STOCK_NUM_COLORS:
default:
ASSERT_NOT_REACHED;
/* If the user can get here somehow, give a color that indicates a
* problem. */
return &cairo_color_magenta;
}
}

void
Expand Down
3 changes: 2 additions & 1 deletion src/cairo-types-private.h
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ typedef struct _cairo_format_masks {
typedef enum {
CAIRO_STOCK_WHITE,
CAIRO_STOCK_BLACK,
CAIRO_STOCK_TRANSPARENT
CAIRO_STOCK_TRANSPARENT,
CAIRO_STOCK_NUM_COLORS,
} cairo_stock_t;

typedef enum _cairo_image_transparency {
Expand Down

0 comments on commit 9c98656

Please sign in to comment.