~ubuntu-branches/debian/jessie/xserver-xorg-video-intel/jessie

« back to all changes in this revision

Viewing changes to src/sna/sna_glyphs.c

  • Committer: Package Import Robot
  • Author(s): Julien Cristau
  • Date: 2012-05-26 12:38:07 UTC
  • mfrom: (26.1.14 sid)
  • Revision ID: package-import@ubuntu.com-20120526123807-esybcmtb8h417v2r
Tags: 2:2.19.0-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
315
315
                PixmapPtr pixmap = (PixmapPtr)glyph_picture->pDrawable;
316
316
                assert(glyph_picture->pDrawable->type == DRAWABLE_PIXMAP);
317
317
                if (pixmap->drawable.depth >= 8) {
318
 
                        pixmap->usage_hint = SNA_CREATE_GLYPH;
 
318
                        pixmap->usage_hint = 0;
319
319
                        sna_pixmap_force_to_gpu(pixmap, MOVE_READ);
320
320
                }
321
321
                return FALSE;
662
662
        return sna->render.clear(sna, pixmap, priv->gpu_bo);
663
663
}
664
664
 
 
665
static bool
 
666
too_large(struct sna *sna, int width, int height)
 
667
{
 
668
        return (width > sna->render.max_3d_size ||
 
669
                height > sna->render.max_3d_size);
 
670
}
 
671
 
665
672
static Bool
666
673
glyphs_via_mask(struct sna *sna,
667
674
                CARD8 op,
724
731
 
725
732
        component_alpha = NeedsComponent(format->format);
726
733
        if (!NO_SMALL_MASK &&
727
 
            (uint32_t)width * height * format->depth < 8 * 4096) {
 
734
            ((uint32_t)width * height * format->depth < 8 * 4096 ||
 
735
             too_large(sna, width, height))) {
728
736
                pixman_image_t *mask_image;
729
737
                int s;
730
738
 
1217
1225
           INT16 src_x, INT16 src_y,
1218
1226
           int nlist, GlyphListPtr list, GlyphPtr *glyphs)
1219
1227
{
1220
 
        struct sna *sna = to_sna_from_drawable(dst->pDrawable);
 
1228
        PixmapPtr pixmap = get_drawable_pixmap(dst->pDrawable);
 
1229
        struct sna *sna = to_sna_from_pixmap(pixmap);
 
1230
        struct sna_pixmap *priv;
1221
1231
        PictFormatPtr _mask;
1222
1232
 
1223
1233
        DBG(("%s(op=%d, nlist=%d, src=(%d, %d))\n",
1234
1244
                goto fallback;
1235
1245
        }
1236
1246
 
1237
 
        if (too_small(dst->pDrawable) && !picture_is_gpu(src)) {
 
1247
        if (dst->alphaMap) {
 
1248
                DBG(("%s: fallback -- dst alpha map\n", __FUNCTION__));
 
1249
                goto fallback;
 
1250
        }
 
1251
 
 
1252
        priv = sna_pixmap(pixmap);
 
1253
        if (priv == NULL) {
 
1254
                DBG(("%s: fallback -- destination unattached\n", __FUNCTION__));
 
1255
                goto fallback;
 
1256
        }
 
1257
 
 
1258
        if (too_small(priv) && !picture_is_gpu(src)) {
1238
1259
                DBG(("%s: fallback -- too small (%dx%d)\n",
1239
1260
                     __FUNCTION__, dst->pDrawable->width, dst->pDrawable->height));
1240
1261
                goto fallback;
1241
1262
        }
1242
1263
 
1243
 
        if (dst->alphaMap) {
1244
 
                DBG(("%s: fallback -- dst alpha map\n", __FUNCTION__));
1245
 
                goto fallback;
1246
 
        }
1247
 
 
1248
1264
        _mask = mask;
1249
1265
        /* XXX discard the mask for non-overlapping glyphs? */
1250
1266