Implement buffer transforms on the XRender backend

* 12to11.conf (XSHMFENCELIB): New library.
* 12to11.man: Document that surface transforms are now
supported.
* Imakefile (LOCAL_LIBRARIES): Add XSHMFENCELIB.
(SRCS, OBJS): Add fence_ring.c and fence_ring.o.
* README: Require xshmfence.
* buffer.c: Include stdio.h.
* compositor.h (enum _BufferTransform): New enum.
(struct _DrawParams): Add TransformSet.
(RotatesDimensions): New macro.
(struct _State): Add buffer transform.
* egl.c: Add TODO for buffer transforms.
* fns.c (TransformBox, XLTransformRegion): New functions.
* picture_renderer.c (struct _BufferActivityRecord): New field
`fence'.
(struct _PictureBuffer): Add buffer width and height.
(struct _DmaBufRecord, RecordBufferActivity, UnlinkActivityRecord)
(DestroyRenderTarget, GetBufferTransform, MaybeApplyTransform)
(Composite, FinishRender, BufferFromDmaBuf, FinishDmaBufRecord)
(BufferFromDmaBufAsync, BufferFromShm, FreeAnyBuffer): Record
width and height, and handle transforms; add some disabled
fencing code.
* subcompositor.c (struct _View): Add transform.  Rearrange
fields for alignment.
(MakeView): Initialize transform.
(InvertTransform): New function.
(BufferWidthAfterTransform, BufferHeightAfterTransform)
(TransformBufferDamage): New functions.
(ViewDamageBuffer): Transform buffer damage if necessary.
(ViewWidth, ViewHeight): Use width and height after transform.
(ViewComputeTransform): Apply transform.
* surface.c (ApplyBufferTransform): New function.
(ApplyViewport, CheckViewportValues, SavePendingState)
(InternalCommit, GetBufferTransform, SetBufferTransform,
InitState): Initialize and handle transforms.
(XLStateAttachBuffer, XLStateDetachBuffer): Delete unused
functions.
* time.c (InitTime): Require a newer version of the Sync
extension.
* transform.c (MatrixRotate, MatrixMirrorHorizontal): New
functions.
This commit is contained in:
hujianwei 2022-10-25 10:15:28 +00:00
parent 65a2e4de5b
commit 768f2d98b5
13 changed files with 596 additions and 64 deletions

View file

@ -11,7 +11,7 @@ DEPLIBS = $(DEPXLIB) $(DEPEXTENSIONLIB) $(DEPXRANDRLIB) $(DEPXRENDERLIB) \
LOCAL_LIBRARIES = $(XLIB) $(EXTENSIONLIB) $(XCBLIB) $(XCB) $(XCB_SHM) \
$(XRANDRLIB) $(PIXMAN) $(XRENDERLIB) $(XILIB) $(XKBFILELIB) $(XFIXESLIB) \
$(XCB_DRI3) $(XCB_SHAPE) $(WAYLAND_SERVER) $(XCB_RANDR) $(DRM) \
$(XPRESENTLIB)
$(XPRESENTLIB) $(XSHMFENCELIB)
INCLUDES := $(DRMINCLUDES) $(PIXMANINCLUDES)
@ -25,7 +25,7 @@ SRCS = 12to11.c run.c alloc.c fns.c output.c compositor.c \
wp_viewporter.c decoration.c text_input.c \
single_pixel_buffer.c drm_lease.c pointer_constraints.c \
time.c relative_pointer.c keyboard_shortcuts_inhibit.c \
idle_inhibit.c process.c
idle_inhibit.c process.c fence_ring.c
OBJS = 12to11.o run.o alloc.o fns.o output.o compositor.o \
surface.o region.o shm.o atoms.o subcompositor.o positioner.o \
@ -37,7 +37,7 @@ OBJS = 12to11.o run.o alloc.o fns.o output.o compositor.o \
wp_viewporter.o decoration.o text_input.o \
single_pixel_buffer.o drm_lease.o pointer_constraints.o \
time.o relative_pointer.o keyboard_shortcuts_inhibit.o \
idle_inhibit.o process.o
idle_inhibit.o process.o fence_ring.o
GENHEADERS = transfer_atoms.h