Commit d84d7102 authored by Eric Anholt's avatar Eric Anholt

glamor: Apply x-indent.sh.

Signed-off-by: Eric Anholt's avatarEric Anholt <eric@anholt.net>
Reviewed-by: default avatarZhigang Gong <zhigang.gong@linux.intel.com>
Reviewed-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
parent e8e9a54c
...@@ -56,4 +56,4 @@ ...@@ -56,4 +56,4 @@
#define COMPILE_TIME_ASSERT(E) ((void)sizeof(char[1 - 2*!(E)])) #define COMPILE_TIME_ASSERT(E) ((void)sizeof(char[1 - 2*!(E)]))
#endif /* _SNA_COMPILER_H_ */ #endif /* _SNA_COMPILER_H_ */
This diff is collapsed.
This diff is collapsed.
...@@ -30,36 +30,32 @@ ...@@ -30,36 +30,32 @@
static Bool static Bool
_glamor_add_traps(PicturePtr pPicture, _glamor_add_traps(PicturePtr pPicture,
INT16 x_off, INT16 x_off,
INT16 y_off, int ntrap, xTrap * traps, INT16 y_off, int ntrap, xTrap * traps, Bool fallback)
Bool fallback)
{ {
if (!fallback if (!fallback
&& ( !pPicture->pDrawable && (!pPicture->pDrawable
|| glamor_ddx_fallback_check_pixmap(pPicture->pDrawable))) || glamor_ddx_fallback_check_pixmap(pPicture->pDrawable)))
return FALSE; return FALSE;
if (glamor_prepare_access_picture(pPicture, GLAMOR_ACCESS_RW)) { if (glamor_prepare_access_picture(pPicture, GLAMOR_ACCESS_RW)) {
fbAddTraps(pPicture, x_off, y_off, ntrap, traps); fbAddTraps(pPicture, x_off, y_off, ntrap, traps);
glamor_finish_access_picture(pPicture, GLAMOR_ACCESS_RW); glamor_finish_access_picture(pPicture, GLAMOR_ACCESS_RW);
} }
return TRUE; return TRUE;
} }
void void
glamor_add_traps(PicturePtr pPicture, glamor_add_traps(PicturePtr pPicture,
INT16 x_off, INT16 x_off, INT16 y_off, int ntrap, xTrap * traps)
INT16 y_off, int ntrap, xTrap * traps)
{ {
_glamor_add_traps(pPicture, x_off, y_off, ntrap, traps, TRUE); _glamor_add_traps(pPicture, x_off, y_off, ntrap, traps, TRUE);
} }
Bool Bool
glamor_add_traps_nf(PicturePtr pPicture, glamor_add_traps_nf(PicturePtr pPicture,
INT16 x_off, INT16 x_off, INT16 y_off, int ntrap, xTrap * traps)
INT16 y_off, int ntrap, xTrap * traps)
{ {
return _glamor_add_traps(pPicture, x_off, y_off, ntrap, traps, FALSE); return _glamor_add_traps(pPicture, x_off, y_off, ntrap, traps, FALSE);
} }
This diff is collapsed.
This diff is collapsed.
...@@ -30,43 +30,43 @@ ...@@ -30,43 +30,43 @@
static Bool static Bool
_glamor_copy_plane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, _glamor_copy_plane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
int srcx, int srcy, int w, int h, int dstx, int dsty, int srcx, int srcy, int w, int h, int dstx, int dsty,
unsigned long bitPlane, RegionPtr *pRegion, Bool fallback) unsigned long bitPlane, RegionPtr *pRegion, Bool fallback)
{ {
if (!fallback if (!fallback && glamor_ddx_fallback_check_gc(pGC)
&& glamor_ddx_fallback_check_gc(pGC) && glamor_ddx_fallback_check_pixmap(pSrc)
&& glamor_ddx_fallback_check_pixmap(pSrc) && glamor_ddx_fallback_check_pixmap(pDst))
&& glamor_ddx_fallback_check_pixmap(pDst)) goto fail;
goto fail;
glamor_prepare_access(pDst, GLAMOR_ACCESS_RW); glamor_prepare_access(pDst, GLAMOR_ACCESS_RW);
glamor_prepare_access(pSrc, GLAMOR_ACCESS_RO); glamor_prepare_access(pSrc, GLAMOR_ACCESS_RO);
*pRegion = fbCopyPlane(pSrc, pDst, pGC, srcx, srcy, w, h, *pRegion = fbCopyPlane(pSrc, pDst, pGC, srcx, srcy, w, h,
dstx, dsty, bitPlane); dstx, dsty, bitPlane);
glamor_finish_access(pSrc, GLAMOR_ACCESS_RO); glamor_finish_access(pSrc, GLAMOR_ACCESS_RO);
glamor_finish_access(pDst, GLAMOR_ACCESS_RW); glamor_finish_access(pDst, GLAMOR_ACCESS_RW);
return TRUE; return TRUE;
fail: fail:
return FALSE; return FALSE;
} }
RegionPtr RegionPtr
glamor_copy_plane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, glamor_copy_plane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
int srcx, int srcy, int w, int h, int dstx, int dsty, int srcx, int srcy, int w, int h, int dstx, int dsty,
unsigned long bitPlane) unsigned long bitPlane)
{ {
RegionPtr ret; RegionPtr ret;
_glamor_copy_plane(pSrc, pDst, pGC, srcx, srcy, w, h,
dstx, dsty, bitPlane, &ret, TRUE); _glamor_copy_plane(pSrc, pDst, pGC, srcx, srcy, w, h,
return ret; dstx, dsty, bitPlane, &ret, TRUE);
return ret;
} }
Bool Bool
glamor_copy_plane_nf(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC, glamor_copy_plane_nf(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
int srcx, int srcy, int w, int h, int dstx, int dsty, int srcx, int srcy, int w, int h, int dstx, int dsty,
unsigned long bitPlane, RegionPtr *pRegion) unsigned long bitPlane, RegionPtr *pRegion)
{ {
return _glamor_copy_plane(pSrc, pDst, pGC, srcx, srcy, w, h, return _glamor_copy_plane(pSrc, pDst, pGC, srcx, srcy, w, h,
dstx, dsty, bitPlane, pRegion, FALSE); dstx, dsty, bitPlane, pRegion, FALSE);
} }
...@@ -29,30 +29,28 @@ ...@@ -29,30 +29,28 @@
*/ */
void void
glamor_copy_window(WindowPtr win, DDXPointRec old_origin, glamor_copy_window(WindowPtr win, DDXPointRec old_origin, RegionPtr src_region)
RegionPtr src_region)
{ {
RegionRec dst_region; RegionRec dst_region;
int dx, dy; int dx, dy;
PixmapPtr pixmap = win->drawable.pScreen->GetWindowPixmap(win); PixmapPtr pixmap = win->drawable.pScreen->GetWindowPixmap(win);
dx = old_origin.x - win->drawable.x; dx = old_origin.x - win->drawable.x;
dy = old_origin.y - win->drawable.y; dy = old_origin.y - win->drawable.y;
REGION_TRANSLATE(win->drawable.pScreen, src_region, -dx, -dy); REGION_TRANSLATE(win->drawable.pScreen, src_region, -dx, -dy);
REGION_INIT(win->drawable.pScreen, &dst_region, NullBox, 0); REGION_INIT(win->drawable.pScreen, &dst_region, NullBox, 0);
REGION_INTERSECT(win->drawable.pScreen, &dst_region, REGION_INTERSECT(win->drawable.pScreen, &dst_region,
&win->borderClip, src_region); &win->borderClip, src_region);
#ifdef COMPOSITE #ifdef COMPOSITE
if (pixmap->screen_x || pixmap->screen_y) if (pixmap->screen_x || pixmap->screen_y)
REGION_TRANSLATE(win->drawable.pScreen, &dst_region, REGION_TRANSLATE(win->drawable.pScreen, &dst_region,
-pixmap->screen_x, -pixmap->screen_y); -pixmap->screen_x, -pixmap->screen_y);
#endif #endif
miCopyRegion(&pixmap->drawable, &pixmap->drawable, miCopyRegion(&pixmap->drawable, &pixmap->drawable,
NULL, &dst_region, dx, dy, glamor_copy_n_to_n, 0, NULL, &dst_region, dx, dy, glamor_copy_n_to_n, 0, NULL);
NULL);
REGION_UNINIT(win->drawable.pScreen, &dst_region); REGION_UNINIT(win->drawable.pScreen, &dst_region);
} }
This diff is collapsed.
...@@ -29,7 +29,6 @@ ...@@ -29,7 +29,6 @@
#ifndef __GLAMOR_DEBUG_H__ #ifndef __GLAMOR_DEBUG_H__
#define __GLAMOR_DEBUG_H__ #define __GLAMOR_DEBUG_H__
#define GLAMOR_DELAYED_STRING_MAX 64 #define GLAMOR_DELAYED_STRING_MAX 64
#define GLAMOR_DEBUG_NONE 0 #define GLAMOR_DEBUG_NONE 0
...@@ -51,9 +50,6 @@ AbortServer(void) ...@@ -51,9 +50,6 @@ AbortServer(void)
exit(1); \ exit(1); \
} while(0) } while(0)
#define __debug_output_message(_format_, _prefix_, ...) \ #define __debug_output_message(_format_, _prefix_, ...) \
LogMessageVerb(X_NONE, 0, \ LogMessageVerb(X_NONE, 0, \
"%32s:\t" _format_ , \ "%32s:\t" _format_ , \
...@@ -69,7 +65,6 @@ AbortServer(void) ...@@ -69,7 +65,6 @@ AbortServer(void)
##__VA_ARGS__); \ ##__VA_ARGS__); \
} while(0) } while(0)
#define glamor_fallback(_format_,...) \ #define glamor_fallback(_format_,...) \
do { \ do { \
if (glamor_debug_level >= GLAMOR_DEBUG_FALLBACK) \ if (glamor_debug_level >= GLAMOR_DEBUG_FALLBACK) \
...@@ -77,8 +72,6 @@ AbortServer(void) ...@@ -77,8 +72,6 @@ AbortServer(void)
"Glamor fallback", \ "Glamor fallback", \
##__VA_ARGS__);} while(0) ##__VA_ARGS__);} while(0)
#define glamor_delayed_fallback(_screen_, _format_,...) \ #define glamor_delayed_fallback(_screen_, _format_,...) \
do { \ do { \
if (glamor_debug_level >= GLAMOR_DEBUG_FALLBACK) { \ if (glamor_debug_level >= GLAMOR_DEBUG_FALLBACK) { \
...@@ -90,7 +83,6 @@ AbortServer(void) ...@@ -90,7 +83,6 @@ AbortServer(void)
"glamor delayed fallback: \t%s " _format_ , \ "glamor delayed fallback: \t%s " _format_ , \
__FUNCTION__, ##__VA_ARGS__); } } while(0) __FUNCTION__, ##__VA_ARGS__); } } while(0)
#define glamor_clear_delayed_fallbacks(_screen_) \ #define glamor_clear_delayed_fallbacks(_screen_) \
do { \ do { \
if (glamor_debug_level >= GLAMOR_DEBUG_FALLBACK) { \ if (glamor_debug_level >= GLAMOR_DEBUG_FALLBACK) { \
...@@ -112,5 +104,4 @@ AbortServer(void) ...@@ -112,5 +104,4 @@ AbortServer(void)
#define DEBUGRegionPrint(x) do {} while (0) #define DEBUGRegionPrint(x) do {} while (0)
//#define DEBUGRegionPrint RegionPrint //#define DEBUGRegionPrint RegionPrint
#endif #endif
This diff is collapsed.
...@@ -37,16 +37,16 @@ ...@@ -37,16 +37,16 @@
#include "glamor.h" #include "glamor.h"
static XF86ModuleVersionInfo VersRec = { static XF86ModuleVersionInfo VersRec = {
GLAMOR_EGL_MODULE_NAME, GLAMOR_EGL_MODULE_NAME,
MODULEVENDORSTRING, MODULEVENDORSTRING,
MODINFOSTRING1, MODINFOSTRING1,
MODINFOSTRING2, MODINFOSTRING2,
XORG_VERSION_CURRENT, XORG_VERSION_CURRENT,
PACKAGE_VERSION_MAJOR, PACKAGE_VERSION_MINOR, PACKAGE_VERSION_PATCHLEVEL, PACKAGE_VERSION_MAJOR, PACKAGE_VERSION_MINOR, PACKAGE_VERSION_PATCHLEVEL,
ABI_CLASS_ANSIC, /* Only need the ansic layer */ ABI_CLASS_ANSIC, /* Only need the ansic layer */
ABI_ANSIC_VERSION, ABI_ANSIC_VERSION,
MOD_CLASS_NONE, MOD_CLASS_NONE,
{0, 0, 0, 0} /* signature, to be patched into the file by a tool */ {0, 0, 0, 0} /* signature, to be patched into the file by a tool */
}; };
_X_EXPORT XF86ModuleData glamoreglModuleData = { &VersRec, NULL, NULL }; _X_EXPORT XF86ModuleData glamoreglModuleData = { &VersRec, NULL, NULL };
This diff is collapsed.
This diff is collapsed.
...@@ -28,86 +28,81 @@ ...@@ -28,86 +28,81 @@
static Bool static Bool
_glamor_fill_spans(DrawablePtr drawable, _glamor_fill_spans(DrawablePtr drawable,
GCPtr gc, GCPtr gc,
int n, DDXPointPtr points, int *widths, int sorted, Bool fallback) int n, DDXPointPtr points, int *widths, int sorted,
Bool fallback)
{ {
DDXPointPtr ppt; DDXPointPtr ppt;
int nbox; int nbox;
BoxPtr pbox; BoxPtr pbox;
int x1, x2, y; int x1, x2, y;
RegionPtr pClip = fbGetCompositeClip(gc); RegionPtr pClip = fbGetCompositeClip(gc);
Bool ret = FALSE; Bool ret = FALSE;
if (gc->fillStyle != FillSolid && gc->fillStyle != FillTiled) if (gc->fillStyle != FillSolid && gc->fillStyle != FillTiled)
goto fail; goto fail;
ppt = points; ppt = points;
while (n--) { while (n--) {
x1 = ppt->x; x1 = ppt->x;
y = ppt->y; y = ppt->y;
x2 = x1 + (int) *widths; x2 = x1 + (int) *widths;
ppt++; ppt++;
widths++; widths++;
nbox = REGION_NUM_RECTS(pClip); nbox = REGION_NUM_RECTS(pClip);
pbox = REGION_RECTS(pClip); pbox = REGION_RECTS(pClip);
while (nbox--) { while (nbox--) {
int real_x1 = x1, real_x2 = x2; int real_x1 = x1, real_x2 = x2;
if (real_x1 < pbox->x1) if (real_x1 < pbox->x1)
real_x1 = pbox->x1; real_x1 = pbox->x1;
if (real_x2 > pbox->x2) if (real_x2 > pbox->x2)
real_x2 = pbox->x2; real_x2 = pbox->x2;
if (real_x2 > real_x1 && pbox->y1 <= y && pbox->y2 > y) { if (real_x2 > real_x1 && pbox->y1 <= y && pbox->y2 > y) {
if (!glamor_fill(drawable, gc, real_x1, y, if (!glamor_fill(drawable, gc, real_x1, y,
real_x2 - real_x1, 1, fallback)) real_x2 - real_x1, 1, fallback))
goto fail; goto fail;
} }
pbox++; pbox++;
} }
} }
ret = TRUE; ret = TRUE;
goto done; goto done;
fail: fail:
if (!fallback if (!fallback && glamor_ddx_fallback_check_pixmap(drawable)
&& glamor_ddx_fallback_check_pixmap(drawable) && glamor_ddx_fallback_check_gc(gc)) {
&& glamor_ddx_fallback_check_gc(gc)) { goto done;
goto done; }
} glamor_fallback("to %p (%c)\n", drawable,
glamor_fallback("to %p (%c)\n", drawable, glamor_get_drawable_location(drawable));
glamor_get_drawable_location(drawable)); if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW)) {
if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW)) { if (glamor_prepare_access_gc(gc)) {
if (glamor_prepare_access_gc(gc)) { fbFillSpans(drawable, gc, n, points, widths, sorted);
fbFillSpans(drawable, gc, n, points, widths, glamor_finish_access_gc(gc);
sorted); }
glamor_finish_access_gc(gc); glamor_finish_access(drawable, GLAMOR_ACCESS_RW);
} }
glamor_finish_access(drawable, GLAMOR_ACCESS_RW); ret = TRUE;
}
ret = TRUE;
done: done:
return ret; return ret;
} }
void void
glamor_fill_spans(DrawablePtr drawable, glamor_fill_spans(DrawablePtr drawable,
GCPtr gc, GCPtr gc, int n, DDXPointPtr points, int *widths, int sorted)
int n, DDXPointPtr points, int *widths, int sorted)
{ {
_glamor_fill_spans(drawable, gc, n, points, widths, sorted, TRUE); _glamor_fill_spans(drawable, gc, n, points, widths, sorted, TRUE);
} }
Bool Bool
glamor_fill_spans_nf(DrawablePtr drawable, glamor_fill_spans_nf(DrawablePtr drawable,
GCPtr gc, GCPtr gc,
int n, DDXPointPtr points, int *widths, int sorted) int n, DDXPointPtr points, int *widths, int sorted)
{ {
return _glamor_fill_spans(drawable, gc, n, points, widths, sorted, FALSE); return _glamor_fill_spans(drawable, gc, n, points, widths, sorted, FALSE);
} }
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -26,7 +26,6 @@ ...@@ -26,7 +26,6 @@
* *
*/ */
#ifdef GLAMOR_GLES2 #ifdef GLAMOR_GLES2
#define GL_BGRA GL_BGRA_EXT #define GL_BGRA GL_BGRA_EXT
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment