2003-11-14 17:48:57 +01:00
|
|
|
/*
|
|
|
|
*
|
2004-12-04 01:43:13 +01:00
|
|
|
* Copyright © 2000 SuSE, Inc.
|
2003-11-14 17:48:57 +01:00
|
|
|
*
|
|
|
|
* Permission to use, copy, modify, distribute, and sell this software and its
|
|
|
|
* documentation for any purpose is hereby granted without fee, provided that
|
|
|
|
* the above copyright notice appear in all copies and that both that
|
|
|
|
* copyright notice and this permission notice appear in supporting
|
|
|
|
* documentation, and that the name of SuSE not be used in advertising or
|
|
|
|
* publicity pertaining to distribution of the software without specific,
|
|
|
|
* written prior permission. SuSE makes no representations about the
|
|
|
|
* suitability of this software for any purpose. It is provided "as is"
|
|
|
|
* without express or implied warranty.
|
|
|
|
*
|
|
|
|
* SuSE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL SuSE
|
|
|
|
* BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
|
|
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
|
2014-10-31 00:45:12 +01:00
|
|
|
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
|
2003-11-14 17:48:57 +01:00
|
|
|
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
|
|
*
|
|
|
|
* Author: Keith Packard, SuSE, Inc.
|
|
|
|
*/
|
|
|
|
|
2005-07-03 09:02:09 +02:00
|
|
|
#ifdef HAVE_DIX_CONFIG_H
|
|
|
|
#include <dix-config.h>
|
|
|
|
#endif
|
|
|
|
|
2005-07-03 10:53:54 +02:00
|
|
|
#include "misc.h"
|
2003-11-14 17:48:57 +01:00
|
|
|
#include "scrnintstr.h"
|
2005-07-03 10:53:54 +02:00
|
|
|
#include "os.h"
|
2003-11-14 17:48:57 +01:00
|
|
|
#include "regionstr.h"
|
|
|
|
#include "validate.h"
|
|
|
|
#include "windowstr.h"
|
|
|
|
#include "input.h"
|
|
|
|
#include "resource.h"
|
|
|
|
#include "colormapst.h"
|
|
|
|
#include "cursorstr.h"
|
|
|
|
#include "dixstruct.h"
|
|
|
|
#include "gcstruct.h"
|
|
|
|
#include "servermd.h"
|
|
|
|
#include "picturestr.h"
|
2007-08-31 15:55:27 +02:00
|
|
|
#include "xace.h"
|
2014-11-17 21:28:58 +01:00
|
|
|
#ifdef PANORAMIX
|
|
|
|
#include "panoramiXsrv.h"
|
|
|
|
#endif
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2010-04-27 02:22:21 +02:00
|
|
|
DevPrivateKeyRec PictureScreenPrivateKeyRec;
|
|
|
|
DevPrivateKeyRec PictureWindowPrivateKeyRec;
|
2012-03-21 20:55:09 +01:00
|
|
|
static int PictureGeneration;
|
|
|
|
RESTYPE PictureType;
|
|
|
|
RESTYPE PictFormatType;
|
|
|
|
RESTYPE GlyphSetType;
|
|
|
|
int PictureCmapPolicy = PictureCmapPolicyDefault;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-06-27 15:36:04 +02:00
|
|
|
PictFormatPtr
|
|
|
|
PictureWindowFormat(WindowPtr pWindow)
|
|
|
|
{
|
|
|
|
ScreenPtr pScreen = pWindow->drawable.pScreen;
|
|
|
|
return PictureMatchVisual(pScreen, pWindow->drawable.depth,
|
|
|
|
WindowGetVisual(pWindow));
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
PictureDestroyWindow(WindowPtr pWindow)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
ScreenPtr pScreen = pWindow->drawable.pScreen;
|
|
|
|
PicturePtr pPicture;
|
|
|
|
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
|
|
|
Bool ret;
|
|
|
|
|
|
|
|
while ((pPicture = GetPictureWindow(pWindow))) {
|
|
|
|
SetPictureWindow(pWindow, pPicture->pNext);
|
|
|
|
if (pPicture->id)
|
|
|
|
FreeResource(pPicture->id, PictureType);
|
2013-12-15 10:05:51 +01:00
|
|
|
FreePicture((void *) pPicture, pPicture->id);
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
pScreen->DestroyWindow = ps->DestroyWindow;
|
|
|
|
ret = (*pScreen->DestroyWindow) (pWindow);
|
|
|
|
ps->DestroyWindow = pScreen->DestroyWindow;
|
|
|
|
pScreen->DestroyWindow = PictureDestroyWindow;
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
Bool
|
api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.
Its been squashed to make bisection easier.
Full patch log below:
commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Mon May 14 15:16:11 2012 -0700
xfree86: Bump video ABI to 13.0
The ABI was broken by changes to convert from screen index numbers to ScreenPtr
/ ScrnInfoPtr in various structures and function signatures.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 10:56:57 2012 +0100
xf86: xf86ClearEntityListForScreen should take a pScrn
When adding GPU screens this make life easier.
(also fix comment, as pointed out by Alan)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 07:07:32 2012 +0100
xf86i2c: add pscrn for drivers to use
This just adds a pScrn pointer into the struct for the drivers to use
instead of scrnIndex. Mostly scrnIndex is used for logging, but some
drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
Removing the scrnIndex is a bit more involved and I'm not sure its worth
the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 19:25:20 2012 +0100
dix/gc: consolidate GC object creation in one place
The standard GC create and scratch GC create were 90% the same really,
and I have a need in the future for creating GC objects without the
other bits, so wanted to avoid a third copy.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 10:24:06 2012 +0100
xf86: add a define to denote the new non-index interfaces are being used
This can be used by drivers to provide compatible APIs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 15:09:12 2012 +0100
dix: make Create/Free scratch pixmaps take a ScreenPtr
While technically an API/ABI change I doubt anyone uses it,
but it helps in splitting screens up.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:57:55 2012 +0100
xf86/xv: remove scrnIndexfrom xf86FindXvOptions.
Move this interface to taking an ScrnInfoPtr.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:53:59 2012 +0100
xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)
stop passing indices into this function.
v2: drop flags argument.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:48:09 2012 +0100
xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:18:59 2012 +0100
xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)
Instead of passing an index, pass the actual ScreenPtr. This allows
more moving towards not abusing xf86Screens + screenInfo.
v2: drop the blockData/wakeupData args as per ajax's suggestion.,
fix docs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date: Wed Apr 11 09:53:14 2012 +0100
xf86/common: remove some more pScrn->pScreen uses
remove some more conversions that appeared after api cleanups.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:34:53 2012 +0100
ddc: change API to take ScrnInfoPtr (v2)
This removes all xf86Screens usage from ddc code,
it modifies the API for some functions to avoid taking indices.
v2: address Alan's comments about dropping DDC2Init parameter.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:31:26 2012 +0100
vbe: don't use index for VBEInterpretPanelID (API)
Remove use of xf86screens from vbe module.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:25:11 2012 +0100
int10/vbe: don't use xf86Screens. (ABI) (v3)
Pass the ScrnInfoPtr instead of the index in the int10 struct.
This saves us using it to dereference xf86Screens.
v2: address Alan's comment to fix struct alignment.
v3: squash in all the int10 fixes, test the vm86 code builds,
after comments by Keith.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:30:18 2012 +0100
xserver: drop index argument to ScreenInit (ABI/API) (v2)
This drops the index argument, its the same as pScreen->myNum,
and its the last major index abuse I can find.
v2: address Alan's review - update docs, fix xwin/xnest/darwin
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:23:01 2012 +0100
xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)
This migrates PointerMoved from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:20:46 2012 +0100
xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)
This migrates the PMEvent from index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:18:30 2012 +0100
xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)
This migrates the SetDGAMode callback from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:14:11 2012 +0100
xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)
This migrates the ChangeGamma interface to avoid passing a index.
v2: fix xf86RandR12.c + xf86cmap.c call
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:11:09 2012 +0100
xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)
The EXA interface migrates to ScreenPtr,
and the xf86 interface migrated to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:02:11 2012 +0100
xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:59:46 2012 +0100
xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)
This migrate the SwitchMode interface to take a ScrnInfoPtr
instead of an index.
v2: drop flags.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:50:37 2012 +0100
xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)
This converts AdjustFrame code paths to passing a ScrnInfoPtr
instead of an integer index.
v2: drop flags args.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:41:27 2012 +0100
xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)
Another index->pScrn conversion.
v2: drop flags arg.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:35:41 2012 +0100
xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)
This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
instead of an index into xf86Screens. This allows dropping more
public dereferences of the xf86Screens and screenInfo.
v2: drop flags args as suggested by Keith, fix docs.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:04:59 2012 +0100
xserver: remove index from CloseScreen (API/ABI breakage)
This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:22:18 +02:00
|
|
|
PictureCloseScreen(ScreenPtr pScreen)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
|
|
|
Bool ret;
|
|
|
|
int n;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
pScreen->CloseScreen = ps->CloseScreen;
|
api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.
Its been squashed to make bisection easier.
Full patch log below:
commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date: Mon May 14 15:16:11 2012 -0700
xfree86: Bump video ABI to 13.0
The ABI was broken by changes to convert from screen index numbers to ScreenPtr
/ ScrnInfoPtr in various structures and function signatures.
Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 10:56:57 2012 +0100
xf86: xf86ClearEntityListForScreen should take a pScrn
When adding GPU screens this make life easier.
(also fix comment, as pointed out by Alan)
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date: Thu May 24 07:07:32 2012 +0100
xf86i2c: add pscrn for drivers to use
This just adds a pScrn pointer into the struct for the drivers to use
instead of scrnIndex. Mostly scrnIndex is used for logging, but some
drivers use it to lookup xf86Screens, so let them stash a pScrn instead.
Removing the scrnIndex is a bit more involved and I'm not sure its worth
the effort. Doing i2c in the X server is legacy code as far as I'm concerned.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 19:25:20 2012 +0100
dix/gc: consolidate GC object creation in one place
The standard GC create and scratch GC create were 90% the same really,
and I have a need in the future for creating GC objects without the
other bits, so wanted to avoid a third copy.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 10:24:06 2012 +0100
xf86: add a define to denote the new non-index interfaces are being used
This can be used by drivers to provide compatible APIs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 15:09:12 2012 +0100
dix: make Create/Free scratch pixmaps take a ScreenPtr
While technically an API/ABI change I doubt anyone uses it,
but it helps in splitting screens up.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:57:55 2012 +0100
xf86/xv: remove scrnIndexfrom xf86FindXvOptions.
Move this interface to taking an ScrnInfoPtr.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:53:59 2012 +0100
xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)
stop passing indices into this function.
v2: drop flags argument.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date: Wed May 23 14:48:09 2012 +0100
xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:18:59 2012 +0100
xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)
Instead of passing an index, pass the actual ScreenPtr. This allows
more moving towards not abusing xf86Screens + screenInfo.
v2: drop the blockData/wakeupData args as per ajax's suggestion.,
fix docs.
Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date: Wed Apr 11 09:53:14 2012 +0100
xf86/common: remove some more pScrn->pScreen uses
remove some more conversions that appeared after api cleanups.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:34:53 2012 +0100
ddc: change API to take ScrnInfoPtr (v2)
This removes all xf86Screens usage from ddc code,
it modifies the API for some functions to avoid taking indices.
v2: address Alan's comments about dropping DDC2Init parameter.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:31:26 2012 +0100
vbe: don't use index for VBEInterpretPanelID (API)
Remove use of xf86screens from vbe module.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 16:25:11 2012 +0100
int10/vbe: don't use xf86Screens. (ABI) (v3)
Pass the ScrnInfoPtr instead of the index in the int10 struct.
This saves us using it to dereference xf86Screens.
v2: address Alan's comment to fix struct alignment.
v3: squash in all the int10 fixes, test the vm86 code builds,
after comments by Keith.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:30:18 2012 +0100
xserver: drop index argument to ScreenInit (ABI/API) (v2)
This drops the index argument, its the same as pScreen->myNum,
and its the last major index abuse I can find.
v2: address Alan's review - update docs, fix xwin/xnest/darwin
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:23:01 2012 +0100
xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)
This migrates PointerMoved from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:20:46 2012 +0100
xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)
This migrates the PMEvent from index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:18:30 2012 +0100
xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)
This migrates the SetDGAMode callback from an index to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:14:11 2012 +0100
xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)
This migrates the ChangeGamma interface to avoid passing a index.
v2: fix xf86RandR12.c + xf86cmap.c call
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:11:09 2012 +0100
xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)
The EXA interface migrates to ScreenPtr,
and the xf86 interface migrated to ScrnInfoPtr.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 15:02:11 2012 +0100
xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)
This migrates the ValidMode to passing a ScrnInfoPtr instead
of an index.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:59:46 2012 +0100
xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)
This migrate the SwitchMode interface to take a ScrnInfoPtr
instead of an index.
v2: drop flags.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:50:37 2012 +0100
xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)
This converts AdjustFrame code paths to passing a ScrnInfoPtr
instead of an integer index.
v2: drop flags args.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:41:27 2012 +0100
xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)
Another index->pScrn conversion.
v2: drop flags arg.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:35:41 2012 +0100
xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)
This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
instead of an index into xf86Screens. This allows dropping more
public dereferences of the xf86Screens and screenInfo.
v2: drop flags args as suggested by Keith, fix docs.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date: Tue Apr 10 14:04:59 2012 +0100
xserver: remove index from CloseScreen (API/ABI breakage)
This drops the index from the CloseScreen callback,
its always been useless really, since the pScreen contains it.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Acked-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 14:22:18 +02:00
|
|
|
ret = (*pScreen->CloseScreen) (pScreen);
|
2012-03-21 20:55:09 +01:00
|
|
|
PictureResetFilters(pScreen);
|
2003-11-14 17:48:57 +01:00
|
|
|
for (n = 0; n < ps->nformats; n++)
|
2012-03-21 20:55:09 +01:00
|
|
|
if (ps->formats[n].type == PictTypeIndexed)
|
|
|
|
(*ps->CloseIndexed) (pScreen, &ps->formats[n]);
|
|
|
|
GlyphUninit(pScreen);
|
2003-11-14 17:48:57 +01:00
|
|
|
SetPictureScreen(pScreen, 0);
|
2010-05-05 20:44:06 +02:00
|
|
|
free(ps->formats);
|
|
|
|
free(ps);
|
2003-11-14 17:48:57 +01:00
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2012-03-21 20:55:09 +01:00
|
|
|
PictureStoreColors(ColormapPtr pColormap, int ndef, xColorItem * pdef)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
ScreenPtr pScreen = pColormap->pScreen;
|
|
|
|
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
pScreen->StoreColors = ps->StoreColors;
|
|
|
|
(*pScreen->StoreColors) (pColormap, ndef, pdef);
|
|
|
|
ps->StoreColors = pScreen->StoreColors;
|
|
|
|
pScreen->StoreColors = PictureStoreColors;
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (pColormap->class == PseudoColor || pColormap->class == GrayScale) {
|
|
|
|
PictFormatPtr format = ps->formats;
|
|
|
|
int nformats = ps->nformats;
|
|
|
|
|
|
|
|
while (nformats--) {
|
|
|
|
if (format->type == PictTypeIndexed &&
|
|
|
|
format->index.pColormap == pColormap) {
|
|
|
|
(*ps->UpdateIndexed) (pScreen, format, ndef, pdef);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
format++;
|
|
|
|
}
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2012-03-21 20:55:09 +01:00
|
|
|
visualDepth(ScreenPtr pScreen, VisualPtr pVisual)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
int d, v;
|
|
|
|
DepthPtr pDepth;
|
|
|
|
|
|
|
|
for (d = 0; d < pScreen->numDepths; d++) {
|
|
|
|
pDepth = &pScreen->allowedDepths[d];
|
|
|
|
for (v = 0; v < pDepth->numVids; v++)
|
|
|
|
if (pDepth->vids[v] == pVisual->vid)
|
|
|
|
return pDepth->depth;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
typedef struct _formatInit {
|
2012-03-21 20:55:09 +01:00
|
|
|
CARD32 format;
|
|
|
|
CARD8 depth;
|
2003-11-14 17:48:57 +01:00
|
|
|
} FormatInitRec, *FormatInitPtr;
|
|
|
|
|
|
|
|
static int
|
2012-03-21 20:55:09 +01:00
|
|
|
addFormat(FormatInitRec formats[256], int nformat, CARD32 format, CARD8 depth)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
int n;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
for (n = 0; n < nformat; n++)
|
2012-03-21 20:55:09 +01:00
|
|
|
if (formats[n].format == format && formats[n].depth == depth)
|
|
|
|
return nformat;
|
2003-11-14 17:48:57 +01:00
|
|
|
formats[nformat].format = format;
|
|
|
|
formats[nformat].depth = depth;
|
|
|
|
return ++nformat;
|
|
|
|
}
|
|
|
|
|
2011-04-24 05:55:53 +02:00
|
|
|
#define Mask(n) ((1 << (n)) - 1)
|
2003-11-14 17:48:57 +01:00
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
PictFormatPtr
|
2012-03-21 20:55:09 +01:00
|
|
|
PictureCreateDefaultFormats(ScreenPtr pScreen, int *nformatp)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
int nformats, f;
|
|
|
|
PictFormatPtr pFormats;
|
|
|
|
FormatInitRec formats[1024];
|
|
|
|
CARD32 format;
|
|
|
|
CARD8 depth;
|
|
|
|
VisualPtr pVisual;
|
|
|
|
int v;
|
|
|
|
int bpp;
|
|
|
|
int type;
|
|
|
|
int r, g, b;
|
|
|
|
int d;
|
|
|
|
DepthPtr pDepth;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
nformats = 0;
|
|
|
|
/* formats required by protocol */
|
|
|
|
formats[nformats].format = PICT_a1;
|
|
|
|
formats[nformats].depth = 1;
|
|
|
|
nformats++;
|
2006-04-19 23:56:13 +02:00
|
|
|
formats[nformats].format = PICT_FORMAT(BitsPerPixel(8),
|
2012-03-21 20:55:09 +01:00
|
|
|
PICT_TYPE_A, 8, 0, 0, 0);
|
2003-11-14 17:48:57 +01:00
|
|
|
formats[nformats].depth = 8;
|
|
|
|
nformats++;
|
2006-04-19 23:56:13 +02:00
|
|
|
formats[nformats].format = PICT_FORMAT(BitsPerPixel(4),
|
2012-03-21 20:55:09 +01:00
|
|
|
PICT_TYPE_A, 4, 0, 0, 0);
|
2003-11-14 17:48:57 +01:00
|
|
|
formats[nformats].depth = 4;
|
|
|
|
nformats++;
|
|
|
|
formats[nformats].format = PICT_a8r8g8b8;
|
|
|
|
formats[nformats].depth = 32;
|
|
|
|
nformats++;
|
|
|
|
formats[nformats].format = PICT_x8r8g8b8;
|
|
|
|
formats[nformats].depth = 32;
|
|
|
|
nformats++;
|
2009-08-04 23:23:21 +02:00
|
|
|
formats[nformats].format = PICT_b8g8r8a8;
|
|
|
|
formats[nformats].depth = 32;
|
|
|
|
nformats++;
|
|
|
|
formats[nformats].format = PICT_b8g8r8x8;
|
|
|
|
formats[nformats].depth = 32;
|
|
|
|
nformats++;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
/* now look through the depths and visuals adding other formats */
|
2012-03-21 20:55:09 +01:00
|
|
|
for (v = 0; v < pScreen->numVisuals; v++) {
|
|
|
|
pVisual = &pScreen->visuals[v];
|
|
|
|
depth = visualDepth(pScreen, pVisual);
|
|
|
|
if (!depth)
|
|
|
|
continue;
|
|
|
|
bpp = BitsPerPixel(depth);
|
|
|
|
switch (pVisual->class) {
|
|
|
|
case DirectColor:
|
|
|
|
case TrueColor:
|
|
|
|
r = Ones(pVisual->redMask);
|
|
|
|
g = Ones(pVisual->greenMask);
|
|
|
|
b = Ones(pVisual->blueMask);
|
|
|
|
type = PICT_TYPE_OTHER;
|
|
|
|
/*
|
|
|
|
* Current rendering code supports only three direct formats,
|
|
|
|
* fields must be packed together at the bottom of the pixel
|
|
|
|
*/
|
|
|
|
if (pVisual->offsetBlue == 0 &&
|
|
|
|
pVisual->offsetGreen == b && pVisual->offsetRed == b + g) {
|
|
|
|
type = PICT_TYPE_ARGB;
|
|
|
|
}
|
|
|
|
else if (pVisual->offsetRed == 0 &&
|
|
|
|
pVisual->offsetGreen == r &&
|
|
|
|
pVisual->offsetBlue == r + g) {
|
|
|
|
type = PICT_TYPE_ABGR;
|
|
|
|
}
|
|
|
|
else if (pVisual->offsetRed == pVisual->offsetGreen - r &&
|
|
|
|
pVisual->offsetGreen == pVisual->offsetBlue - g &&
|
|
|
|
pVisual->offsetBlue == bpp - b) {
|
|
|
|
type = PICT_TYPE_BGRA;
|
|
|
|
}
|
|
|
|
if (type != PICT_TYPE_OTHER) {
|
|
|
|
format = PICT_FORMAT(bpp, type, 0, r, g, b);
|
|
|
|
nformats = addFormat(formats, nformats, format, depth);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case StaticColor:
|
|
|
|
case PseudoColor:
|
|
|
|
format = PICT_VISFORMAT(bpp, PICT_TYPE_COLOR, v);
|
|
|
|
nformats = addFormat(formats, nformats, format, depth);
|
|
|
|
break;
|
|
|
|
case StaticGray:
|
|
|
|
case GrayScale:
|
|
|
|
format = PICT_VISFORMAT(bpp, PICT_TYPE_GRAY, v);
|
|
|
|
nformats = addFormat(formats, nformats, format, depth);
|
|
|
|
break;
|
|
|
|
}
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
/*
|
|
|
|
* Walk supported depths and add useful Direct formats
|
|
|
|
*/
|
2012-03-21 20:55:09 +01:00
|
|
|
for (d = 0; d < pScreen->numDepths; d++) {
|
|
|
|
pDepth = &pScreen->allowedDepths[d];
|
|
|
|
bpp = BitsPerPixel(pDepth->depth);
|
|
|
|
format = 0;
|
|
|
|
switch (bpp) {
|
|
|
|
case 16:
|
|
|
|
/* depth 12 formats */
|
|
|
|
if (pDepth->depth >= 12) {
|
|
|
|
nformats = addFormat(formats, nformats,
|
|
|
|
PICT_x4r4g4b4, pDepth->depth);
|
|
|
|
nformats = addFormat(formats, nformats,
|
|
|
|
PICT_x4b4g4r4, pDepth->depth);
|
|
|
|
}
|
|
|
|
/* depth 15 formats */
|
|
|
|
if (pDepth->depth >= 15) {
|
|
|
|
nformats = addFormat(formats, nformats,
|
|
|
|
PICT_x1r5g5b5, pDepth->depth);
|
|
|
|
nformats = addFormat(formats, nformats,
|
|
|
|
PICT_x1b5g5r5, pDepth->depth);
|
|
|
|
}
|
|
|
|
/* depth 16 formats */
|
|
|
|
if (pDepth->depth >= 16) {
|
|
|
|
nformats = addFormat(formats, nformats,
|
|
|
|
PICT_a1r5g5b5, pDepth->depth);
|
|
|
|
nformats = addFormat(formats, nformats,
|
|
|
|
PICT_a1b5g5r5, pDepth->depth);
|
|
|
|
nformats = addFormat(formats, nformats,
|
|
|
|
PICT_r5g6b5, pDepth->depth);
|
|
|
|
nformats = addFormat(formats, nformats,
|
|
|
|
PICT_b5g6r5, pDepth->depth);
|
|
|
|
nformats = addFormat(formats, nformats,
|
|
|
|
PICT_a4r4g4b4, pDepth->depth);
|
|
|
|
nformats = addFormat(formats, nformats,
|
|
|
|
PICT_a4b4g4r4, pDepth->depth);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 24:
|
|
|
|
if (pDepth->depth >= 24) {
|
|
|
|
nformats = addFormat(formats, nformats,
|
|
|
|
PICT_r8g8b8, pDepth->depth);
|
|
|
|
nformats = addFormat(formats, nformats,
|
|
|
|
PICT_b8g8r8, pDepth->depth);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 32:
|
|
|
|
if (pDepth->depth >= 24) {
|
|
|
|
nformats = addFormat(formats, nformats,
|
|
|
|
PICT_x8r8g8b8, pDepth->depth);
|
|
|
|
nformats = addFormat(formats, nformats,
|
|
|
|
PICT_x8b8g8r8, pDepth->depth);
|
|
|
|
}
|
|
|
|
if (pDepth->depth >= 30) {
|
|
|
|
nformats = addFormat(formats, nformats,
|
|
|
|
PICT_a2r10g10b10, pDepth->depth);
|
|
|
|
nformats = addFormat(formats, nformats,
|
|
|
|
PICT_x2r10g10b10, pDepth->depth);
|
|
|
|
nformats = addFormat(formats, nformats,
|
|
|
|
PICT_a2b10g10r10, pDepth->depth);
|
|
|
|
nformats = addFormat(formats, nformats,
|
|
|
|
PICT_x2b10g10r10, pDepth->depth);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
pFormats = calloc(nformats, sizeof(PictFormatRec));
|
2003-11-14 17:48:57 +01:00
|
|
|
if (!pFormats)
|
2012-03-21 20:55:09 +01:00
|
|
|
return 0;
|
|
|
|
for (f = 0; f < nformats; f++) {
|
|
|
|
pFormats[f].id = FakeClientID(0);
|
|
|
|
pFormats[f].depth = formats[f].depth;
|
|
|
|
format = formats[f].format;
|
|
|
|
pFormats[f].format = format;
|
|
|
|
switch (PICT_FORMAT_TYPE(format)) {
|
|
|
|
case PICT_TYPE_ARGB:
|
|
|
|
pFormats[f].type = PictTypeDirect;
|
|
|
|
|
|
|
|
pFormats[f].direct.alphaMask = Mask (PICT_FORMAT_A(format));
|
|
|
|
|
|
|
|
if (pFormats[f].direct.alphaMask)
|
|
|
|
pFormats[f].direct.alpha = (PICT_FORMAT_R(format) +
|
|
|
|
PICT_FORMAT_G(format) +
|
|
|
|
PICT_FORMAT_B(format));
|
|
|
|
|
|
|
|
pFormats[f].direct.redMask = Mask (PICT_FORMAT_R(format));
|
|
|
|
|
|
|
|
pFormats[f].direct.red = (PICT_FORMAT_G(format) +
|
|
|
|
PICT_FORMAT_B(format));
|
|
|
|
|
|
|
|
pFormats[f].direct.greenMask = Mask (PICT_FORMAT_G(format));
|
|
|
|
|
|
|
|
pFormats[f].direct.green = PICT_FORMAT_B(format);
|
|
|
|
|
|
|
|
pFormats[f].direct.blueMask = Mask (PICT_FORMAT_B(format));
|
|
|
|
|
|
|
|
pFormats[f].direct.blue = 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PICT_TYPE_ABGR:
|
|
|
|
pFormats[f].type = PictTypeDirect;
|
|
|
|
|
|
|
|
pFormats[f].direct.alphaMask = Mask (PICT_FORMAT_A(format));
|
|
|
|
|
|
|
|
if (pFormats[f].direct.alphaMask)
|
|
|
|
pFormats[f].direct.alpha = (PICT_FORMAT_B(format) +
|
|
|
|
PICT_FORMAT_G(format) +
|
|
|
|
PICT_FORMAT_R(format));
|
|
|
|
|
|
|
|
pFormats[f].direct.blueMask = Mask (PICT_FORMAT_B(format));
|
|
|
|
|
|
|
|
pFormats[f].direct.blue = (PICT_FORMAT_G(format) +
|
|
|
|
PICT_FORMAT_R(format));
|
|
|
|
|
|
|
|
pFormats[f].direct.greenMask = Mask (PICT_FORMAT_G(format));
|
|
|
|
|
|
|
|
pFormats[f].direct.green = PICT_FORMAT_R(format);
|
|
|
|
|
|
|
|
pFormats[f].direct.redMask = Mask (PICT_FORMAT_R(format));
|
|
|
|
|
|
|
|
pFormats[f].direct.red = 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PICT_TYPE_BGRA:
|
|
|
|
pFormats[f].type = PictTypeDirect;
|
|
|
|
|
|
|
|
pFormats[f].direct.blueMask = Mask (PICT_FORMAT_B(format));
|
|
|
|
|
|
|
|
pFormats[f].direct.blue =
|
|
|
|
(PICT_FORMAT_BPP(format) - PICT_FORMAT_B(format));
|
|
|
|
|
|
|
|
pFormats[f].direct.greenMask = Mask (PICT_FORMAT_G(format));
|
|
|
|
|
|
|
|
pFormats[f].direct.green =
|
|
|
|
(PICT_FORMAT_BPP(format) - PICT_FORMAT_B(format) -
|
|
|
|
PICT_FORMAT_G(format));
|
|
|
|
|
|
|
|
pFormats[f].direct.redMask = Mask (PICT_FORMAT_R(format));
|
|
|
|
|
|
|
|
pFormats[f].direct.red =
|
|
|
|
(PICT_FORMAT_BPP(format) - PICT_FORMAT_B(format) -
|
|
|
|
PICT_FORMAT_G(format) - PICT_FORMAT_R(format));
|
|
|
|
|
|
|
|
pFormats[f].direct.alphaMask = Mask (PICT_FORMAT_A(format));
|
|
|
|
|
|
|
|
pFormats[f].direct.alpha = 0;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PICT_TYPE_A:
|
|
|
|
pFormats[f].type = PictTypeDirect;
|
|
|
|
|
|
|
|
pFormats[f].direct.alpha = 0;
|
|
|
|
pFormats[f].direct.alphaMask = Mask (PICT_FORMAT_A(format));
|
|
|
|
|
|
|
|
/* remaining fields already set to zero */
|
|
|
|
break;
|
|
|
|
|
|
|
|
case PICT_TYPE_COLOR:
|
|
|
|
case PICT_TYPE_GRAY:
|
|
|
|
pFormats[f].type = PictTypeIndexed;
|
|
|
|
pFormats[f].index.vid =
|
|
|
|
pScreen->visuals[PICT_FORMAT_VIS(format)].vid;
|
|
|
|
break;
|
|
|
|
}
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
*nformatp = nformats;
|
|
|
|
return pFormats;
|
|
|
|
}
|
|
|
|
|
2004-07-29 20:37:54 +02:00
|
|
|
static VisualPtr
|
2012-03-21 20:55:09 +01:00
|
|
|
PictureFindVisual(ScreenPtr pScreen, VisualID visual)
|
2004-07-29 20:37:54 +02:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
int i;
|
|
|
|
VisualPtr pVisual;
|
|
|
|
|
2004-07-29 20:37:54 +02:00
|
|
|
for (i = 0, pVisual = pScreen->visuals;
|
2012-03-21 20:55:09 +01:00
|
|
|
i < pScreen->numVisuals; i++, pVisual++) {
|
2004-07-29 20:37:54 +02:00
|
|
|
if (pVisual->vid == visual)
|
|
|
|
return pVisual;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
Bool
|
2007-07-29 20:16:10 +02:00
|
|
|
PictureInitIndexedFormat(ScreenPtr pScreen, PictFormatPtr format)
|
|
|
|
{
|
|
|
|
PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
|
|
|
|
|
|
|
|
if (format->type != PictTypeIndexed || format->index.pColormap)
|
2012-03-21 20:55:09 +01:00
|
|
|
return TRUE;
|
2007-07-29 20:16:10 +02:00
|
|
|
|
|
|
|
if (format->index.vid == pScreen->rootVisual) {
|
2013-12-15 10:05:51 +01:00
|
|
|
dixLookupResourceByType((void **) &format->index.pColormap,
|
2012-03-21 20:55:09 +01:00
|
|
|
pScreen->defColormap, RT_COLORMAP,
|
|
|
|
serverClient, DixGetAttrAccess);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
VisualPtr pVisual = PictureFindVisual(pScreen, format->index.vid);
|
|
|
|
|
|
|
|
if (CreateColormap(FakeClientID(0), pScreen, pVisual,
|
|
|
|
&format->index.pColormap, AllocNone, 0)
|
|
|
|
!= Success)
|
|
|
|
return FALSE;
|
2007-07-29 20:16:10 +02:00
|
|
|
}
|
|
|
|
if (!ps->InitIndexed(pScreen, format))
|
2012-03-21 20:55:09 +01:00
|
|
|
return FALSE;
|
2007-07-29 20:16:10 +02:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
PictureInitIndexedFormats(ScreenPtr pScreen)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
|
|
|
|
PictFormatPtr format;
|
|
|
|
int nformat;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
if (!ps)
|
2012-03-21 20:55:09 +01:00
|
|
|
return FALSE;
|
2003-11-14 17:48:57 +01:00
|
|
|
format = ps->formats;
|
|
|
|
nformat = ps->nformats;
|
|
|
|
while (nformat--)
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!PictureInitIndexedFormat(pScreen, format++))
|
|
|
|
return FALSE;
|
2003-11-14 17:48:57 +01:00
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
PictureFinishInit(void)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
int s;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
for (s = 0; s < screenInfo.numScreens; s++) {
|
|
|
|
if (!PictureInitIndexedFormats(screenInfo.screens[s]))
|
|
|
|
return FALSE;
|
|
|
|
(void) AnimCurInit(screenInfo.screens[s]);
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
PictureSetSubpixelOrder(ScreenPtr pScreen, int subpixel)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
if (!ps)
|
2012-03-21 20:55:09 +01:00
|
|
|
return FALSE;
|
2003-11-14 17:48:57 +01:00
|
|
|
ps->subpixel = subpixel;
|
|
|
|
return TRUE;
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2012-03-21 20:55:09 +01:00
|
|
|
PictureGetSubpixelOrder(ScreenPtr pScreen)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
if (!ps)
|
2012-03-21 20:55:09 +01:00
|
|
|
return SubPixelUnknown;
|
2003-11-14 17:48:57 +01:00
|
|
|
return ps->subpixel;
|
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
PictFormatPtr
|
2012-03-21 20:55:09 +01:00
|
|
|
PictureMatchVisual(ScreenPtr pScreen, int depth, VisualPtr pVisual)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
|
|
|
|
PictFormatPtr format;
|
|
|
|
int nformat;
|
|
|
|
int type;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
if (!ps)
|
2012-03-21 20:55:09 +01:00
|
|
|
return 0;
|
2003-11-14 17:48:57 +01:00
|
|
|
format = ps->formats;
|
|
|
|
nformat = ps->nformats;
|
|
|
|
switch (pVisual->class) {
|
|
|
|
case StaticGray:
|
|
|
|
case GrayScale:
|
|
|
|
case StaticColor:
|
|
|
|
case PseudoColor:
|
2012-03-21 20:55:09 +01:00
|
|
|
type = PictTypeIndexed;
|
|
|
|
break;
|
2003-11-14 17:48:57 +01:00
|
|
|
case TrueColor:
|
2005-10-06 10:08:04 +02:00
|
|
|
case DirectColor:
|
2012-03-21 20:55:09 +01:00
|
|
|
type = PictTypeDirect;
|
|
|
|
break;
|
2003-11-14 17:48:57 +01:00
|
|
|
default:
|
2012-03-21 20:55:09 +01:00
|
|
|
return 0;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
while (nformat--) {
|
|
|
|
if (format->depth == depth && format->type == type) {
|
|
|
|
if (type == PictTypeIndexed) {
|
|
|
|
if (format->index.vid == pVisual->vid)
|
|
|
|
return format;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (format->direct.redMask << format->direct.red ==
|
|
|
|
pVisual->redMask &&
|
|
|
|
format->direct.greenMask << format->direct.green ==
|
|
|
|
pVisual->greenMask &&
|
|
|
|
format->direct.blueMask << format->direct.blue ==
|
|
|
|
pVisual->blueMask) {
|
|
|
|
return format;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
format++;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
PictFormatPtr
|
2012-03-21 20:55:09 +01:00
|
|
|
PictureMatchFormat(ScreenPtr pScreen, int depth, CARD32 f)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
|
|
|
|
PictFormatPtr format;
|
|
|
|
int nformat;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
if (!ps)
|
2012-03-21 20:55:09 +01:00
|
|
|
return 0;
|
2003-11-14 17:48:57 +01:00
|
|
|
format = ps->formats;
|
|
|
|
nformat = ps->nformats;
|
2012-03-21 20:55:09 +01:00
|
|
|
while (nformat--) {
|
|
|
|
if (format->depth == depth && format->format == (f & 0xffffff))
|
|
|
|
return format;
|
|
|
|
format++;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2012-03-21 20:55:09 +01:00
|
|
|
PictureParseCmapPolicy(const char *name)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
if (strcmp(name, "default") == 0)
|
|
|
|
return PictureCmapPolicyDefault;
|
|
|
|
else if (strcmp(name, "mono") == 0)
|
|
|
|
return PictureCmapPolicyMono;
|
|
|
|
else if (strcmp(name, "gray") == 0)
|
|
|
|
return PictureCmapPolicyGray;
|
|
|
|
else if (strcmp(name, "color") == 0)
|
|
|
|
return PictureCmapPolicyColor;
|
|
|
|
else if (strcmp(name, "all") == 0)
|
|
|
|
return PictureCmapPolicyAll;
|
2003-11-14 17:48:57 +01:00
|
|
|
else
|
2012-03-21 20:55:09 +01:00
|
|
|
return PictureCmapPolicyInvalid;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2010-10-27 15:59:06 +02:00
|
|
|
/** @see GetDefaultBytes */
|
|
|
|
static void
|
2013-12-15 10:05:51 +01:00
|
|
|
GetPictureBytes(void *value, XID id, ResourceSizePtr size)
|
2010-10-27 15:59:06 +02:00
|
|
|
{
|
|
|
|
PicturePtr picture = value;
|
|
|
|
|
|
|
|
/* Currently only pixmap bytes are reported to clients. */
|
|
|
|
size->resourceSize = 0;
|
|
|
|
|
2010-12-08 16:09:30 +01:00
|
|
|
size->refCnt = picture->refcnt;
|
|
|
|
|
2010-10-27 15:59:06 +02:00
|
|
|
/* Calculate pixmap reference sizes. */
|
|
|
|
size->pixmapRefSize = 0;
|
|
|
|
if (picture->pDrawable && (picture->pDrawable->type == DRAWABLE_PIXMAP))
|
|
|
|
{
|
|
|
|
SizeType pixmapSizeFunc = GetResourceTypeSizeFunc(RT_PIXMAP);
|
2010-12-08 16:09:30 +01:00
|
|
|
ResourceSizeRec pixmapSize = { 0, 0, 0 };
|
2010-10-27 15:59:06 +02:00
|
|
|
PixmapPtr pixmap = (PixmapPtr)picture->pDrawable;
|
|
|
|
pixmapSizeFunc(pixmap, pixmap->drawable.id, &pixmapSize);
|
|
|
|
size->pixmapRefSize += pixmapSize.pixmapRefSize;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
PictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
PictureScreenPtr ps;
|
|
|
|
int n;
|
|
|
|
CARD32 type, a, r, g, b;
|
|
|
|
|
|
|
|
if (PictureGeneration != serverGeneration) {
|
|
|
|
PictureType = CreateNewResourceType(FreePicture, "PICTURE");
|
|
|
|
if (!PictureType)
|
|
|
|
return FALSE;
|
2010-10-27 15:59:06 +02:00
|
|
|
SetResourceTypeSizeFunc(PictureType, GetPictureBytes);
|
2012-03-21 20:55:09 +01:00
|
|
|
PictFormatType = CreateNewResourceType(FreePictFormat, "PICTFORMAT");
|
|
|
|
if (!PictFormatType)
|
|
|
|
return FALSE;
|
|
|
|
GlyphSetType = CreateNewResourceType(FreeGlyphSet, "GLYPHSET");
|
|
|
|
if (!GlyphSetType)
|
|
|
|
return FALSE;
|
|
|
|
PictureGeneration = serverGeneration;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
2010-04-27 02:22:21 +02:00
|
|
|
if (!dixRegisterPrivateKey(&PictureScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
|
2012-03-21 20:55:09 +01:00
|
|
|
return FALSE;
|
2010-04-27 02:22:21 +02:00
|
|
|
|
|
|
|
if (!dixRegisterPrivateKey(&PictureWindowPrivateKeyRec, PRIVATE_WINDOW, 0))
|
2012-03-21 20:55:09 +01:00
|
|
|
return FALSE;
|
2010-04-27 02:22:21 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!formats) {
|
|
|
|
formats = PictureCreateDefaultFormats(pScreen, &nformats);
|
|
|
|
if (!formats)
|
|
|
|
return FALSE;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
for (n = 0; n < nformats; n++) {
|
|
|
|
if (!AddResource
|
2013-12-15 10:05:51 +01:00
|
|
|
(formats[n].id, PictFormatType, (void *) (formats + n))) {
|
2012-03-21 20:55:09 +01:00
|
|
|
free(formats);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
if (formats[n].type == PictTypeIndexed) {
|
|
|
|
VisualPtr pVisual =
|
|
|
|
PictureFindVisual(pScreen, formats[n].index.vid);
|
|
|
|
if ((pVisual->class | DynamicClass) == PseudoColor)
|
|
|
|
type = PICT_TYPE_COLOR;
|
|
|
|
else
|
|
|
|
type = PICT_TYPE_GRAY;
|
|
|
|
a = r = g = b = 0;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if ((formats[n].direct.redMask |
|
|
|
|
formats[n].direct.blueMask | formats[n].direct.greenMask) == 0)
|
|
|
|
type = PICT_TYPE_A;
|
|
|
|
else if (formats[n].direct.red > formats[n].direct.blue)
|
|
|
|
type = PICT_TYPE_ARGB;
|
|
|
|
else if (formats[n].direct.red == 0)
|
|
|
|
type = PICT_TYPE_ABGR;
|
|
|
|
else
|
|
|
|
type = PICT_TYPE_BGRA;
|
|
|
|
a = Ones(formats[n].direct.alphaMask);
|
|
|
|
r = Ones(formats[n].direct.redMask);
|
|
|
|
g = Ones(formats[n].direct.greenMask);
|
|
|
|
b = Ones(formats[n].direct.blueMask);
|
|
|
|
}
|
|
|
|
formats[n].format = PICT_FORMAT(0, type, a, r, g, b);
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
ps = (PictureScreenPtr) malloc(sizeof(PictureScreenRec));
|
|
|
|
if (!ps) {
|
|
|
|
free(formats);
|
|
|
|
return FALSE;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
SetPictureScreen(pScreen, ps);
|
|
|
|
|
|
|
|
ps->formats = formats;
|
|
|
|
ps->fallback = formats;
|
|
|
|
ps->nformats = nformats;
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2003-11-14 17:48:57 +01:00
|
|
|
ps->filters = 0;
|
|
|
|
ps->nfilters = 0;
|
|
|
|
ps->filterAliases = 0;
|
|
|
|
ps->nfilterAliases = 0;
|
|
|
|
|
|
|
|
ps->subpixel = SubPixelUnknown;
|
|
|
|
|
|
|
|
ps->CloseScreen = pScreen->CloseScreen;
|
|
|
|
ps->DestroyWindow = pScreen->DestroyWindow;
|
|
|
|
ps->StoreColors = pScreen->StoreColors;
|
|
|
|
pScreen->DestroyWindow = PictureDestroyWindow;
|
|
|
|
pScreen->CloseScreen = PictureCloseScreen;
|
|
|
|
pScreen->StoreColors = PictureStoreColors;
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!PictureSetDefaultFilters(pScreen)) {
|
|
|
|
PictureResetFilters(pScreen);
|
|
|
|
SetPictureScreen(pScreen, 0);
|
|
|
|
free(formats);
|
|
|
|
free(ps);
|
|
|
|
return FALSE;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2012-03-21 20:55:09 +01:00
|
|
|
SetPictureToDefaults(PicturePtr pPicture)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
|
|
|
pPicture->refcnt = 1;
|
|
|
|
pPicture->repeat = 0;
|
|
|
|
pPicture->graphicsExposures = FALSE;
|
|
|
|
pPicture->subWindowMode = ClipByChildren;
|
|
|
|
pPicture->polyEdge = PolyEdgeSharp;
|
|
|
|
pPicture->polyMode = PolyModePrecise;
|
|
|
|
pPicture->freeCompClip = FALSE;
|
|
|
|
pPicture->componentAlpha = FALSE;
|
2005-12-09 19:35:21 +01:00
|
|
|
pPicture->repeatType = RepeatNone;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
|
|
|
pPicture->alphaMap = 0;
|
|
|
|
pPicture->alphaOrigin.x = 0;
|
|
|
|
pPicture->alphaOrigin.y = 0;
|
|
|
|
|
|
|
|
pPicture->clipOrigin.x = 0;
|
|
|
|
pPicture->clipOrigin.y = 0;
|
|
|
|
pPicture->clientClip = 0;
|
|
|
|
|
|
|
|
pPicture->transform = 0;
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
pPicture->filter = PictureGetFilterId(FilterNearest, -1, TRUE);
|
2003-11-14 17:48:57 +01:00
|
|
|
pPicture->filter_params = 0;
|
|
|
|
pPicture->filter_nparams = 0;
|
|
|
|
|
|
|
|
pPicture->serialNumber = GC_CHANGE_SERIAL_BIT;
|
2010-10-06 15:56:56 +02:00
|
|
|
pPicture->stateChanges = -1;
|
2005-07-01 12:05:43 +02:00
|
|
|
pPicture->pSourcePict = 0;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
PicturePtr
|
2012-03-21 20:55:09 +01:00
|
|
|
CreatePicture(Picture pid,
|
|
|
|
DrawablePtr pDrawable,
|
|
|
|
PictFormatPtr pFormat,
|
|
|
|
Mask vmask, XID *vlist, ClientPtr client, int *error)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
PicturePtr pPicture;
|
|
|
|
PictureScreenPtr ps = GetPictureScreen(pDrawable->pScreen);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-07-04 00:45:09 +02:00
|
|
|
pPicture = dixAllocateScreenObjectWithPrivates(pDrawable->pScreen,
|
|
|
|
PictureRec, PRIVATE_PICTURE);
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!pPicture) {
|
|
|
|
*error = BadAlloc;
|
|
|
|
return 0;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
pPicture->id = pid;
|
|
|
|
pPicture->pDrawable = pDrawable;
|
|
|
|
pPicture->pFormat = pFormat;
|
|
|
|
pPicture->format = pFormat->format | (pDrawable->bitsPerPixel << 24);
|
2007-08-31 15:55:27 +02:00
|
|
|
|
|
|
|
/* security creation/labeling check */
|
2007-09-05 17:18:36 +02:00
|
|
|
*error = XaceHook(XACE_RESOURCE_ACCESS, client, pid, PictureType, pPicture,
|
2012-03-21 20:55:09 +01:00
|
|
|
RT_PIXMAP, pDrawable, DixCreateAccess | DixSetAttrAccess);
|
2007-08-31 15:55:27 +02:00
|
|
|
if (*error != Success)
|
2012-03-21 20:55:09 +01:00
|
|
|
goto out;
|
2007-08-31 15:55:27 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (pDrawable->type == DRAWABLE_PIXMAP) {
|
|
|
|
++((PixmapPtr) pDrawable)->refcnt;
|
|
|
|
pPicture->pNext = 0;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
else {
|
|
|
|
pPicture->pNext = GetPictureWindow(((WindowPtr) pDrawable));
|
|
|
|
SetPictureWindow(((WindowPtr) pDrawable), pPicture);
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
SetPictureToDefaults(pPicture);
|
|
|
|
|
2003-11-14 17:48:57 +01:00
|
|
|
if (vmask)
|
2012-03-21 20:55:09 +01:00
|
|
|
*error = ChangePicture(pPicture, vmask, vlist, 0, client);
|
2003-11-14 17:48:57 +01:00
|
|
|
else
|
2012-03-21 20:55:09 +01:00
|
|
|
*error = Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
if (*error == Success)
|
2012-03-21 20:55:09 +01:00
|
|
|
*error = (*ps->CreatePicture) (pPicture);
|
|
|
|
out:
|
|
|
|
if (*error != Success) {
|
|
|
|
FreePicture(pPicture, (XID) 0);
|
|
|
|
pPicture = 0;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
return pPicture;
|
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
static CARD32
|
|
|
|
xRenderColorToCard32(xRenderColor c)
|
2005-07-01 12:05:43 +02:00
|
|
|
{
|
|
|
|
return
|
|
|
|
(c.alpha >> 8 << 24) |
|
2012-03-21 20:55:09 +01:00
|
|
|
(c.red >> 8 << 16) | (c.green & 0xff00) | (c.blue >> 8);
|
2005-07-01 12:05:43 +02:00
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
static void
|
|
|
|
initGradient(SourcePictPtr pGradient, int stopCount,
|
|
|
|
xFixed * stopPoints, xRenderColor * stopColors, int *error)
|
2005-07-01 12:05:43 +02:00
|
|
|
{
|
|
|
|
int i;
|
|
|
|
xFixed dpos;
|
|
|
|
|
|
|
|
if (stopCount <= 0) {
|
|
|
|
*error = BadValue;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
dpos = -1;
|
|
|
|
for (i = 0; i < stopCount; ++i) {
|
2012-03-21 20:55:09 +01:00
|
|
|
if (stopPoints[i] < dpos || stopPoints[i] > (1 << 16)) {
|
2005-07-01 12:05:43 +02:00
|
|
|
*error = BadValue;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
dpos = stopPoints[i];
|
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
pGradient->gradient.stops = malloc(stopCount * sizeof(PictGradientStop));
|
2007-04-20 00:19:34 +02:00
|
|
|
if (!pGradient->gradient.stops) {
|
2005-07-01 12:05:43 +02:00
|
|
|
*error = BadAlloc;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2007-04-20 00:19:34 +02:00
|
|
|
pGradient->gradient.nstops = stopCount;
|
2005-07-01 12:05:43 +02:00
|
|
|
|
|
|
|
for (i = 0; i < stopCount; ++i) {
|
2007-04-20 00:19:34 +02:00
|
|
|
pGradient->gradient.stops[i].x = stopPoints[i];
|
|
|
|
pGradient->gradient.stops[i].color = stopColors[i];
|
2005-07-01 12:05:43 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
static PicturePtr
|
|
|
|
createSourcePicture(void)
|
2005-07-01 12:05:43 +02:00
|
|
|
{
|
|
|
|
PicturePtr pPicture;
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2012-07-04 00:45:09 +02:00
|
|
|
pPicture = dixAllocateScreenObjectWithPrivates(NULL, PictureRec, PRIVATE_PICTURE);
|
2005-07-01 12:05:43 +02:00
|
|
|
pPicture->pDrawable = 0;
|
|
|
|
pPicture->pFormat = 0;
|
|
|
|
pPicture->pNext = 0;
|
2007-04-20 00:19:34 +02:00
|
|
|
pPicture->format = PICT_a8r8g8b8;
|
2005-07-01 12:05:43 +02:00
|
|
|
|
|
|
|
SetPictureToDefaults(pPicture);
|
|
|
|
return pPicture;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
PicturePtr
|
2012-03-21 20:55:09 +01:00
|
|
|
CreateSolidPicture(Picture pid, xRenderColor * color, int *error)
|
2005-07-01 12:05:43 +02:00
|
|
|
{
|
|
|
|
PicturePtr pPicture;
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2005-07-01 12:05:43 +02:00
|
|
|
pPicture = createSourcePicture();
|
|
|
|
if (!pPicture) {
|
|
|
|
*error = BadAlloc;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
pPicture->id = pid;
|
2010-05-05 20:44:06 +02:00
|
|
|
pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictSolidFill));
|
2005-07-01 12:05:43 +02:00
|
|
|
if (!pPicture->pSourcePict) {
|
|
|
|
*error = BadAlloc;
|
2010-05-05 20:44:06 +02:00
|
|
|
free(pPicture);
|
2005-07-01 12:05:43 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
pPicture->pSourcePict->type = SourcePictTypeSolidFill;
|
|
|
|
pPicture->pSourcePict->solidFill.color = xRenderColorToCard32(*color);
|
|
|
|
return pPicture;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
PicturePtr
|
2012-03-21 20:55:09 +01:00
|
|
|
CreateLinearGradientPicture(Picture pid, xPointFixed * p1, xPointFixed * p2,
|
|
|
|
int nStops, xFixed * stops, xRenderColor * colors,
|
|
|
|
int *error)
|
2005-07-01 12:05:43 +02:00
|
|
|
{
|
|
|
|
PicturePtr pPicture;
|
|
|
|
|
|
|
|
if (nStops < 2) {
|
|
|
|
*error = BadValue;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
pPicture = createSourcePicture();
|
|
|
|
if (!pPicture) {
|
|
|
|
*error = BadAlloc;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
pPicture->id = pid;
|
2010-05-05 20:44:06 +02:00
|
|
|
pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictLinearGradient));
|
2005-07-01 12:05:43 +02:00
|
|
|
if (!pPicture->pSourcePict) {
|
|
|
|
*error = BadAlloc;
|
2010-05-05 20:44:06 +02:00
|
|
|
free(pPicture);
|
2005-07-01 12:05:43 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
pPicture->pSourcePict->linear.type = SourcePictTypeLinear;
|
|
|
|
pPicture->pSourcePict->linear.p1 = *p1;
|
|
|
|
pPicture->pSourcePict->linear.p2 = *p2;
|
|
|
|
|
|
|
|
initGradient(pPicture->pSourcePict, nStops, stops, colors, error);
|
|
|
|
if (*error) {
|
2010-05-05 20:44:06 +02:00
|
|
|
free(pPicture);
|
2005-07-01 12:05:43 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return pPicture;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
PicturePtr
|
2012-03-21 20:55:09 +01:00
|
|
|
CreateRadialGradientPicture(Picture pid, xPointFixed * inner,
|
|
|
|
xPointFixed * outer, xFixed innerRadius,
|
|
|
|
xFixed outerRadius, int nStops, xFixed * stops,
|
|
|
|
xRenderColor * colors, int *error)
|
2005-07-01 12:05:43 +02:00
|
|
|
{
|
|
|
|
PicturePtr pPicture;
|
|
|
|
PictRadialGradient *radial;
|
|
|
|
|
|
|
|
if (nStops < 2) {
|
|
|
|
*error = BadValue;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
pPicture = createSourcePicture();
|
|
|
|
if (!pPicture) {
|
|
|
|
*error = BadAlloc;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
pPicture->id = pid;
|
2010-05-05 20:44:06 +02:00
|
|
|
pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictRadialGradient));
|
2005-07-01 12:05:43 +02:00
|
|
|
if (!pPicture->pSourcePict) {
|
|
|
|
*error = BadAlloc;
|
2010-05-05 20:44:06 +02:00
|
|
|
free(pPicture);
|
2005-07-01 12:05:43 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
radial = &pPicture->pSourcePict->radial;
|
|
|
|
|
|
|
|
radial->type = SourcePictTypeRadial;
|
2007-04-23 19:19:54 +02:00
|
|
|
radial->c1.x = inner->x;
|
|
|
|
radial->c1.y = inner->y;
|
|
|
|
radial->c1.radius = innerRadius;
|
|
|
|
radial->c2.x = outer->x;
|
|
|
|
radial->c2.y = outer->y;
|
|
|
|
radial->c2.radius = outerRadius;
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2005-07-01 12:05:43 +02:00
|
|
|
initGradient(pPicture->pSourcePict, nStops, stops, colors, error);
|
|
|
|
if (*error) {
|
2010-05-05 20:44:06 +02:00
|
|
|
free(pPicture);
|
2005-07-01 12:05:43 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return pPicture;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
PicturePtr
|
2012-03-21 20:55:09 +01:00
|
|
|
CreateConicalGradientPicture(Picture pid, xPointFixed * center, xFixed angle,
|
|
|
|
int nStops, xFixed * stops, xRenderColor * colors,
|
|
|
|
int *error)
|
2005-07-01 12:05:43 +02:00
|
|
|
{
|
|
|
|
PicturePtr pPicture;
|
|
|
|
|
|
|
|
if (nStops < 2) {
|
|
|
|
*error = BadValue;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
pPicture = createSourcePicture();
|
|
|
|
if (!pPicture) {
|
|
|
|
*error = BadAlloc;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
pPicture->id = pid;
|
2010-05-05 20:44:06 +02:00
|
|
|
pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictConicalGradient));
|
2005-07-01 12:05:43 +02:00
|
|
|
if (!pPicture->pSourcePict) {
|
|
|
|
*error = BadAlloc;
|
2010-05-05 20:44:06 +02:00
|
|
|
free(pPicture);
|
2005-07-01 12:05:43 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
pPicture->pSourcePict->conical.type = SourcePictTypeConical;
|
|
|
|
pPicture->pSourcePict->conical.center = *center;
|
|
|
|
pPicture->pSourcePict->conical.angle = angle;
|
|
|
|
|
|
|
|
initGradient(pPicture->pSourcePict, nStops, stops, colors, error);
|
|
|
|
if (*error) {
|
2010-05-05 20:44:06 +02:00
|
|
|
free(pPicture);
|
2005-07-01 12:05:43 +02:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
return pPicture;
|
|
|
|
}
|
|
|
|
|
2014-11-17 21:28:58 +01:00
|
|
|
static int
|
|
|
|
cpAlphaMap(void **result, XID id, ScreenPtr screen, ClientPtr client, Mask mode)
|
|
|
|
{
|
|
|
|
#ifdef PANORAMIX
|
|
|
|
if (!noPanoramiXExtension) {
|
|
|
|
PanoramiXRes *res;
|
|
|
|
int err = dixLookupResourceByType((void **)&res, id, XRT_PICTURE,
|
|
|
|
client, mode);
|
|
|
|
if (err != Success)
|
|
|
|
return err;
|
|
|
|
id = res->info[screen->myNum].id;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
return dixLookupResourceByType(result, id, PictureType, client, mode);
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
|
|
|
cpClipMask(void **result, XID id, ScreenPtr screen, ClientPtr client, Mask mode)
|
|
|
|
{
|
|
|
|
#ifdef PANORAMIX
|
|
|
|
if (!noPanoramiXExtension) {
|
|
|
|
PanoramiXRes *res;
|
|
|
|
int err = dixLookupResourceByType((void **)&res, id, XRT_PIXMAP,
|
|
|
|
client, mode);
|
|
|
|
if (err != Success)
|
|
|
|
return err;
|
|
|
|
id = res->info[screen->myNum].id;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
return dixLookupResourceByType(result, id, RT_PIXMAP, client, mode);
|
|
|
|
}
|
|
|
|
|
2003-11-14 17:48:57 +01:00
|
|
|
#define NEXT_VAL(_type) (vlist ? (_type) *vlist++ : (_type) ulist++->val)
|
|
|
|
|
|
|
|
#define NEXT_PTR(_type) ((_type) ulist++->ptr)
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2012-03-21 20:55:09 +01:00
|
|
|
ChangePicture(PicturePtr pPicture,
|
|
|
|
Mask vmask, XID *vlist, DevUnion *ulist, ClientPtr client)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2005-07-01 12:05:43 +02:00
|
|
|
ScreenPtr pScreen = pPicture->pDrawable ? pPicture->pDrawable->pScreen : 0;
|
|
|
|
PictureScreenPtr ps = pScreen ? GetPictureScreen(pScreen) : 0;
|
2012-03-21 20:55:09 +01:00
|
|
|
BITS32 index2;
|
|
|
|
int error = 0;
|
|
|
|
BITS32 maskQ;
|
|
|
|
|
2003-11-14 17:48:57 +01:00
|
|
|
pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT;
|
|
|
|
maskQ = vmask;
|
2012-03-21 20:55:09 +01:00
|
|
|
while (vmask && !error) {
|
|
|
|
index2 = (BITS32) lowbit(vmask);
|
|
|
|
vmask &= ~index2;
|
|
|
|
pPicture->stateChanges |= index2;
|
|
|
|
switch (index2) {
|
|
|
|
case CPRepeat:
|
|
|
|
{
|
|
|
|
unsigned int newr;
|
|
|
|
newr = NEXT_VAL(unsigned int);
|
|
|
|
|
|
|
|
if (newr <= RepeatReflect) {
|
|
|
|
pPicture->repeat = (newr != RepeatNone);
|
|
|
|
pPicture->repeatType = newr;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
client->errorValue = newr;
|
|
|
|
error = BadValue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case CPAlphaMap:
|
|
|
|
{
|
|
|
|
PicturePtr pAlpha;
|
|
|
|
|
|
|
|
if (vlist) {
|
|
|
|
Picture pid = NEXT_VAL(Picture);
|
|
|
|
|
|
|
|
if (pid == None)
|
|
|
|
pAlpha = 0;
|
|
|
|
else {
|
2014-11-17 21:28:58 +01:00
|
|
|
error = cpAlphaMap((void **) &pAlpha, pid, pScreen,
|
|
|
|
client, DixReadAccess);
|
2012-03-21 20:55:09 +01:00
|
|
|
if (error != Success) {
|
|
|
|
client->errorValue = pid;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (pAlpha->pDrawable == NULL ||
|
|
|
|
pAlpha->pDrawable->type != DRAWABLE_PIXMAP) {
|
|
|
|
client->errorValue = pid;
|
|
|
|
error = BadMatch;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
pAlpha = NEXT_PTR(PicturePtr);
|
|
|
|
if (!error) {
|
|
|
|
if (pAlpha && pAlpha->pDrawable->type == DRAWABLE_PIXMAP)
|
|
|
|
pAlpha->refcnt++;
|
|
|
|
if (pPicture->alphaMap)
|
2013-12-15 10:05:51 +01:00
|
|
|
FreePicture((void *) pPicture->alphaMap, (XID) 0);
|
2012-03-21 20:55:09 +01:00
|
|
|
pPicture->alphaMap = pAlpha;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case CPAlphaXOrigin:
|
|
|
|
pPicture->alphaOrigin.x = NEXT_VAL(INT16);
|
|
|
|
|
|
|
|
break;
|
|
|
|
case CPAlphaYOrigin:
|
|
|
|
pPicture->alphaOrigin.y = NEXT_VAL(INT16);
|
|
|
|
|
|
|
|
break;
|
|
|
|
case CPClipXOrigin:
|
|
|
|
pPicture->clipOrigin.x = NEXT_VAL(INT16);
|
|
|
|
|
|
|
|
break;
|
|
|
|
case CPClipYOrigin:
|
|
|
|
pPicture->clipOrigin.y = NEXT_VAL(INT16);
|
|
|
|
|
|
|
|
break;
|
|
|
|
case CPClipMask:
|
|
|
|
{
|
|
|
|
Pixmap pid;
|
|
|
|
PixmapPtr pPixmap;
|
|
|
|
int clipType;
|
|
|
|
|
|
|
|
if (!pScreen)
|
|
|
|
return BadDrawable;
|
|
|
|
|
|
|
|
if (vlist) {
|
|
|
|
pid = NEXT_VAL(Pixmap);
|
|
|
|
if (pid == None) {
|
|
|
|
clipType = CT_NONE;
|
|
|
|
pPixmap = NullPixmap;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
clipType = CT_PIXMAP;
|
2014-11-17 21:28:58 +01:00
|
|
|
error = cpClipMask((void **) &pPixmap, pid, pScreen,
|
|
|
|
client, DixReadAccess);
|
2012-03-21 20:55:09 +01:00
|
|
|
if (error != Success) {
|
|
|
|
client->errorValue = pid;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
pPixmap = NEXT_PTR(PixmapPtr);
|
|
|
|
|
|
|
|
if (pPixmap)
|
|
|
|
clipType = CT_PIXMAP;
|
|
|
|
else
|
|
|
|
clipType = CT_NONE;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pPixmap) {
|
|
|
|
if ((pPixmap->drawable.depth != 1) ||
|
|
|
|
(pPixmap->drawable.pScreen != pScreen)) {
|
|
|
|
error = BadMatch;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
clipType = CT_PIXMAP;
|
|
|
|
pPixmap->refcnt++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
error = (*ps->ChangePictureClip) (pPicture, clipType,
|
2013-12-15 10:05:51 +01:00
|
|
|
(void *) pPixmap, 0);
|
2012-03-21 20:55:09 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case CPGraphicsExposure:
|
|
|
|
{
|
|
|
|
unsigned int newe;
|
|
|
|
newe = NEXT_VAL(unsigned int);
|
|
|
|
|
|
|
|
if (newe <= xTrue)
|
|
|
|
pPicture->graphicsExposures = newe;
|
|
|
|
else {
|
|
|
|
client->errorValue = newe;
|
|
|
|
error = BadValue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case CPSubwindowMode:
|
|
|
|
{
|
|
|
|
unsigned int news;
|
|
|
|
news = NEXT_VAL(unsigned int);
|
|
|
|
|
|
|
|
if (news == ClipByChildren || news == IncludeInferiors)
|
|
|
|
pPicture->subWindowMode = news;
|
|
|
|
else {
|
|
|
|
client->errorValue = news;
|
|
|
|
error = BadValue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case CPPolyEdge:
|
|
|
|
{
|
|
|
|
unsigned int newe;
|
|
|
|
newe = NEXT_VAL(unsigned int);
|
|
|
|
|
|
|
|
if (newe == PolyEdgeSharp || newe == PolyEdgeSmooth)
|
|
|
|
pPicture->polyEdge = newe;
|
|
|
|
else {
|
|
|
|
client->errorValue = newe;
|
|
|
|
error = BadValue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case CPPolyMode:
|
|
|
|
{
|
|
|
|
unsigned int newm;
|
|
|
|
newm = NEXT_VAL(unsigned int);
|
|
|
|
|
|
|
|
if (newm == PolyModePrecise || newm == PolyModeImprecise)
|
|
|
|
pPicture->polyMode = newm;
|
|
|
|
else {
|
|
|
|
client->errorValue = newm;
|
|
|
|
error = BadValue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case CPDither:
|
|
|
|
(void) NEXT_VAL(Atom); /* unimplemented */
|
|
|
|
|
|
|
|
break;
|
|
|
|
case CPComponentAlpha:
|
|
|
|
{
|
|
|
|
unsigned int newca;
|
|
|
|
|
|
|
|
newca = NEXT_VAL(unsigned int);
|
|
|
|
|
|
|
|
if (newca <= xTrue)
|
|
|
|
pPicture->componentAlpha = newca;
|
|
|
|
else {
|
|
|
|
client->errorValue = newca;
|
|
|
|
error = BadValue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
client->errorValue = maskQ;
|
|
|
|
error = BadValue;
|
|
|
|
break;
|
|
|
|
}
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
2005-07-01 12:05:43 +02:00
|
|
|
if (ps)
|
|
|
|
(*ps->ChangePicture) (pPicture, maskQ);
|
2003-11-14 17:48:57 +01:00
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2012-03-21 20:55:09 +01:00
|
|
|
SetPictureClipRects(PicturePtr pPicture,
|
|
|
|
int xOrigin, int yOrigin, int nRect, xRectangle *rects)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
ScreenPtr pScreen = pPicture->pDrawable->pScreen;
|
|
|
|
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
|
|
|
RegionPtr clientClip;
|
|
|
|
int result;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2010-06-06 05:55:29 +02:00
|
|
|
clientClip = RegionFromRects(nRect, rects, CT_UNSORTED);
|
2003-11-14 17:48:57 +01:00
|
|
|
if (!clientClip)
|
2012-03-21 20:55:09 +01:00
|
|
|
return BadAlloc;
|
|
|
|
result = (*ps->ChangePictureClip) (pPicture, CT_REGION,
|
2013-12-15 10:05:51 +01:00
|
|
|
(void *) clientClip, 0);
|
2012-03-21 20:55:09 +01:00
|
|
|
if (result == Success) {
|
|
|
|
pPicture->clipOrigin.x = xOrigin;
|
|
|
|
pPicture->clipOrigin.y = yOrigin;
|
|
|
|
pPicture->stateChanges |= CPClipXOrigin | CPClipYOrigin | CPClipMask;
|
|
|
|
pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2012-03-21 20:55:09 +01:00
|
|
|
SetPictureClipRegion(PicturePtr pPicture,
|
|
|
|
int xOrigin, int yOrigin, RegionPtr pRegion)
|
2004-07-29 20:37:54 +02:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
ScreenPtr pScreen = pPicture->pDrawable->pScreen;
|
|
|
|
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
|
|
|
RegionPtr clientClip;
|
|
|
|
int result;
|
|
|
|
int type;
|
|
|
|
|
|
|
|
if (pRegion) {
|
2004-07-29 20:37:54 +02:00
|
|
|
type = CT_REGION;
|
2010-06-06 05:55:29 +02:00
|
|
|
clientClip = RegionCreate(RegionExtents(pRegion),
|
|
|
|
RegionNumRects(pRegion));
|
2004-07-29 20:37:54 +02:00
|
|
|
if (!clientClip)
|
|
|
|
return BadAlloc;
|
2012-03-21 20:55:09 +01:00
|
|
|
if (!RegionCopy(clientClip, pRegion)) {
|
2010-05-22 00:05:48 +02:00
|
|
|
RegionDestroy(clientClip);
|
2004-07-29 20:37:54 +02:00
|
|
|
return BadAlloc;
|
|
|
|
}
|
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
else {
|
2004-07-29 20:37:54 +02:00
|
|
|
type = CT_NONE;
|
|
|
|
clientClip = 0;
|
|
|
|
}
|
|
|
|
|
2013-12-15 10:05:51 +01:00
|
|
|
result = (*ps->ChangePictureClip) (pPicture, type, (void *) clientClip, 0);
|
2012-03-21 20:55:09 +01:00
|
|
|
if (result == Success) {
|
2004-07-29 20:37:54 +02:00
|
|
|
pPicture->clipOrigin.x = xOrigin;
|
|
|
|
pPicture->clipOrigin.y = yOrigin;
|
2012-03-21 20:55:09 +01:00
|
|
|
pPicture->stateChanges |= CPClipXOrigin | CPClipYOrigin | CPClipMask;
|
2004-07-29 20:37:54 +02:00
|
|
|
pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT;
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2006-09-11 19:43:09 +02:00
|
|
|
static Bool
|
2012-03-21 20:55:09 +01:00
|
|
|
transformIsIdentity(PictTransform * t)
|
2006-09-11 19:43:09 +02:00
|
|
|
{
|
|
|
|
return ((t->matrix[0][0] == t->matrix[1][1]) &&
|
|
|
|
(t->matrix[0][0] == t->matrix[2][2]) &&
|
2006-09-12 01:15:40 +02:00
|
|
|
(t->matrix[0][0] != 0) &&
|
2006-09-11 19:43:09 +02:00
|
|
|
(t->matrix[0][1] == 0) &&
|
|
|
|
(t->matrix[0][2] == 0) &&
|
|
|
|
(t->matrix[1][0] == 0) &&
|
|
|
|
(t->matrix[1][2] == 0) &&
|
2012-03-21 20:55:09 +01:00
|
|
|
(t->matrix[2][0] == 0) && (t->matrix[2][1] == 0));
|
2006-09-11 19:43:09 +02:00
|
|
|
}
|
2004-07-29 20:37:54 +02:00
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2012-03-21 20:55:09 +01:00
|
|
|
SetPictureTransform(PicturePtr pPicture, PictTransform * transform)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
if (transform && transformIsIdentity(transform))
|
|
|
|
transform = 0;
|
|
|
|
|
|
|
|
if (transform) {
|
|
|
|
if (!pPicture->transform) {
|
|
|
|
pPicture->transform =
|
|
|
|
(PictTransform *) malloc(sizeof(PictTransform));
|
|
|
|
if (!pPicture->transform)
|
|
|
|
return BadAlloc;
|
|
|
|
}
|
|
|
|
*pPicture->transform = *transform;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
else {
|
|
|
|
free(pPicture->transform);
|
|
|
|
pPicture->transform = NULL;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
2004-08-15 05:34:18 +02:00
|
|
|
pPicture->serialNumber |= GC_CHANGE_SERIAL_BIT;
|
|
|
|
|
2006-06-30 03:01:14 +02:00
|
|
|
if (pPicture->pDrawable != NULL) {
|
2012-03-21 20:55:09 +01:00
|
|
|
int result;
|
|
|
|
PictureScreenPtr ps = GetPictureScreen(pPicture->pDrawable->pScreen);
|
2005-12-28 12:48:14 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
result = (*ps->ChangePictureTransform) (pPicture, transform);
|
2006-06-30 03:01:14 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
return result;
|
2006-06-30 03:01:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return Success;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-03-21 20:55:09 +01:00
|
|
|
ValidateOnePicture(PicturePtr pPicture)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
if (pPicture->pDrawable &&
|
|
|
|
pPicture->serialNumber != pPicture->pDrawable->serialNumber) {
|
|
|
|
PictureScreenPtr ps = GetPictureScreen(pPicture->pDrawable->pScreen);
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
(*ps->ValidatePicture) (pPicture, pPicture->stateChanges);
|
|
|
|
pPicture->stateChanges = 0;
|
|
|
|
pPicture->serialNumber = pPicture->pDrawable->serialNumber;
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2003-11-14 17:48:57 +01:00
|
|
|
ValidatePicture(PicturePtr pPicture)
|
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
ValidateOnePicture(pPicture);
|
2003-11-14 17:48:57 +01:00
|
|
|
if (pPicture->alphaMap)
|
2012-03-21 20:55:09 +01:00
|
|
|
ValidateOnePicture(pPicture->alphaMap);
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2013-12-15 10:05:51 +01:00
|
|
|
FreePicture(void *value, XID pid)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
PicturePtr pPicture = (PicturePtr) value;
|
2003-11-14 17:48:57 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (--pPicture->refcnt == 0) {
|
|
|
|
free(pPicture->transform);
|
2007-04-20 00:19:34 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
if (pPicture->pSourcePict) {
|
|
|
|
if (pPicture->pSourcePict->type != SourcePictTypeSolidFill)
|
|
|
|
free(pPicture->pSourcePict->linear.stops);
|
2007-04-20 00:19:34 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
free(pPicture->pSourcePict);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (pPicture->pDrawable) {
|
|
|
|
ScreenPtr pScreen = pPicture->pDrawable->pScreen;
|
|
|
|
PictureScreenPtr ps = GetPictureScreen(pScreen);
|
2007-04-20 00:19:34 +02:00
|
|
|
|
2005-07-01 12:05:43 +02:00
|
|
|
if (pPicture->alphaMap)
|
2013-12-15 10:05:51 +01:00
|
|
|
FreePicture((void *) pPicture->alphaMap, (XID) 0);
|
2005-07-01 12:05:43 +02:00
|
|
|
(*ps->DestroyPicture) (pPicture);
|
|
|
|
(*ps->DestroyPictureClip) (pPicture);
|
2012-03-21 20:55:09 +01:00
|
|
|
if (pPicture->pDrawable->type == DRAWABLE_WINDOW) {
|
|
|
|
WindowPtr pWindow = (WindowPtr) pPicture->pDrawable;
|
|
|
|
PicturePtr *pPrev;
|
|
|
|
|
|
|
|
for (pPrev = (PicturePtr *) dixLookupPrivateAddr
|
|
|
|
(&pWindow->devPrivates, PictureWindowPrivateKey);
|
|
|
|
*pPrev; pPrev = &(*pPrev)->pNext) {
|
|
|
|
if (*pPrev == pPicture) {
|
2005-07-01 12:05:43 +02:00
|
|
|
*pPrev = pPicture->pNext;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
else if (pPicture->pDrawable->type == DRAWABLE_PIXMAP) {
|
|
|
|
(*pScreen->DestroyPixmap) ((PixmapPtr) pPicture->pDrawable);
|
2005-07-01 12:05:43 +02:00
|
|
|
}
|
|
|
|
}
|
2012-03-21 20:55:09 +01:00
|
|
|
dixFreeObjectWithPrivates(pPicture, PRIVATE_PICTURE);
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
int
|
2013-12-15 10:05:51 +01:00
|
|
|
FreePictFormat(void *pPictFormat, XID pid)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
|
2006-02-12 21:53:35 +01:00
|
|
|
/**
|
|
|
|
* ReduceCompositeOp is used to choose simpler ops for cases where alpha
|
|
|
|
* channels are always one and so math on the alpha channel per pixel becomes
|
|
|
|
* unnecessary. It may also avoid destination reads sometimes if apps aren't
|
|
|
|
* being careful to avoid these cases.
|
|
|
|
*/
|
2007-07-29 17:02:47 +02:00
|
|
|
static CARD8
|
2012-03-21 20:55:09 +01:00
|
|
|
ReduceCompositeOp(CARD8 op, PicturePtr pSrc, PicturePtr pMask, PicturePtr pDst,
|
|
|
|
INT16 xSrc, INT16 ySrc, CARD16 width, CARD16 height)
|
2006-02-12 21:53:35 +01:00
|
|
|
{
|
2006-02-13 19:09:51 +01:00
|
|
|
Bool no_src_alpha, no_dst_alpha;
|
|
|
|
|
2008-06-24 18:40:47 +02:00
|
|
|
/* Sampling off the edge of a RepeatNone picture introduces alpha
|
|
|
|
* even if the picture itself doesn't have alpha. We don't try to
|
|
|
|
* detect every case where we don't sample off the edge, just the
|
|
|
|
* simplest case where there is no transform on the source
|
|
|
|
* picture.
|
|
|
|
*/
|
2006-02-13 19:09:51 +01:00
|
|
|
no_src_alpha = PICT_FORMAT_COLOR(pSrc->format) &&
|
2012-03-21 20:55:09 +01:00
|
|
|
PICT_FORMAT_A(pSrc->format) == 0 &&
|
|
|
|
(pSrc->repeatType != RepeatNone ||
|
|
|
|
(!pSrc->transform &&
|
|
|
|
xSrc >= 0 && ySrc >= 0 &&
|
|
|
|
xSrc + width <= pSrc->pDrawable->width &&
|
|
|
|
ySrc + height <= pSrc->pDrawable->height)) &&
|
|
|
|
pSrc->alphaMap == NULL && pMask == NULL;
|
2006-02-13 19:09:51 +01:00
|
|
|
no_dst_alpha = PICT_FORMAT_COLOR(pDst->format) &&
|
2012-03-21 20:55:09 +01:00
|
|
|
PICT_FORMAT_A(pDst->format) == 0 && pDst->alphaMap == NULL;
|
2006-02-13 19:09:51 +01:00
|
|
|
|
|
|
|
/* TODO, maybe: Conjoint and Disjoint op reductions? */
|
2012-03-21 20:55:09 +01:00
|
|
|
|
2006-02-12 21:53:35 +01:00
|
|
|
/* Deal with simplifications where the source alpha is always 1. */
|
2012-03-21 20:55:09 +01:00
|
|
|
if (no_src_alpha) {
|
|
|
|
switch (op) {
|
|
|
|
case PictOpOver:
|
|
|
|
op = PictOpSrc;
|
|
|
|
break;
|
|
|
|
case PictOpInReverse:
|
|
|
|
op = PictOpDst;
|
|
|
|
break;
|
|
|
|
case PictOpOutReverse:
|
|
|
|
op = PictOpClear;
|
|
|
|
break;
|
|
|
|
case PictOpAtop:
|
|
|
|
op = PictOpIn;
|
|
|
|
break;
|
|
|
|
case PictOpAtopReverse:
|
|
|
|
op = PictOpOverReverse;
|
|
|
|
break;
|
|
|
|
case PictOpXor:
|
|
|
|
op = PictOpOut;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2006-02-12 21:53:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Deal with simplifications when the destination alpha is always 1 */
|
2012-03-21 20:55:09 +01:00
|
|
|
if (no_dst_alpha) {
|
|
|
|
switch (op) {
|
|
|
|
case PictOpOverReverse:
|
|
|
|
op = PictOpDst;
|
|
|
|
break;
|
|
|
|
case PictOpIn:
|
|
|
|
op = PictOpSrc;
|
|
|
|
break;
|
|
|
|
case PictOpOut:
|
|
|
|
op = PictOpClear;
|
|
|
|
break;
|
|
|
|
case PictOpAtop:
|
|
|
|
op = PictOpOver;
|
|
|
|
break;
|
|
|
|
case PictOpXor:
|
|
|
|
op = PictOpOutReverse;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
2006-02-12 21:53:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
/* Reduce some con/disjoint ops to the basic names. */
|
|
|
|
switch (op) {
|
|
|
|
case PictOpDisjointClear:
|
|
|
|
case PictOpConjointClear:
|
2012-03-21 20:55:09 +01:00
|
|
|
op = PictOpClear;
|
|
|
|
break;
|
2006-02-12 21:53:35 +01:00
|
|
|
case PictOpDisjointSrc:
|
|
|
|
case PictOpConjointSrc:
|
2012-03-21 20:55:09 +01:00
|
|
|
op = PictOpSrc;
|
|
|
|
break;
|
2006-02-12 21:53:35 +01:00
|
|
|
case PictOpDisjointDst:
|
|
|
|
case PictOpConjointDst:
|
2012-03-21 20:55:09 +01:00
|
|
|
op = PictOpDst;
|
|
|
|
break;
|
2006-02-12 21:53:35 +01:00
|
|
|
default:
|
2012-03-21 20:55:09 +01:00
|
|
|
break;
|
2006-02-12 21:53:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return op;
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2012-03-21 20:55:09 +01:00
|
|
|
CompositePicture(CARD8 op,
|
|
|
|
PicturePtr pSrc,
|
|
|
|
PicturePtr pMask,
|
|
|
|
PicturePtr pDst,
|
|
|
|
INT16 xSrc,
|
|
|
|
INT16 ySrc,
|
|
|
|
INT16 xMask,
|
|
|
|
INT16 yMask,
|
|
|
|
INT16 xDst, INT16 yDst, CARD16 width, CARD16 height)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen);
|
|
|
|
|
|
|
|
ValidatePicture(pSrc);
|
2003-11-14 17:48:57 +01:00
|
|
|
if (pMask)
|
2012-03-21 20:55:09 +01:00
|
|
|
ValidatePicture(pMask);
|
|
|
|
ValidatePicture(pDst);
|
2006-02-12 21:53:35 +01:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
op = ReduceCompositeOp(op, pSrc, pMask, pDst, xSrc, ySrc, width, height);
|
2006-02-12 21:53:35 +01:00
|
|
|
if (op == PictOpDst)
|
2012-03-21 20:55:09 +01:00
|
|
|
return;
|
2006-02-12 21:53:35 +01:00
|
|
|
|
2003-11-14 17:48:57 +01:00
|
|
|
(*ps->Composite) (op,
|
2012-03-21 20:55:09 +01:00
|
|
|
pSrc,
|
|
|
|
pMask,
|
|
|
|
pDst,
|
|
|
|
xSrc, ySrc, xMask, yMask, xDst, yDst, width, height);
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2012-03-21 20:55:09 +01:00
|
|
|
CompositeRects(CARD8 op,
|
|
|
|
PicturePtr pDst,
|
|
|
|
xRenderColor * color, int nRect, xRectangle *rects)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen);
|
|
|
|
|
|
|
|
ValidatePicture(pDst);
|
2003-11-14 17:48:57 +01:00
|
|
|
(*ps->CompositeRects) (op, pDst, color, nRect, rects);
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2012-03-21 20:55:09 +01:00
|
|
|
CompositeTrapezoids(CARD8 op,
|
|
|
|
PicturePtr pSrc,
|
|
|
|
PicturePtr pDst,
|
|
|
|
PictFormatPtr maskFormat,
|
|
|
|
INT16 xSrc, INT16 ySrc, int ntrap, xTrapezoid * traps)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen);
|
|
|
|
|
|
|
|
ValidatePicture(pSrc);
|
|
|
|
ValidatePicture(pDst);
|
2003-11-14 17:48:57 +01:00
|
|
|
(*ps->Trapezoids) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntrap, traps);
|
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2012-03-21 20:55:09 +01:00
|
|
|
CompositeTriangles(CARD8 op,
|
|
|
|
PicturePtr pSrc,
|
|
|
|
PicturePtr pDst,
|
|
|
|
PictFormatPtr maskFormat,
|
|
|
|
INT16 xSrc,
|
|
|
|
INT16 ySrc, int ntriangles, xTriangle * triangles)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen);
|
|
|
|
|
|
|
|
ValidatePicture(pSrc);
|
|
|
|
ValidatePicture(pDst);
|
|
|
|
(*ps->Triangles) (op, pSrc, pDst, maskFormat, xSrc, ySrc, ntriangles,
|
|
|
|
triangles);
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2012-03-21 20:55:09 +01:00
|
|
|
CompositeTriStrip(CARD8 op,
|
|
|
|
PicturePtr pSrc,
|
|
|
|
PicturePtr pDst,
|
|
|
|
PictFormatPtr maskFormat,
|
|
|
|
INT16 xSrc, INT16 ySrc, int npoints, xPointFixed * points)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen);
|
2011-09-04 18:34:08 +02:00
|
|
|
|
2011-03-08 16:14:27 +01:00
|
|
|
if (npoints < 3)
|
|
|
|
return;
|
2011-09-04 18:34:08 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
ValidatePicture(pSrc);
|
|
|
|
ValidatePicture(pDst);
|
2011-09-04 18:34:08 +02:00
|
|
|
(*ps->TriStrip) (op, pSrc, pDst, maskFormat, xSrc, ySrc, npoints, points);
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2012-03-21 20:55:09 +01:00
|
|
|
CompositeTriFan(CARD8 op,
|
|
|
|
PicturePtr pSrc,
|
|
|
|
PicturePtr pDst,
|
|
|
|
PictFormatPtr maskFormat,
|
|
|
|
INT16 xSrc, INT16 ySrc, int npoints, xPointFixed * points)
|
2003-11-14 17:48:57 +01:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
PictureScreenPtr ps = GetPictureScreen(pDst->pDrawable->pScreen);
|
2011-09-04 18:34:08 +02:00
|
|
|
|
2011-03-08 16:14:26 +01:00
|
|
|
if (npoints < 3)
|
2012-03-21 20:55:09 +01:00
|
|
|
return;
|
2011-09-04 18:34:08 +02:00
|
|
|
|
2012-03-21 20:55:09 +01:00
|
|
|
ValidatePicture(pSrc);
|
|
|
|
ValidatePicture(pDst);
|
2011-09-04 18:34:08 +02:00
|
|
|
(*ps->TriFan) (op, pSrc, pDst, maskFormat, xSrc, ySrc, npoints, points);
|
2003-11-14 17:48:57 +01:00
|
|
|
}
|
|
|
|
|
Rework symbol visibility for easier maintenance
Save in a few special cases, _X_EXPORT should not be used in C source
files. Instead, it should be used in headers, and the proper C source
include that header. Some special cases are symbols that need to be
shared between modules, but not expected to be used by external drivers,
and symbols that are accessible via LoaderSymbol/dlopen.
This patch also adds conditionally some new sdk header files, depending
on extensions enabled. These files were added to match pattern for
other extensions/modules, that is, have the headers "deciding" symbol
visibility in the sdk. These headers are:
o Xext/panoramiXsrv.h, Xext/panoramiX.h
o fbpict.h (unconditionally)
o vidmodeproc.h
o mioverlay.h (unconditionally, used only by xaa)
o xfixes.h (unconditionally, symbols required by dri2)
LoaderSymbol and similar functions now don't have different prototypes,
in loaderProcs.h and xf86Module.h, so that both headers can be included,
without the need of defining IN_LOADER.
xf86NewInputDevice() device prototype readded to xf86Xinput.h, but
not exported (and with a comment about it).
2008-12-03 08:43:34 +01:00
|
|
|
void
|
2012-03-21 20:55:09 +01:00
|
|
|
AddTraps(PicturePtr pPicture, INT16 xOff, INT16 yOff, int ntrap, xTrap * traps)
|
2004-08-07 01:42:10 +02:00
|
|
|
{
|
2012-03-21 20:55:09 +01:00
|
|
|
PictureScreenPtr ps = GetPictureScreen(pPicture->pDrawable->pScreen);
|
|
|
|
|
|
|
|
ValidatePicture(pPicture);
|
2004-08-07 01:42:10 +02:00
|
|
|
(*ps->AddTraps) (pPicture, xOff, yOff, ntrap, traps);
|
|
|
|
}
|