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

« back to all changes in this revision

Viewing changes to src/sna/sna_render_inline.h

  • 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:
72
72
{
73
73
        struct sna_pixmap *priv = sna_pixmap_from_drawable(drawable);
74
74
 
75
 
        if (priv == NULL)
 
75
        if (priv == NULL || priv->clear)
76
76
                return false;
77
77
 
78
 
        if (priv->gpu_damage)
 
78
        if (priv->gpu_damage || (priv->gpu_bo && kgem_bo_is_busy(priv->gpu_bo) && !priv->gpu_bo->proxy))
79
79
                return true;
80
80
 
81
81
        return priv->cpu_bo && kgem_bo_is_busy(priv->cpu_bo);
85
85
is_cpu(DrawablePtr drawable)
86
86
{
87
87
        struct sna_pixmap *priv = sna_pixmap_from_drawable(drawable);
88
 
        return !priv || priv->cpu_damage != NULL;
 
88
        if (priv == NULL || priv->clear || DAMAGE_IS_ALL(priv->cpu_damage))
 
89
                return true;
 
90
 
 
91
        if (priv->gpu_damage || (priv->cpu_bo && kgem_bo_is_busy(priv->cpu_bo)))
 
92
                return false;
 
93
 
 
94
        return true;
89
95
}
90
96
 
91
97
static inline Bool
95
101
        return priv == NULL || kgem_bo_is_dirty(priv->gpu_bo);
96
102
}
97
103
 
98
 
static inline Bool
99
 
too_small(DrawablePtr drawable)
 
104
static inline bool
 
105
too_small(struct sna_pixmap *priv)
100
106
{
101
 
        struct sna_pixmap *priv = sna_pixmap_from_drawable(drawable);
102
 
 
103
 
        if (priv == NULL)
104
 
                return true;
 
107
        assert(priv);
105
108
 
106
109
        if (priv->gpu_damage)
107
110
                return false;
187
190
        }
188
191
}
189
192
 
 
193
inline static uint32_t
 
194
color_convert(uint32_t pixel,
 
195
              uint32_t src_format,
 
196
              uint32_t dst_format)
 
197
{
 
198
        DBG(("%s: src=%08x [%08x]\n", __FUNCTION__, pixel, src_format));
 
199
 
 
200
        if (src_format != dst_format) {
 
201
                uint16_t red, green, blue, alpha;
 
202
 
 
203
                if (!sna_get_rgba_from_pixel(pixel,
 
204
                                             &red, &green, &blue, &alpha,
 
205
                                             src_format))
 
206
                        return 0;
 
207
 
 
208
                if (!sna_get_pixel_from_rgba(&pixel,
 
209
                                             red, green, blue, alpha,
 
210
                                             dst_format))
 
211
                        return 0;
 
212
        }
 
213
 
 
214
        DBG(("%s: dst=%08x [%08x]\n", __FUNCTION__, pixel, dst_format));
 
215
        return pixel;
 
216
}
 
217
 
190
218
#endif /* SNA_RENDER_INLINE_H */