+++ /dev/null
-/*
- * Copyright (c) 2011 Intel Corporation
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the next
- * paragraph) shall be included in all copies or substantial portions of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- *
- * Authors:
- * Chris Wilson <chris@chris-wilson.co.uk>
- *
- * Copied from sna
- *
- */
-
-#ifndef _GLAMOR_COMPILER_H_
-#define _GLAMOR_COMPILER_H_
-
-#if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__)
-#define likely(expr) (__builtin_expect (!!(expr), 1))
-#define unlikely(expr) (__builtin_expect (!!(expr), 0))
-#define noinline __attribute__((noinline))
-#define fastcall __attribute__((regparm(3)))
-#define must_check __attribute__((warn_unused_result))
-#define constant __attribute__((const))
-#else
-#define likely(expr) (expr)
-#define unlikely(expr) (expr)
-#define noinline
-#define fastcall
-#define must_check
-#define constant
-#endif
-
-#ifdef HAVE_VALGRIND
-#define VG(x) x
-#else
-#define VG(x)
-#endif
-
-#define VG_CLEAR(s) VG(memset(&s, 0, sizeof(s)))
-
-#define COMPILE_TIME_ASSERT(E) ((void)sizeof(char[1 - 2*!(E)]))
-
-#endif /* _SNA_COMPILER_H_ */
#define PIXMAP_PRIV_GET_ACTUAL_SIZE(priv, w, h) \
do { \
- if (unlikely(priv->type == GLAMOR_TEXTURE_LARGE)) { \
+ if (_X_UNLIKELY(priv->type == GLAMOR_TEXTURE_LARGE)) { \
w = priv->large.box.x2 - priv->large.box.x1; \
h = priv->large.box.y2 - priv->large.box.y1; \
} else { \
#define pixmap_priv_get_fbo_off(_priv_, _xoff_, _yoff_) \
do { \
- if (unlikely(_priv_ && (_priv_)->type == GLAMOR_TEXTURE_LARGE)) { \
+ if (_X_UNLIKELY(_priv_ && (_priv_)->type == GLAMOR_TEXTURE_LARGE)) { \
*(_xoff_) = - (_priv_)->large.box.x1; \
*(_yoff_) = - (_priv_)->large.box.y1; \
} else { \
texcoord, yInverted) \
do { \
(texcoord)[0] = t_from_x_coord_x(xscale, _tx_); \
- if (likely(yInverted)) \
+ if (_X_LIKELY(yInverted)) \
(texcoord)[1] = t_from_x_coord_y_inverted(yscale, _ty_);\
else \
(texcoord)[1] = t_from_x_coord_y(yscale, _ty_); \
tx += fbo_x_off; \
ty += fbo_y_off; \
(texcoord)[0] = t_from_x_coord_x(xscale, tx); \
- if (likely(yInverted)) \
+ if (_X_LIKELY(yInverted)) \
(texcoord)[1] = t_from_x_coord_y_inverted(yscale, ty); \
else \
(texcoord)[1] = t_from_x_coord_y(yscale, ty); \
texcoords, \
stride) \
do { \
- if (likely(priv->type != GLAMOR_TEXTURE_LARGE)) { \
+ if (_X_LIKELY(priv->type != GLAMOR_TEXTURE_LARGE)) { \
glamor_set_transformed_normalize_tcoords_ext(priv, matrix, xscale, \
yscale, _x1_, _y1_, \
_x2_, _y2_, yInverted, \
(vertices)[1 * stride] = _t2_ = t_from_x_coord_x(xscale, tx2); \
(vertices)[2 * stride] = _t2_; \
(vertices)[3 * stride] = _t0_; \
- if (likely(yInverted)) { \
+ if (_X_LIKELY(yInverted)) { \
(vertices)[1] = _t1_ = t_from_x_coord_y_inverted(yscale, ty1); \
(vertices)[2 * stride + 1] = _t5_ = t_from_x_coord_y_inverted(yscale, ty2);\
} \
x1, y1, x2, y2, \
yInverted, vertices, stride) \
do { \
- if (unlikely(priv->type == GLAMOR_TEXTURE_LARGE)) { \
+ if (_X_UNLIKELY(priv->type == GLAMOR_TEXTURE_LARGE)) { \
float tx1, tx2, ty1, ty2; \
int fbo_x_off, fbo_y_off; \
pixmap_priv_get_fbo_off(priv, &fbo_x_off, &fbo_y_off); \
_x1_, _y1_, _x2_, _y2_, \
yInverted, vertices, stride)\
do { \
- if (unlikely(priv->type == GLAMOR_TEXTURE_LARGE)) { \
+ if (_X_UNLIKELY(priv->type == GLAMOR_TEXTURE_LARGE)) { \
float tx1, tx2, ty1, ty2; \
if (repeat_type == RepeatPad) { \
tx1 = _x1_ - priv->large.box.x1; \
(vertices)[2] = t_from_x_coord_x(xscale, x2); \
(vertices)[6] = (vertices)[2]; \
(vertices)[4] = (vertices)[0]; \
- if (likely(yInverted)) { \
+ if (_X_LIKELY(yInverted)) { \
(vertices)[1] = t_from_x_coord_y_inverted(yscale, y1); \
(vertices)[7] = t_from_x_coord_y_inverted(yscale, y2); \
} \
(vertices)[2] = (x2); \
(vertices)[4] = (vertices)[2]; \
(vertices)[6] = (vertices)[0]; \
- if (likely(yInverted)) { \
+ if (_X_LIKELY(yInverted)) { \
(vertices)[1] = (y1); \
(vertices)[5] = (y2); \
} \
(vertices)[1*stride] = (x2); \
(vertices)[2*stride] = (vertices)[1*stride]; \
(vertices)[3*stride] = (vertices)[0]; \
- if (likely(yInverted)) { \
+ if (_X_LIKELY(yInverted)) { \
(vertices)[1] = (y1); \
(vertices)[2*stride + 1] = (y2); \
} \
yInverted, vertices) \
do { \
(vertices)[0] = v_from_x_coord_x(xscale, x); \
- if (likely(yInverted)) { \
+ if (_X_LIKELY(yInverted)) { \
(vertices)[1] = v_from_x_coord_y_inverted(yscale, y); \
} else { \
(vertices)[1] = v_from_x_coord_y(yscale, y); \
(vertices)[2] = (x2); \
(vertices)[6] = (vertices)[2]; \
(vertices)[4] = (vertices)[0]; \
- if (likely(yInverted)) { \
+ if (_X_LIKELY(yInverted)) { \
(vertices)[1] = (y1); \
(vertices)[7] = (y2); \
} \
x2 + fbo_x_off); \
(vertices)[2 * stride] = _t2_; \
(vertices)[3 * stride] = _t0_; \
- if (likely(yInverted)) { \
+ if (_X_LIKELY(yInverted)) { \
(vertices)[1] = _t1_ = v_from_x_coord_y_inverted(yscale, \
y1 + fbo_y_off); \
(vertices)[2 * stride + 1] = _t5_ = \
(vertices)[2] = v_from_x_coord_x(xscale, x2); \
(vertices)[6] = (vertices)[2]; \
(vertices)[4] = (vertices)[0]; \
- if (likely(yInverted)) { \
+ if (_X_LIKELY(yInverted)) { \
(vertices)[1] = v_from_x_coord_y_inverted(yscale, y1); \
(vertices)[7] = v_from_x_coord_y_inverted(yscale, y2); \
} \
yInverted, pt) \
do { \
(pt)[0] = t_from_x_coord_x(xscale, x); \
- if (likely(yInverted)) { \
+ if (_X_LIKELY(yInverted)) { \
(pt)[1] = t_from_x_coord_y_inverted(yscale, y); \
} else { \
(pt)[1] = t_from_x_coord_y(yscale, y); \
yInverted, c) \
do { \
(c)[0] = (float)x; \
- if (likely(yInverted)) { \
+ if (_X_LIKELY(yInverted)) { \
(c)[1] = (float)y; \
} else { \
(c)[1] = (float)height - (float)y; \