~ubuntu-branches/ubuntu/raring/cairo/raring

« back to all changes in this revision

Viewing changes to src/cairo-xcb-connection-core.c

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2013-01-23 21:19:34 UTC
  • mfrom: (1.3.11) (28.1.7 experimental)
  • Revision ID: package-import@ubuntu.com-20130123211934-q9qb538ujcmkliic
Tags: 1.12.10-1ubuntu1
* Merge from Debian, remaining changes:
* debian/patches/server_side_gradients.patch:
  - Don't use server side gradients, most drivers don't handle those and
    are really slow
* debian/control: Add missing libxext-dev dependency to libcairo2-dev.
  Spotted by autopkgtest.
* debian/patches/git_evince_rendering_fix.patch:
  Backport GIT commit to fix a rendering bug in evince
* debian/control, debian/libcairo2.symbols, debian/rules:
  - Disable GL backend due to LP: #725434

Show diffs side-by-side

added added

removed removed

Lines of Context:
159
159
    }
160
160
}
161
161
 
162
 
void
163
 
_cairo_xcb_connection_put_subimage (cairo_xcb_connection_t *connection,
164
 
                                    xcb_drawable_t dst,
165
 
                                    xcb_gcontext_t gc,
166
 
                                    int16_t src_x,
167
 
                                    int16_t src_y,
168
 
                                    uint16_t width,
169
 
                                    uint16_t height,
170
 
                                    uint16_t cpp,
171
 
                                    int stride,
172
 
                                    int16_t dst_x,
173
 
                                    int16_t dst_y,
174
 
                                    uint8_t depth,
175
 
                                    void *_data)
 
162
static void
 
163
_cairo_xcb_connection_do_put_subimage (cairo_xcb_connection_t *connection,
 
164
                                       xcb_drawable_t dst,
 
165
                                       xcb_gcontext_t gc,
 
166
                                       int16_t src_x,
 
167
                                       int16_t src_y,
 
168
                                       uint16_t width,
 
169
                                       uint16_t height,
 
170
                                       uint16_t cpp,
 
171
                                       int stride,
 
172
                                       int16_t dst_x,
 
173
                                       int16_t dst_y,
 
174
                                       uint8_t depth,
 
175
                                       void *_data)
176
176
{
177
177
    xcb_protocol_request_t xcb_req = {
178
178
        0 /* count */,
239
239
        free (vec);
240
240
}
241
241
 
 
242
void
 
243
_cairo_xcb_connection_put_subimage (cairo_xcb_connection_t *connection,
 
244
                                    xcb_drawable_t dst,
 
245
                                    xcb_gcontext_t gc,
 
246
                                    int16_t src_x,
 
247
                                    int16_t src_y,
 
248
                                    uint16_t width,
 
249
                                    uint16_t height,
 
250
                                    uint16_t cpp,
 
251
                                    int stride,
 
252
                                    int16_t dst_x,
 
253
                                    int16_t dst_y,
 
254
                                    uint8_t depth,
 
255
                                    void *_data)
 
256
{
 
257
    const uint32_t req_size = sizeof(xcb_put_image_request_t);
 
258
    uint32_t length = height * cpp * width;
 
259
    uint32_t len = (req_size + length) >> 2;
 
260
 
 
261
    if (len < connection->maximum_request_length) {
 
262
        _cairo_xcb_connection_do_put_subimage (connection, dst, gc, src_x, src_y,
 
263
                        width, height, cpp, stride, dst_x, dst_y, depth, _data);
 
264
    } else {
 
265
        int rows = (connection->maximum_request_length - req_size - 4) / (cpp * width);
 
266
        if (rows > 0) {
 
267
            do {
 
268
                if (rows > height)
 
269
                    rows = height;
 
270
 
 
271
                length = rows * cpp * width;
 
272
 
 
273
                _cairo_xcb_connection_do_put_subimage (connection, dst, gc, src_x, src_y,
 
274
                        width, rows, cpp, stride, dst_x, dst_y, depth, _data);
 
275
 
 
276
                height -= rows;
 
277
                dst_y += rows;
 
278
                _data = (char *) _data + stride * rows;
 
279
            } while (height);
 
280
        } else {
 
281
            ASSERT_NOT_REACHED;
 
282
        }
 
283
    }
 
284
}
 
285
 
242
286
cairo_status_t
243
287
_cairo_xcb_connection_get_image (cairo_xcb_connection_t *connection,
244
288
                                 xcb_drawable_t src,