summaryrefslogtreecommitdiff
path: root/fitz/res_shade.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-10-01 16:55:08 +0100
committerRobin Watts <robin.watts@artifex.com>2012-10-05 15:51:26 +0100
commit8aa48c0f5766a0d62489cb42225cd03f3d1a2a62 (patch)
tree151cd16ac806c00c2ff84f22a730bb90b83b34c8 /fitz/res_shade.c
parent9463d7a87f46c4f50cb1074424c9c3ecda7a5da1 (diff)
downloadmupdf-8aa48c0f5766a0d62489cb42225cd03f3d1a2a62.tar.xz
Make shadings hold the data streams compressed.
This reduces memory use by another 10% on the 2 testfiles mentioned in the previous commit (see bug 693330).
Diffstat (limited to 'fitz/res_shade.c')
-rw-r--r--fitz/res_shade.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/fitz/res_shade.c b/fitz/res_shade.c
index 80acbcf8..aa53a63b 100644
--- a/fitz/res_shade.c
+++ b/fitz/res_shade.c
@@ -249,7 +249,7 @@ static inline float read_sample(fz_stream *stream, int bits, float min, float ma
static void
fz_mesh_type4_process(fz_context *ctx, fz_shade *shade, fz_matrix ctm, fz_mesh_processor *painter)
{
- fz_stream *stream = fz_open_buffer(ctx, shade->buffer);
+ fz_stream *stream = fz_open_compressed_buffer(ctx, shade->buffer);
fz_vertex v[4];
fz_vertex *va = &v[0];
fz_vertex *vb = &v[1];
@@ -328,7 +328,7 @@ fz_mesh_type4_process(fz_context *ctx, fz_shade *shade, fz_matrix ctm, fz_mesh_p
static void
fz_mesh_type5_process(fz_context *ctx, fz_shade *shade, fz_matrix ctm, fz_mesh_processor *painter)
{
- fz_stream *stream = fz_open_buffer(ctx, shade->buffer);
+ fz_stream *stream = fz_open_compressed_buffer(ctx, shade->buffer);
fz_vertex *buf = NULL;
fz_vertex *ref = NULL;
int first;
@@ -645,7 +645,7 @@ make_tensor_patch(tensor_patch *p, int type, fz_point *pt)
static void
fz_mesh_type6_process(fz_context *ctx, fz_shade *shade, fz_matrix ctm, fz_mesh_processor *painter)
{
- fz_stream *stream = fz_open_buffer(ctx, shade->buffer);
+ fz_stream *stream = fz_open_compressed_buffer(ctx, shade->buffer);
int haspatch, hasprevpatch;
float prevc[4][FZ_MAX_COLORS];
fz_point prevp[12];
@@ -773,7 +773,7 @@ fz_mesh_type6_process(fz_context *ctx, fz_shade *shade, fz_matrix ctm, fz_mesh_p
static void
fz_mesh_type7_process(fz_context *ctx, fz_shade *shade, fz_matrix ctm, fz_mesh_processor *painter)
{
- fz_stream *stream = fz_open_buffer(ctx, shade->buffer);
+ fz_stream *stream = fz_open_compressed_buffer(ctx, shade->buffer);
int bpflag = shade->u.m.bpflag;
int bpcoord = shade->u.m.bpcoord;
int bpcomp = shade->u.m.bpcomp;
@@ -942,7 +942,7 @@ fz_free_shade_imp(fz_context *ctx, fz_storable *shade_)
fz_drop_colorspace(ctx, shade->colorspace);
if (shade->type == FZ_FUNCTION_BASED)
fz_free(ctx, shade->u.f.fn_vals);
- fz_drop_buffer(ctx, shade->buffer);
+ fz_free_compressed_buffer(ctx, shade->buffer);
fz_free(ctx, shade);
}