glamor: Remove copy of sna's compiler.h
Xfuncproto.h has equivalents for these already. v2: Adjust a couple more likelies after the rebase (anholt) Signed-off-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com> Reviewed-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
714926b090
commit
82efb90efb
|
@ -12,7 +12,6 @@ libglamor_la_LDFLAGS = -version-info 0:0:0
|
||||||
|
|
||||||
libglamor_la_SOURCES = \
|
libglamor_la_SOURCES = \
|
||||||
compat-api.h \
|
compat-api.h \
|
||||||
compiler.h \
|
|
||||||
glamor.c \
|
glamor.c \
|
||||||
glamor_copyarea.c \
|
glamor_copyarea.c \
|
||||||
glamor_copywindow.c \
|
glamor_copywindow.c \
|
||||||
|
|
|
@ -1,59 +0,0 @@
|
||||||
/*
|
|
||||||
* 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_ */
|
|
|
@ -246,7 +246,7 @@ glamor_composite_rectangles(CARD8 op,
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (likely(priv->type != GLAMOR_TEXTURE_LARGE)) {
|
if (_X_LIKELY(priv->type != GLAMOR_TEXTURE_LARGE)) {
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
source = CreateSolidPicture(0, color, &error);
|
source = CreateSolidPicture(0, color, &error);
|
||||||
|
|
|
@ -203,7 +203,7 @@ _glamor_solid_boxes(PixmapPtr pixmap, BoxPtr box, int nbox, float *color)
|
||||||
|
|
||||||
pixmap_priv_get_dest_scale(pixmap_priv, &xscale, &yscale);
|
pixmap_priv_get_dest_scale(pixmap_priv, &xscale, &yscale);
|
||||||
|
|
||||||
if (unlikely(nbox * 4 * 2 > ARRAY_SIZE(vertices))) {
|
if (_X_UNLIKELY(nbox * 4 * 2 > ARRAY_SIZE(vertices))) {
|
||||||
int allocated_box;
|
int allocated_box;
|
||||||
|
|
||||||
if (nbox * 6 > GLAMOR_COMPOSITE_VBO_VERT_CNT) {
|
if (nbox * 6 > GLAMOR_COMPOSITE_VBO_VERT_CNT) {
|
||||||
|
@ -220,7 +220,7 @@ _glamor_solid_boxes(PixmapPtr pixmap, BoxPtr box, int nbox, float *color)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unlikely(nbox > 1))
|
if (_X_UNLIKELY(nbox > 1))
|
||||||
dispatch->glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, glamor_priv->ebo);
|
dispatch->glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, glamor_priv->ebo);
|
||||||
|
|
||||||
dispatch->glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT,
|
dispatch->glVertexAttribPointer(GLAMOR_VERTEX_POS, 2, GL_FLOAT,
|
||||||
|
|
|
@ -191,7 +191,7 @@ find_continuous_bits(unsigned int bits, int bits_cnt, unsigned int *pbits_mask)
|
||||||
|
|
||||||
bits_mask = ((1LL << bits_cnt) - 1);
|
bits_mask = ((1LL << bits_cnt) - 1);
|
||||||
|
|
||||||
if (unlikely(bits_cnt > 56)) {
|
if (_X_UNLIKELY(bits_cnt > 56)) {
|
||||||
while (bits) {
|
while (bits) {
|
||||||
if ((bits & bits_mask) == bits_mask) {
|
if ((bits & bits_mask) == bits_mask) {
|
||||||
*pbits_mask = bits_mask << idx;
|
*pbits_mask = bits_mask << idx;
|
||||||
|
@ -751,7 +751,7 @@ glamor_glyphs_intersect(int nlist, GlyphListPtr list, GlyphPtr *glyphs,
|
||||||
left_to_right = TRUE;
|
left_to_right = TRUE;
|
||||||
cur_list = list++;
|
cur_list = list++;
|
||||||
|
|
||||||
if (unlikely(!first_list)) {
|
if (_X_UNLIKELY(!first_list)) {
|
||||||
pixman_region_init_with_extents(¤t_region, extents);
|
pixman_region_init_with_extents(¤t_region, extents);
|
||||||
pixman_region_union(&list_region, &list_region, ¤t_region);
|
pixman_region_union(&list_region, &list_region, ¤t_region);
|
||||||
first = TRUE;
|
first = TRUE;
|
||||||
|
@ -821,7 +821,7 @@ glamor_glyphs_intersect(int nlist, GlyphListPtr list, GlyphPtr *glyphs,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (unlikely(!first_list)) {
|
if (_X_UNLIKELY(!first_list)) {
|
||||||
current_box.x1 = x1;
|
current_box.x1 = x1;
|
||||||
current_box.y1 = y1;
|
current_box.y1 = y1;
|
||||||
current_box.x2 = x2;
|
current_box.x2 = x2;
|
||||||
|
@ -1709,7 +1709,7 @@ _glamor_glyphs(CARD8 op,
|
||||||
format = mask_format->depth << 24 | mask_format->format;
|
format = mask_format->depth << 24 | mask_format->format;
|
||||||
|
|
||||||
fixed_list = calloc(fixed_size, sizeof(*fixed_list));
|
fixed_list = calloc(fixed_size, sizeof(*fixed_list));
|
||||||
if (unlikely(fixed_list == NULL))
|
if (_X_UNLIKELY(fixed_list == NULL))
|
||||||
fixed_size = 0;
|
fixed_size = 0;
|
||||||
fixed_cnt = glamor_glyphs_intersect(nlist, list, glyphs,
|
fixed_cnt = glamor_glyphs_intersect(nlist, list, glyphs,
|
||||||
format, dst->pDrawable->pScreen,
|
format, dst->pDrawable->pScreen,
|
||||||
|
|
|
@ -31,8 +31,6 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "compiler.h"
|
|
||||||
|
|
||||||
#include <xorg-server.h>
|
#include <xorg-server.h>
|
||||||
#ifndef DEBUG
|
#ifndef DEBUG
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
|
|
|
@ -59,7 +59,7 @@
|
||||||
|
|
||||||
#define PIXMAP_PRIV_GET_ACTUAL_SIZE(priv, w, h) \
|
#define PIXMAP_PRIV_GET_ACTUAL_SIZE(priv, w, h) \
|
||||||
do { \
|
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; \
|
w = priv->large.box.x2 - priv->large.box.x1; \
|
||||||
h = priv->large.box.y2 - priv->large.box.y1; \
|
h = priv->large.box.y2 - priv->large.box.y1; \
|
||||||
} else { \
|
} else { \
|
||||||
|
@ -80,7 +80,7 @@
|
||||||
|
|
||||||
#define pixmap_priv_get_fbo_off(_priv_, _xoff_, _yoff_) \
|
#define pixmap_priv_get_fbo_off(_priv_, _xoff_, _yoff_) \
|
||||||
do { \
|
do { \
|
||||||
if (unlikely(_priv_ && (_priv_)->type == GLAMOR_TEXTURE_LARGE)) { \
|
if (_X_UNLIKELY(_priv_ && (_priv_)->type == GLAMOR_TEXTURE_LARGE)) { \
|
||||||
*(_xoff_) = - (_priv_)->large.box.x1; \
|
*(_xoff_) = - (_priv_)->large.box.x1; \
|
||||||
*(_yoff_) = - (_priv_)->large.box.y1; \
|
*(_yoff_) = - (_priv_)->large.box.y1; \
|
||||||
} else { \
|
} else { \
|
||||||
|
@ -314,7 +314,7 @@
|
||||||
texcoord, yInverted) \
|
texcoord, yInverted) \
|
||||||
do { \
|
do { \
|
||||||
(texcoord)[0] = t_from_x_coord_x(xscale, _tx_); \
|
(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_);\
|
(texcoord)[1] = t_from_x_coord_y_inverted(yscale, _ty_);\
|
||||||
else \
|
else \
|
||||||
(texcoord)[1] = t_from_x_coord_y(yscale, _ty_); \
|
(texcoord)[1] = t_from_x_coord_y(yscale, _ty_); \
|
||||||
|
@ -337,7 +337,7 @@
|
||||||
tx += fbo_x_off; \
|
tx += fbo_x_off; \
|
||||||
ty += fbo_y_off; \
|
ty += fbo_y_off; \
|
||||||
(texcoord)[0] = t_from_x_coord_x(xscale, tx); \
|
(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); \
|
(texcoord)[1] = t_from_x_coord_y_inverted(yscale, ty); \
|
||||||
else \
|
else \
|
||||||
(texcoord)[1] = t_from_x_coord_y(yscale, ty); \
|
(texcoord)[1] = t_from_x_coord_y(yscale, ty); \
|
||||||
|
@ -432,7 +432,7 @@
|
||||||
texcoords, \
|
texcoords, \
|
||||||
stride) \
|
stride) \
|
||||||
do { \
|
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, \
|
glamor_set_transformed_normalize_tcoords_ext(priv, matrix, xscale, \
|
||||||
yscale, _x1_, _y1_, \
|
yscale, _x1_, _y1_, \
|
||||||
_x2_, _y2_, yInverted, \
|
_x2_, _y2_, yInverted, \
|
||||||
|
@ -505,7 +505,7 @@
|
||||||
(vertices)[1 * stride] = _t2_ = t_from_x_coord_x(xscale, tx2); \
|
(vertices)[1 * stride] = _t2_ = t_from_x_coord_x(xscale, tx2); \
|
||||||
(vertices)[2 * stride] = _t2_; \
|
(vertices)[2 * stride] = _t2_; \
|
||||||
(vertices)[3 * stride] = _t0_; \
|
(vertices)[3 * stride] = _t0_; \
|
||||||
if (likely(yInverted)) { \
|
if (_X_LIKELY(yInverted)) { \
|
||||||
(vertices)[1] = _t1_ = t_from_x_coord_y_inverted(yscale, ty1); \
|
(vertices)[1] = _t1_ = t_from_x_coord_y_inverted(yscale, ty1); \
|
||||||
(vertices)[2 * stride + 1] = _t5_ = t_from_x_coord_y_inverted(yscale, ty2);\
|
(vertices)[2 * stride + 1] = _t5_ = t_from_x_coord_y_inverted(yscale, ty2);\
|
||||||
} \
|
} \
|
||||||
|
@ -521,7 +521,7 @@
|
||||||
x1, y1, x2, y2, \
|
x1, y1, x2, y2, \
|
||||||
yInverted, vertices, stride) \
|
yInverted, vertices, stride) \
|
||||||
do { \
|
do { \
|
||||||
if (unlikely(priv->type == GLAMOR_TEXTURE_LARGE)) { \
|
if (_X_UNLIKELY(priv->type == GLAMOR_TEXTURE_LARGE)) { \
|
||||||
float tx1, tx2, ty1, ty2; \
|
float tx1, tx2, ty1, ty2; \
|
||||||
int fbo_x_off, fbo_y_off; \
|
int fbo_x_off, fbo_y_off; \
|
||||||
pixmap_priv_get_fbo_off(priv, &fbo_x_off, &fbo_y_off); \
|
pixmap_priv_get_fbo_off(priv, &fbo_x_off, &fbo_y_off); \
|
||||||
|
@ -551,7 +551,7 @@
|
||||||
_x1_, _y1_, _x2_, _y2_, \
|
_x1_, _y1_, _x2_, _y2_, \
|
||||||
yInverted, vertices, stride)\
|
yInverted, vertices, stride)\
|
||||||
do { \
|
do { \
|
||||||
if (unlikely(priv->type == GLAMOR_TEXTURE_LARGE)) { \
|
if (_X_UNLIKELY(priv->type == GLAMOR_TEXTURE_LARGE)) { \
|
||||||
float tx1, tx2, ty1, ty2; \
|
float tx1, tx2, ty1, ty2; \
|
||||||
if (repeat_type == RepeatPad) { \
|
if (repeat_type == RepeatPad) { \
|
||||||
tx1 = _x1_ - priv->large.box.x1; \
|
tx1 = _x1_ - priv->large.box.x1; \
|
||||||
|
@ -591,7 +591,7 @@
|
||||||
(vertices)[2] = t_from_x_coord_x(xscale, x2); \
|
(vertices)[2] = t_from_x_coord_x(xscale, x2); \
|
||||||
(vertices)[6] = (vertices)[2]; \
|
(vertices)[6] = (vertices)[2]; \
|
||||||
(vertices)[4] = (vertices)[0]; \
|
(vertices)[4] = (vertices)[0]; \
|
||||||
if (likely(yInverted)) { \
|
if (_X_LIKELY(yInverted)) { \
|
||||||
(vertices)[1] = t_from_x_coord_y_inverted(yscale, y1); \
|
(vertices)[1] = t_from_x_coord_y_inverted(yscale, y1); \
|
||||||
(vertices)[7] = t_from_x_coord_y_inverted(yscale, y2); \
|
(vertices)[7] = t_from_x_coord_y_inverted(yscale, y2); \
|
||||||
} \
|
} \
|
||||||
|
@ -610,7 +610,7 @@
|
||||||
(vertices)[2] = (x2); \
|
(vertices)[2] = (x2); \
|
||||||
(vertices)[4] = (vertices)[2]; \
|
(vertices)[4] = (vertices)[2]; \
|
||||||
(vertices)[6] = (vertices)[0]; \
|
(vertices)[6] = (vertices)[0]; \
|
||||||
if (likely(yInverted)) { \
|
if (_X_LIKELY(yInverted)) { \
|
||||||
(vertices)[1] = (y1); \
|
(vertices)[1] = (y1); \
|
||||||
(vertices)[5] = (y2); \
|
(vertices)[5] = (y2); \
|
||||||
} \
|
} \
|
||||||
|
@ -629,7 +629,7 @@
|
||||||
(vertices)[1*stride] = (x2); \
|
(vertices)[1*stride] = (x2); \
|
||||||
(vertices)[2*stride] = (vertices)[1*stride]; \
|
(vertices)[2*stride] = (vertices)[1*stride]; \
|
||||||
(vertices)[3*stride] = (vertices)[0]; \
|
(vertices)[3*stride] = (vertices)[0]; \
|
||||||
if (likely(yInverted)) { \
|
if (_X_LIKELY(yInverted)) { \
|
||||||
(vertices)[1] = (y1); \
|
(vertices)[1] = (y1); \
|
||||||
(vertices)[2*stride + 1] = (y2); \
|
(vertices)[2*stride + 1] = (y2); \
|
||||||
} \
|
} \
|
||||||
|
@ -645,7 +645,7 @@
|
||||||
yInverted, vertices) \
|
yInverted, vertices) \
|
||||||
do { \
|
do { \
|
||||||
(vertices)[0] = v_from_x_coord_x(xscale, x); \
|
(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); \
|
(vertices)[1] = v_from_x_coord_y_inverted(yscale, y); \
|
||||||
} else { \
|
} else { \
|
||||||
(vertices)[1] = v_from_x_coord_y(yscale, y); \
|
(vertices)[1] = v_from_x_coord_y(yscale, y); \
|
||||||
|
@ -673,7 +673,7 @@
|
||||||
(vertices)[2] = (x2); \
|
(vertices)[2] = (x2); \
|
||||||
(vertices)[6] = (vertices)[2]; \
|
(vertices)[6] = (vertices)[2]; \
|
||||||
(vertices)[4] = (vertices)[0]; \
|
(vertices)[4] = (vertices)[0]; \
|
||||||
if (likely(yInverted)) { \
|
if (_X_LIKELY(yInverted)) { \
|
||||||
(vertices)[1] = (y1); \
|
(vertices)[1] = (y1); \
|
||||||
(vertices)[7] = (y2); \
|
(vertices)[7] = (y2); \
|
||||||
} \
|
} \
|
||||||
|
@ -699,7 +699,7 @@
|
||||||
x2 + fbo_x_off); \
|
x2 + fbo_x_off); \
|
||||||
(vertices)[2 * stride] = _t2_; \
|
(vertices)[2 * stride] = _t2_; \
|
||||||
(vertices)[3 * stride] = _t0_; \
|
(vertices)[3 * stride] = _t0_; \
|
||||||
if (likely(yInverted)) { \
|
if (_X_LIKELY(yInverted)) { \
|
||||||
(vertices)[1] = _t1_ = v_from_x_coord_y_inverted(yscale, \
|
(vertices)[1] = _t1_ = v_from_x_coord_y_inverted(yscale, \
|
||||||
y1 + fbo_y_off); \
|
y1 + fbo_y_off); \
|
||||||
(vertices)[2 * stride + 1] = _t5_ = \
|
(vertices)[2 * stride + 1] = _t5_ = \
|
||||||
|
@ -742,7 +742,7 @@
|
||||||
(vertices)[2] = v_from_x_coord_x(xscale, x2); \
|
(vertices)[2] = v_from_x_coord_x(xscale, x2); \
|
||||||
(vertices)[6] = (vertices)[2]; \
|
(vertices)[6] = (vertices)[2]; \
|
||||||
(vertices)[4] = (vertices)[0]; \
|
(vertices)[4] = (vertices)[0]; \
|
||||||
if (likely(yInverted)) { \
|
if (_X_LIKELY(yInverted)) { \
|
||||||
(vertices)[1] = v_from_x_coord_y_inverted(yscale, y1); \
|
(vertices)[1] = v_from_x_coord_y_inverted(yscale, y1); \
|
||||||
(vertices)[7] = v_from_x_coord_y_inverted(yscale, y2); \
|
(vertices)[7] = v_from_x_coord_y_inverted(yscale, y2); \
|
||||||
} \
|
} \
|
||||||
|
@ -758,7 +758,7 @@
|
||||||
yInverted, pt) \
|
yInverted, pt) \
|
||||||
do { \
|
do { \
|
||||||
(pt)[0] = t_from_x_coord_x(xscale, x); \
|
(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); \
|
(pt)[1] = t_from_x_coord_y_inverted(yscale, y); \
|
||||||
} else { \
|
} else { \
|
||||||
(pt)[1] = t_from_x_coord_y(yscale, y); \
|
(pt)[1] = t_from_x_coord_y(yscale, y); \
|
||||||
|
@ -769,7 +769,7 @@
|
||||||
yInverted, c) \
|
yInverted, c) \
|
||||||
do { \
|
do { \
|
||||||
(c)[0] = (float)x; \
|
(c)[0] = (float)x; \
|
||||||
if (likely(yInverted)) { \
|
if (_X_LIKELY(yInverted)) { \
|
||||||
(c)[1] = (float)y; \
|
(c)[1] = (float)y; \
|
||||||
} else { \
|
} else { \
|
||||||
(c)[1] = (float)height - (float)y; \
|
(c)[1] = (float)height - (float)y; \
|
||||||
|
|
|
@ -88,12 +88,12 @@ extern void *_glapi_Context;
|
||||||
#ifdef THREADS
|
#ifdef THREADS
|
||||||
|
|
||||||
#define GET_DISPATCH() \
|
#define GET_DISPATCH() \
|
||||||
(likely(_glapi_Dispatch) ? _glapi_Dispatch : _glapi_get_dispatch())
|
(_X_LIKELY(_glapi_Dispatch) ? _glapi_Dispatch : _glapi_get_dispatch())
|
||||||
|
|
||||||
#define GET_CURRENT_CONTEXT(C) C = (typeof(C)) \
|
#define GET_CURRENT_CONTEXT(C) C = (typeof(C)) \
|
||||||
(likely(_glapi_Context) ? _glapi_Context : _glapi_get_context())
|
(_X_LIKELY(_glapi_Context) ? _glapi_Context : _glapi_get_context())
|
||||||
|
|
||||||
#define SET_CURRENT_CONTEXT(C) do { if (likely(_glapi_Context)) \
|
#define SET_CURRENT_CONTEXT(C) do { if (_X_LIKELY(_glapi_Context)) \
|
||||||
_glapi_Context = (void*)C; \
|
_glapi_Context = (void*)C; \
|
||||||
else \
|
else \
|
||||||
_glapi_set_context(C); } while(0)
|
_glapi_set_context(C); } while(0)
|
||||||
|
|
Loading…
Reference in New Issue