summaryrefslogtreecommitdiff
path: root/fb/fbpict.c
AgeCommit message (Collapse)AuthorFilesLines
2012-03-27Introduce a consistent coding styleKeith Packard1-193/+187
This is strictly the application of the script 'x-indent-all.sh' from util/modular. Compared to the patch that Daniel posted in January, I've added a few indent flags: -bap -psl -T PrivatePtr -T pmWait -T _XFUNCPROTOBEGIN -T _XFUNCPROTOEND -T _X_EXPORT The typedefs were needed to make the output of sdksyms.sh match the previous output, otherwise, the code is formatted badly enough that sdksyms.sh generates incorrect output. The generated code was compared with the previous version and found to be essentially identical -- "assert" line numbers and BUILD_TIME were the only differences found. The comparison was done with this script: dir1=$1 dir2=$2 for dir in $dir1 $dir2; do (cd $dir && find . -name '*.o' | while read file; do dir=`dirname $file` base=`basename $file .o` dump=$dir/$base.dump objdump -d $file > $dump done) done find $dir1 -name '*.dump' | while read dump; do otherdump=`echo $dump | sed "s;$dir1;$dir2;"` diff -u $dump $otherdump done Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Daniel Stone <daniel@fooishbar.org> Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com> (cherry picked from commit 9838b7032ea9792bec21af424c53c07078636d21)
2011-10-04Fix server crash due to invalid imagesKirill Elagin1-1/+3
See https://bugs.freedesktop.org/show_bug.cgi?id=39383 Signed-off-by: Kirill Elagin <kirelagin@gmail.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-04-25fb: Silence warnings when building with clangJeremy Huddleston1-1/+1
fbpict.c:163:8: warning: implicit conversion from enumeration type 'PictFormatShort' (aka 'enum _PictFormatShort') to different enumeration type 'pixman_format_code_t' [-Wconversion] pict->format, ~~~~~~^~~~~~ fbbltone.c:486:2: warning: shift result (281474959933440) requires 49 bits to represent, but 'int' only has 32 bits [-Wshift-overflow] C2_24( 0, 0), C2_24 ( 1, 0), C2_24 ( 2, 0), C2_24 ( 3, 0), ^~~~~~~~~~~~ fbbltone.c:474:6: note: instantiated from: SelMask24(b,1,r)) ^ fbbltone.c:429:46: note: instantiated from: ^ fbbltone.c:427:18: note: instantiated from: 0xffffff << Mask24Check(x,r)) : 0) ~~~~~~~~ ^ Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jamey Sharp <jamey@minilop.net>
2011-03-14Remove geometry arguments from miSourceValidate()Søren Sandmann Pedersen1-2/+2
The only user of the geometry coordinates is the software sprite code, which uses them to remove the pointer whenever the window beneath is being used as a source. However, using Window pictures as a source is extremely rare (let alone *partial* windows), so there is no harm done in just validating all of the drawable. Additionally, the miSourceValidate() function was buggy in at least three respects: (a) It added drawable->{x,y} before calling down, which is wrong since the misprite code already adds them in its check. (Alternatively, the misprite code is wrong, but there are actual users who would notice if that code was broken). (b) It didn't account for the width of the interpolation filter, so if the Picture had a bilinear or convolution filter, the edges surrounding the source area would not be validated. (c) It didn't validate alpha maps. Finally, computing the bounding box of the transform on every composite request was a real performance issue in pixman, so presumably it could be one here as well. This patch changes miSourceValidate() to simply validate all of the underlying drawable. Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com> Signed-off-by: Soren Sandmann <ssp@redhat.com>
2011-02-26Move miTriangles to fb as fbTriangles()Søren Sandmann Pedersen1-0/+1
The fb version simply calls the new pixman_composite_triangles(). This allows us to get rid of miCreateAlphaPicture(). Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Søren Sandmann <ssp@redhat.com>
2011-02-26Move miTrapezoids() into fb as fbTrapezoids()Søren Sandmann Pedersen1-0/+1
The main consumer of trapezoids, cairo, is using the Trapezoids request, which is currently implemented in the miTrapezoids() function. That function splits the request into smaller bits and calls lower level functions such as AddTrap. By moving the implementation of the whole request into fb, we can instead call pixman_composite_trapezoids() to do the whole request in one step. There are no callers of miTrapezoids in any of the open source drivers, although exa and uxa have their own copies of the function. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Søren Sandmann <ssp@redhat.com>
2010-11-02fb: Delete fbCompositeGeneral()Søren Sandmann Pedersen1-19/+0
This function was an unused and trivial wrapper around fbComposite(). Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Søren Sandmann <ssp@redhat.com>
2010-11-01Delete unused fbWalkCompositeRegion()Søren Sandmann Pedersen1-106/+0
This function has not been used since most of the compositing was moved to pixman. The only reason it has survived until now is that it was part of the server ABI. Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Signed-off-by: Søren Sandmann <ssp@redhat.com>
2010-08-10Don't let alpha maps recurse in fb. Bug 23581.Keith Packard1-6/+18
Recursive alpha maps (where one picture's alpha map is set to a picture with an external alpha map) would be all fine and dandy, except for the case where the client constructs a loop. Detecting this case when setting the alpha map values would be difficult as any time an alpha map is set, the server would have to check for the looping case. Instead, a far simpler fix is to simply disallow recursive alpha maps in the rendering code, the Render spec is ambiguous in this area and allows us to to ignore the recursive case. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Adam Jackson <ajax@redhat.com>
2010-06-05Rename region macros to eliminate screen argumentKeith Packard1-3/+3
This is a combination of a huge mechanical patch and a few small fixups required to finish the job. They were reviewed separately, but because the server does not build without both pieces, I've merged them together at this time. The mechanical changes were performed by running the included 'fix-region' script over the whole tree: $ git ls-files | grep -v '^fix-' | xargs ./fix-region And then, the white space errors in the resulting patch were fixed using the provided fix-patch-whitespace script. $ sh ./fix-patch-whitespace Thanks to Jamey Sharp for the mighty fine sed-generating sed script. The hand-done changes involve removing functions from dix/region.c that duplicate inline functions in include/regionstr.h, along with their declarations in regionstr.h, mi.h and mispans.h. Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Keith Packard <keithp@keithp.com>
2010-04-19unifdef -B -DRENDER to always include RENDER codeKeith Packard1-8/+0
This patch was created with: git ls-files '*.[ch]' | while read f; do unifdef -B -DRENDER -o $f $f; done Signed-off-by: Keith Packard <keithp@keithp.com>
2010-01-27Fix source pictures getting random transforms after 2d6a8f668342a5190cdf43b5.Pierre-Loup A. Griffais1-0/+1
*xoff and *yoff were uninitialized for source-only pictures.x Signed-off-by: Pierre-Loup A. Griffais <pgriffais@nvidia.com> Reviewed-by: Aaron Plattner <aplattner@nvidia.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-12-11fb: Adjust transform or composite coordinates for pixman operationsKeith Packard1-22/+49
Windows (or even pixmaps, in some cases) may not sit at the origin of the containing pixmap, so any coordinates relative to the drawable must be adjusted. For destinations and untransformed sources, the operation coordinates are adjusted. For transformed sources, the transform matrix is adjusted. Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Soeren Sandmann <sandmann@daimi.au.dk>
2009-12-11Revert "Fix clipping when windows are used as sources"Keith Packard1-97/+20
This reverts commit e9aa61e9f0d663d5b34a397b943b4d1df44e873d. Conflicts: fb/fbpict.c Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Soeren Sandmann <sandmann@daimi.au.dk>
2009-12-11Revert "Use IncludeInferiors when copying windows before compositing."Keith Packard1-4/+3
This reverts commit 7c7f0c2c6a04f7044d5ce69e97a615735e5831f1. Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Soeren Sandmann <sandmann@daimi.au.dk>
2009-12-11Revert "Reserve space for two GC values in copy_drawable()."Keith Packard1-1/+1
This reverts commit 08df24555cb432eb0d90a3f63275e9485e777c4c. Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Soeren Sandmann <sandmann@daimi.au.dk>
2009-12-11Revert "fb: Don't crash if copy_drawable() returns NULL."Keith Packard1-4/+2
This reverts commit 66a9616d645f5a23225251d197e00b94c79274f6. Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Soeren Sandmann <sandmann@daimi.au.dk>
2009-11-30fb: Don't crash if copy_drawable() returns NULL.Michel Dänzer1-2/+4
Fixes http://bugs.freedesktop.org/show_bug.cgi?id=24634 . Signed-off-by: Michel Dänzer <daenzer@vmware.com> Signed-off-by: Keith Packard <keithp@keithp.com>
2009-09-14Add xoff and yoff to drawable->x and drawable->y in create_bits_picture().Soeren Sandmann1-1/+3
These are 0, except when the drawable is a redirected window. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2009-07-09Reserve space for two GC values in copy_drawable().Soren Sandmann Pedersen1-1/+1
Pointed out by Pierre Willenbrock.
2009-07-06Use IncludeInferiors when copying windows before compositing.Søren Sandmann Pedersen1-3/+4
Part of bug 22484.
2009-06-18Fix clipping when windows are used as sourcesSøren Sandmann Pedersen1-21/+97
The new clipping rules: - client clips happen after transformation - pixels unavailable due to the hierarchy are undefined The first one is implemented in pixman; the second one is realized by making a copy of window sources (to prevent out-of-bounds access).
2009-05-10Make compositing with transformed windows work again.Søren Sandmann Pedersen1-16/+8
The coordinate translation was broken in pretty much every way imaginable.
2008-12-03Rework symbol visibility for easier maintenancePaulo Cesar Pereira de Andrade1-6/+6
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-11-29Export symbols defined in the sdk.Paulo Cesar Pereira de Andrade1-6/+6
This is the biggest "visibility" patch. Instead of doing a "export" symbol on demand, export everything in the sdk, so that if some module fails due to an unresolved symbol, it is because it is using a symbol not in the sdk. Most exported symbols shouldn't really be made visible, neither advertised in the sdk, as they are only used by a single shared object. Symbols in the sdk (or referenced in sdk macros), but not defined anywhere include: XkbBuildCoreState() XkbInitialMap XkbXIUnsupported XkbCheckActionVMods() XkbSendCompatNotify() XkbDDXFakePointerButton() XkbDDXApplyConfig() _XkbStrCaseCmp() _XkbErrMessages[] _XkbErrCode _XkbErrLocation _XkbErrData XkbAccessXDetailText() XkbNKNDetailMaskText() XkbLookupGroupAndLevel() XkbInitAtoms() XkbGetOrderedDrawables() XkbFreeOrderedDrawables() XkbConvertXkbComponents() XkbWriteXKBSemantics() XkbWriteXKBLayout() XkbWriteXKBKeymap() XkbWriteXKBFile() XkbWriteCFile() XkbWriteXKMFile() XkbWriteToServer() XkbMergeFile() XkmFindTOCEntry() XkmReadFileSection() XkmReadFileSectionName() InitExtInput() xf86CheckButton() xf86SwitchCoreDevice() RamDacSetGamma() RamDacRestoreDACValues() xf86Bpp xf86ConfigPix24 xf86MouseCflags[] xf86SupportedMouseTypes[] xf86NumMouseTypes xf86ChangeBusIndex() xf86EntityEnter() xf86EntityLeave() xf86WrapperInit() xf86RingBell() xf86findOptionBoolean() xf86debugListOptions() LoadSubModuleLocal() LoaderSymbolLocal() getInt10Rec() xf86CurrentScreen xf86ReallocatePciResources() xf86NewSerialNumber() xf86RandRSetInitialMode() fbCompositeSolidMask_nx1xn fbCompositeSolidMask_nx8888x0565C fbCompositeSolidMask_nx8888x8888C fbCompositeSolidMask_nx8x0565 fbCompositeSolidMask_nx8x0888 fbCompositeSolidMask_nx8x8888 fbCompositeSrc_0565x0565 fbCompositeSrc_8888x0565 fbCompositeSrc_8888x0888 fbCompositeSrc_8888x8888 fbCompositeSrcAdd_1000x1000 fbCompositeSrcAdd_8000x8000 fbCompositeSrcAdd_8888x8888 fbGeneration fbIn fbOver fbOver24 fbOverlayGeneration fbRasterizeEdges fbRestoreAreas fbSaveAreas composeFunctions VBEBuildVbeModeList() VBECalcVbeModeIndex() TIramdac3030CalculateMNPForClock() shadowBufPtr shadowFindBuf() miRRGetScreenInfo() RRSetScreenConfig() RRModePruneUnused() PixmanImageFromPicture() extern int miPointerGetMotionEvents() miClipPicture() miRasterizeTriangle() fbPush1toN() fbInitializeBackingStore() ddxBeforeReset() SetupSprite() InitSprite() DGADeliverEvent() SPECIAL CASES o defined as _X_INTERNAL xf86NewInputDevice() o defined as static fbGCPrivateKey fbOverlayScreenPrivateKey fbScreenPrivateKey fbWinPrivateKey o defined in libXfont.so, but declared in xorg/dixfont.h GetGlyphs() QueryGlyphExtents() QueryTextExtents() ParseGlyphCachingMode() InitGlyphCaching() SetGlyphCachingMode()
2008-05-20fb: shut up two compiler warnings.Peter Hutterer1-1/+1
2007-08-23Revert "Revert "Require pixman 0.9.5; Use pixman_image_set_source_clipping() ↵Søren Sandmann Pedersen1-0/+1
to fix"" since the pixman changes have been pushed now. This reverts commit 57f7f2a5327a2d967a726bb4706e4f6b2f4b2cea.
2007-08-22Revert "Require pixman 0.9.5; Use pixman_image_set_source_clipping() to fix"Eric Anholt1-1/+0
The corresponding pixman code hasn't been pushed, so revert until the code is ready. This reverts commit 53941c8e68014619d3ded7f8bc0f07d9a38bb9b1.
2007-08-21Require pixman 0.9.5; Use pixman_image_set_source_clipping() to fixSøren Sandmann Pedersen1-0/+1
bug 11620 (reported by Jens Stroebel.
2007-08-16stride is in FbBits-sized chunks, but xoff is not.Aaron Plattner1-3/+3
Fixes corruption problems with composite rendering to redirected windows in depth 16.
2007-08-06Don't unwrap too early in libwfb for Composite.Aaron Plattner1-11/+12
Don't call fbFinishWrap until the pixman_image_t that stores the pointer is actually freed. This prevents corruption or crashes caused by accessing a wrapped pointer after the wrapping is torn down.
2007-07-11"fbpict.c", line 215: void function cannot return valueAlan Coopersmith1-1/+1
2007-06-11Replace fbFillmmx() with pixman_fill() and remove fbmmx.[ch]Søren Sandmann Pedersen1-201/+0
2007-06-11Don't pass regions to pixman_image_composite() anymore.Søren Sandmann Pedersen1-140/+140
2007-06-03Include pixman.h from fb.h or compile of some files will failBenjamin Herrenschmidt1-1/+0
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2007-05-23- Make image_from_pict() non-staticSoren Sandmann Pedersen1-113/+117
- Delete fbedge.c and fbedgeimp.h - Use pixman_rasterize_edges() in fbtrap.c
2007-05-23Add missing offsets for window coordinates - reported by Colin HarrisonSoren Sandmann Pedersen1-0/+13
2007-05-21Remove fast path code from fbpict.cSoren Sandmann Pedersen1-1506/+23
Remove the various fast path functions from fbpict, and instead use pixman_image_composite().
2007-05-18Use pixman_image_set_indexed() to make 8 bit workSoren Sandmann Pedersen1-0/+4
2007-05-18Move fbCompositeGeneral() to fbpict.c and remove fbcompose.cSoren Sandmann Pedersen1-44/+19
2007-05-18Break image_from_pict() into a few subfunctions.Soren Sandmann Pedersen1-183/+189
2007-05-18Make the general compositing code create a pixman image and callSoren Sandmann Pedersen1-2/+232
pixman_image_composite(). Leave the general code commented out for now.
2007-05-15Revert various fast path functions to their pre-pixman-merge stateSoren Sandmann Pedersen1-515/+36
since they fail rendercheck. Remove their associated macros. See bug 10903.
2007-05-03New fbWalkCompositeRegion() functionSoren Sandmann Pedersen1-95/+110
This new function walks the composite region and calls a rectangle compositing function on each compositing rectangle. Previously there were buggy duplicates of this code in fbcompose.c and miext/rootles/safealpha/safeAlphaPicture.c.
2007-05-03Add fbCompositeRect() as another special case in the switch of doom in fbpict.cSoren Sandmann Pedersen1-14/+52
This is phase one of getting the two region walkers in fbcompose.c and fbpict.c merged together.
2007-04-29Fix fbCompositeTrans_0888xnx0888 build for wfb on big endian.Michel Dänzer1-1/+1
2007-04-29Fix a couple of picture repeat fields incorrectly compared to RepeatNormal.Michel Dänzer1-1/+1
2007-04-26Pixman mergeSoren Sandmann Pedersen1-1/+6
Make use of fbCompositeSrcAdd_8888x8x8mmx
2007-04-26Pixman mergeSoren Sandmann Pedersen1-23/+65
- Remove stray default label - Integrate new MMX ops SolidMaskSrc_nx8x8888mmx, In_8x8mmx, and In_nx8x8mmx - Formatting changes to reduce diff noise
2007-04-26Pixman mergeSoren Sandmann Pedersen1-33/+44
Make sure fbCompositeSrc_x888x8x8888mmx and fbCompositeSrc_8888x8x8888mmx are used when possible.