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 @@
#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 @@
static Bool
_glamor_add_traps(PicturePtr pPicture,
INT16 x_off,
INT16 y_off, int ntrap, xTrap * traps,
Bool fallback)
INT16 x_off,
INT16 y_off, int ntrap, xTrap * traps, Bool fallback)
{
if (!fallback
&& ( !pPicture->pDrawable
|| glamor_ddx_fallback_check_pixmap(pPicture->pDrawable)))
return FALSE;
if (!fallback
&& (!pPicture->pDrawable
|| glamor_ddx_fallback_check_pixmap(pPicture->pDrawable)))
return FALSE;
if (glamor_prepare_access_picture(pPicture, GLAMOR_ACCESS_RW)) {
fbAddTraps(pPicture, x_off, y_off, ntrap, traps);
glamor_finish_access_picture(pPicture, GLAMOR_ACCESS_RW);
}
if (glamor_prepare_access_picture(pPicture, GLAMOR_ACCESS_RW)) {
fbAddTraps(pPicture, x_off, y_off, ntrap, traps);
glamor_finish_access_picture(pPicture, GLAMOR_ACCESS_RW);
}
return TRUE;
return TRUE;
}
void
glamor_add_traps(PicturePtr pPicture,
INT16 x_off,
INT16 y_off, int ntrap, xTrap * traps)
INT16 x_off, 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
glamor_add_traps_nf(PicturePtr pPicture,
INT16 x_off,
INT16 y_off, int ntrap, xTrap * traps)
INT16 x_off, 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 @@
static Bool
_glamor_copy_plane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
int srcx, int srcy, int w, int h, int dstx, int dsty,
unsigned long bitPlane, RegionPtr *pRegion, Bool fallback)
int srcx, int srcy, int w, int h, int dstx, int dsty,
unsigned long bitPlane, RegionPtr *pRegion, Bool fallback)
{
if (!fallback
&& glamor_ddx_fallback_check_gc(pGC)
&& glamor_ddx_fallback_check_pixmap(pSrc)
&& glamor_ddx_fallback_check_pixmap(pDst))
goto fail;
if (!fallback && glamor_ddx_fallback_check_gc(pGC)
&& glamor_ddx_fallback_check_pixmap(pSrc)
&& glamor_ddx_fallback_check_pixmap(pDst))
goto fail;
glamor_prepare_access(pDst, GLAMOR_ACCESS_RW);
glamor_prepare_access(pSrc, GLAMOR_ACCESS_RO);
*pRegion = fbCopyPlane(pSrc, pDst, pGC, srcx, srcy, w, h,
dstx, dsty, bitPlane);
glamor_finish_access(pSrc, GLAMOR_ACCESS_RO);
glamor_finish_access(pDst, GLAMOR_ACCESS_RW);
return TRUE;
glamor_prepare_access(pDst, GLAMOR_ACCESS_RW);
glamor_prepare_access(pSrc, GLAMOR_ACCESS_RO);
*pRegion = fbCopyPlane(pSrc, pDst, pGC, srcx, srcy, w, h,
dstx, dsty, bitPlane);
glamor_finish_access(pSrc, GLAMOR_ACCESS_RO);
glamor_finish_access(pDst, GLAMOR_ACCESS_RW);
return TRUE;
fail:
return FALSE;
return FALSE;
}
RegionPtr
glamor_copy_plane(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
int srcx, int srcy, int w, int h, int dstx, int dsty,
unsigned long bitPlane)
int srcx, int srcy, int w, int h, int dstx, int dsty,
unsigned long bitPlane)
{
RegionPtr ret;
_glamor_copy_plane(pSrc, pDst, pGC, srcx, srcy, w, h,
dstx, dsty, bitPlane, &ret, TRUE);
return ret;
RegionPtr ret;
_glamor_copy_plane(pSrc, pDst, pGC, srcx, srcy, w, h,
dstx, dsty, bitPlane, &ret, TRUE);
return ret;
}
Bool
glamor_copy_plane_nf(DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
int srcx, int srcy, int w, int h, int dstx, int dsty,
unsigned long bitPlane, RegionPtr *pRegion)
int srcx, int srcy, int w, int h, int dstx, int dsty,
unsigned long bitPlane, RegionPtr *pRegion)
{
return _glamor_copy_plane(pSrc, pDst, pGC, srcx, srcy, w, h,
dstx, dsty, bitPlane, pRegion, FALSE);
return _glamor_copy_plane(pSrc, pDst, pGC, srcx, srcy, w, h,
dstx, dsty, bitPlane, pRegion, FALSE);
}
......@@ -29,30 +29,28 @@
*/
void
glamor_copy_window(WindowPtr win, DDXPointRec old_origin,
RegionPtr src_region)
glamor_copy_window(WindowPtr win, DDXPointRec old_origin, RegionPtr src_region)
{
RegionRec dst_region;
int dx, dy;
PixmapPtr pixmap = win->drawable.pScreen->GetWindowPixmap(win);
RegionRec dst_region;
int dx, dy;
PixmapPtr pixmap = win->drawable.pScreen->GetWindowPixmap(win);
dx = old_origin.x - win->drawable.x;
dy = old_origin.y - win->drawable.y;
REGION_TRANSLATE(win->drawable.pScreen, src_region, -dx, -dy);
dx = old_origin.x - win->drawable.x;
dy = old_origin.y - win->drawable.y;
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,
&win->borderClip, src_region);
REGION_INTERSECT(win->drawable.pScreen, &dst_region,
&win->borderClip, src_region);
#ifdef COMPOSITE
if (pixmap->screen_x || pixmap->screen_y)
REGION_TRANSLATE(win->drawable.pScreen, &dst_region,
-pixmap->screen_x, -pixmap->screen_y);
if (pixmap->screen_x || pixmap->screen_y)
REGION_TRANSLATE(win->drawable.pScreen, &dst_region,
-pixmap->screen_x, -pixmap->screen_y);
#endif
miCopyRegion(&pixmap->drawable, &pixmap->drawable,
NULL, &dst_region, dx, dy, glamor_copy_n_to_n, 0,
NULL);
miCopyRegion(&pixmap->drawable, &pixmap->drawable,
NULL, &dst_region, dx, dy, glamor_copy_n_to_n, 0, NULL);
REGION_UNINIT(win->drawable.pScreen, &dst_region);
REGION_UNINIT(win->drawable.pScreen, &dst_region);
}
This diff is collapsed.
......@@ -29,7 +29,6 @@
#ifndef __GLAMOR_DEBUG_H__
#define __GLAMOR_DEBUG_H__
#define GLAMOR_DELAYED_STRING_MAX 64
#define GLAMOR_DEBUG_NONE 0
......@@ -51,9 +50,6 @@ AbortServer(void)
exit(1); \
} while(0)
#define __debug_output_message(_format_, _prefix_, ...) \
LogMessageVerb(X_NONE, 0, \
"%32s:\t" _format_ , \
......@@ -69,7 +65,6 @@ AbortServer(void)
##__VA_ARGS__); \
} while(0)
#define glamor_fallback(_format_,...) \
do { \
if (glamor_debug_level >= GLAMOR_DEBUG_FALLBACK) \
......@@ -77,8 +72,6 @@ AbortServer(void)
"Glamor fallback", \
##__VA_ARGS__);} while(0)
#define glamor_delayed_fallback(_screen_, _format_,...) \
do { \
if (glamor_debug_level >= GLAMOR_DEBUG_FALLBACK) { \
......@@ -90,7 +83,6 @@ AbortServer(void)
"glamor delayed fallback: \t%s " _format_ , \
__FUNCTION__, ##__VA_ARGS__); } } while(0)
#define glamor_clear_delayed_fallbacks(_screen_) \
do { \
if (glamor_debug_level >= GLAMOR_DEBUG_FALLBACK) { \
......@@ -112,5 +104,4 @@ AbortServer(void)
#define DEBUGRegionPrint(x) do {} while (0)
//#define DEBUGRegionPrint RegionPrint
#endif
This diff is collapsed.
......@@ -37,16 +37,16 @@
#include "glamor.h"
static XF86ModuleVersionInfo VersRec = {
GLAMOR_EGL_MODULE_NAME,
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
XORG_VERSION_CURRENT,
PACKAGE_VERSION_MAJOR, PACKAGE_VERSION_MINOR, PACKAGE_VERSION_PATCHLEVEL,
ABI_CLASS_ANSIC, /* Only need the ansic layer */
ABI_ANSIC_VERSION,
MOD_CLASS_NONE,
{0, 0, 0, 0} /* signature, to be patched into the file by a tool */
GLAMOR_EGL_MODULE_NAME,
MODULEVENDORSTRING,
MODINFOSTRING1,
MODINFOSTRING2,
XORG_VERSION_CURRENT,
PACKAGE_VERSION_MAJOR, PACKAGE_VERSION_MINOR, PACKAGE_VERSION_PATCHLEVEL,
ABI_CLASS_ANSIC, /* Only need the ansic layer */
ABI_ANSIC_VERSION,
MOD_CLASS_NONE,
{0, 0, 0, 0} /* signature, to be patched into the file by a tool */
};
_X_EXPORT XF86ModuleData glamoreglModuleData = { &VersRec, NULL, NULL };
This diff is collapsed.
This diff is collapsed.
......@@ -28,86 +28,81 @@
static Bool
_glamor_fill_spans(DrawablePtr drawable,
GCPtr gc,
int n, DDXPointPtr points, int *widths, int sorted, Bool fallback)
GCPtr gc,
int n, DDXPointPtr points, int *widths, int sorted,
Bool fallback)
{
DDXPointPtr ppt;
int nbox;
BoxPtr pbox;
int x1, x2, y;
RegionPtr pClip = fbGetCompositeClip(gc);
Bool ret = FALSE;
DDXPointPtr ppt;
int nbox;
BoxPtr pbox;
int x1, x2, y;
RegionPtr pClip = fbGetCompositeClip(gc);
Bool ret = FALSE;
if (gc->fillStyle != FillSolid && gc->fillStyle != FillTiled)
goto fail;
if (gc->fillStyle != FillSolid && gc->fillStyle != FillTiled)
goto fail;
ppt = points;
while (n--) {
x1 = ppt->x;
y = ppt->y;
x2 = x1 + (int) *widths;
ppt++;
widths++;
ppt = points;
while (n--) {
x1 = ppt->x;
y = ppt->y;
x2 = x1 + (int) *widths;
ppt++;
widths++;
nbox = REGION_NUM_RECTS(pClip);
pbox = REGION_RECTS(pClip);
while (nbox--) {
int real_x1 = x1, real_x2 = x2;
nbox = REGION_NUM_RECTS(pClip);
pbox = REGION_RECTS(pClip);
while (nbox--) {
int real_x1 = x1, real_x2 = x2;
if (real_x1 < pbox->x1)
real_x1 = pbox->x1;
if (real_x1 < pbox->x1)
real_x1 = pbox->x1;
if (real_x2 > pbox->x2)
real_x2 = pbox->x2;
if (real_x2 > pbox->x2)
real_x2 = pbox->x2;
if (real_x2 > real_x1 && pbox->y1 <= y && pbox->y2 > y) {
if (!glamor_fill(drawable, gc, real_x1, y,
real_x2 - real_x1, 1, fallback))
goto fail;
}
pbox++;
}
}
ret = TRUE;
goto done;
if (real_x2 > real_x1 && pbox->y1 <= y && pbox->y2 > y) {
if (!glamor_fill(drawable, gc, real_x1, y,
real_x2 - real_x1, 1, fallback))
goto fail;
}
pbox++;
}
}
ret = TRUE;
goto done;
fail:
if (!fallback
&& glamor_ddx_fallback_check_pixmap(drawable)
&& glamor_ddx_fallback_check_gc(gc)) {
goto done;
}
glamor_fallback("to %p (%c)\n", drawable,
glamor_get_drawable_location(drawable));
if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW)) {
if (glamor_prepare_access_gc(gc)) {
fbFillSpans(drawable, gc, n, points, widths,
sorted);
glamor_finish_access_gc(gc);
}
glamor_finish_access(drawable, GLAMOR_ACCESS_RW);
}
ret = TRUE;
fail:
if (!fallback && glamor_ddx_fallback_check_pixmap(drawable)
&& glamor_ddx_fallback_check_gc(gc)) {
goto done;
}
glamor_fallback("to %p (%c)\n", drawable,
glamor_get_drawable_location(drawable));
if (glamor_prepare_access(drawable, GLAMOR_ACCESS_RW)) {
if (glamor_prepare_access_gc(gc)) {
fbFillSpans(drawable, gc, n, points, widths, sorted);
glamor_finish_access_gc(gc);
}
glamor_finish_access(drawable, GLAMOR_ACCESS_RW);
}
ret = TRUE;
done:
return ret;
done:
return ret;
}
void
glamor_fill_spans(DrawablePtr drawable,
GCPtr gc,
int n, DDXPointPtr points, int *widths, int sorted)
GCPtr gc, 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
glamor_fill_spans_nf(DrawablePtr drawable,
GCPtr gc,
int n, DDXPointPtr points, int *widths, int sorted)
GCPtr gc,
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 @@
*
*/
#ifdef GLAMOR_GLES2
#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