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

« back to all changes in this revision

Viewing changes to src/cairo-xcb-shm.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:
63
63
struct _cairo_xcb_shm_mem_pool {
64
64
    int shmid;
65
65
    uint32_t shmseg;
 
66
    void *shm;
66
67
 
67
68
    cairo_mempool_t mem;
68
69
 
74
75
{
75
76
    cairo_list_del (&pool->link);
76
77
 
77
 
    shmdt (pool->mem.base);
 
78
    shmdt (pool->shm);
78
79
    _cairo_mempool_fini (&pool->mem);
79
80
 
80
81
    free (pool);
160
161
    size_t shm_allocated = 0;
161
162
    void *mem = NULL;
162
163
    cairo_status_t status;
163
 
    void *base;
164
164
 
165
165
    assert (connection->flags & CAIRO_XCB_HAS_SHM);
166
166
 
240
240
        return CAIRO_INT_STATUS_UNSUPPORTED;
241
241
    }
242
242
 
243
 
    base = shmat (pool->shmid, NULL, 0);
244
 
    if (unlikely (base == (char *) -1)) {
 
243
    pool->shm = shmat (pool->shmid, NULL, 0);
 
244
    if (unlikely (pool->shm == (char *) -1)) {
245
245
        shmctl (pool->shmid, IPC_RMID, NULL);
246
246
        free (pool);
247
247
        CAIRO_MUTEX_UNLOCK (connection->shm_mutex);
248
248
        return _cairo_error (CAIRO_STATUS_NO_MEMORY);
249
249
    }
250
250
 
251
 
    status = _cairo_mempool_init (&pool->mem, base, bytes,
 
251
    status = _cairo_mempool_init (&pool->mem, pool->shm, bytes,
252
252
                                  minbits, maxbits - minbits + 1);
253
253
    if (unlikely (status)) {
254
 
        shmdt (base);
 
254
        shmdt (pool->shm);
255
255
        free (pool);
256
256
        CAIRO_MUTEX_UNLOCK (connection->shm_mutex);
257
257
        return status;
275
275
    shm_info->pool = pool;
276
276
    shm_info->shm = pool->shmseg;
277
277
    shm_info->size = size;
278
 
    shm_info->offset = (char *) mem - (char *) pool->mem.base;
 
278
    shm_info->offset = (char *) mem - (char *) pool->shm;
279
279
    shm_info->mem = mem;
280
280
    shm_info->sync.sequence = XCB_NONE;
281
281