createPlatformWindowSurface fails and returns NO_SURFACE which
aborts the program.
Nvidia doesn't seem to support EGL_BUFFER_SIZE 32 with opengl es,
and it seems like we dont need it anyways?
* README: Document changes.
* compositor.h (struct _BufferFuncs): Rename `get_render_device'
to `get_render_devices' and make it return a list of providers.
* dmabuf.c (MakeFeedback): Send 1 tranche for each device.
(InitDrmDevice): Rename to InitDrmDevices. Set up for multiple
devices.
(WriteFormatTable): Adjust call accordingly.
* egl.c (GetRenderDevice): Remove function.
(GetRenderDevices): New function.
(egl_buffer_funcs): Change accordingly.
* output.c (XLInitRROutputs): Require RandR 1.4.
* picture_renderer.c (GetRenderDevice): Remove calls to open.
(GetRenderDevices): New function.
(picture_buffer_funcs): Adjust accordingly.
* renderer.c (RenderGetRenderDevice): Delete function.
(RenderGetRenderDevices): New function.
* egl.c (UpdateBuffer): Fix coding style.
* subcompositor.c (IsPreviouslyTransformed)
(SetPreviouslyTransformed, ClearPreviouslyTransformed): New
macros.
(ViewSetTransform): Mark damage as untrusted until the next time
the buffer is uploaded.
(ApplyBufferDamage, ApplyUntransformedDamage): Upload entire
buffer upon untrusted damage.
* compositor.h (XLAssert): Make a macro.
* dnd.c (HandleCirculateNotify, HandleReparentNotify): Fix NULL
checks.
(ReadProtocolProperties): Return suitable values for windows
that aren't in the cache.
* egl.c (HaveEglExtension1): Avoid redundant assignment to n.
* fns.c (XLAssert): Delete function.
* picture_renderer.c (GetRenderDevice): Remove redundant TODO.
(BufferFromShm): Assert that pict_format is non-NULL.
(ValidateShmParams): Likewise.
* pointer_constraints.c (ApplyLines): Remove redundant
assignment to i.
* renderer.c (PickRenderer): Fix build with non-GCC compilers.
* seat.c (ComputeHotspot): Return values when surface is NULL.
(XLSeatExplicitlyGrabSurface): Don't save keyboard grab state.
* shm.c (CreatePool): Close fd and return if pool could not be
allocated.
* subcompositor.c (GetContentScale): Move earlier.
(ViewDamageBuffer, ViewGetContentScale): New functions.
(SubcompositorUpdate): Remove redundant assignment.
* surface.c (ApplyViewport): Make dest_width and dest_height
double.
(ApplyDamage): Call ViewDamageBuffer.
(ScaleToWindow):
* text_input.c (HandleNewIM):
* xdg_toplevel.c (SendDecorationConfigure1, HandleWmStateChange)
(HandleAllowedActionsChange, HandleDecorationResourceDestroy):
Avoid NULL pointer dereferences in various cases.
* compositor.h (struct _RenderFuncs): Accept damage in
finish_render.
* egl.c (EglInitFuncs): Load eglSwapBuffersWithDamageEXT.
(FinishRender): Accept damage and swap only damaged area if
possible.
(UpdateBuffer): Always update textures.
* explicit_synchronization.c (XLSyncRelease): Fix comment.
* renderer.c (RenderFinishRender): Accept damage argument.
* subcompositor.c (ViewWidth, ViewHeight): Fix computation of
destination width and height when there is a content scale;
those values have already been adjusted into window coordinates.
(SubcompositorUpdate, SubcompositorExpose): Pass damage to
RenderFinishRender.
* surface.c (ApplyDamage): Fix some aspects of damage
calculation.
* xdg_surface.c (IsRoleMapped): Fix crash when destroying client
with subsurfaces.
(Commit, NoteBounds, ResizeForMap, XLXdgRoleSendConfigure)
(XLXdgRoleSetBoundsSize, XLXdgRoleResizeForMap): Really fix
window state reverting to maximized during unmaximization. This
had two causes: the first was that the window geometry would be
set even before ack_configure, which was fixed by moving setting
the window geometry into NoteBounds, and the second was that
NoteBounds would sometimes resize the window back to its old
dimensions if a commit (or subsurface update) happened between
SetBoundsSize and the configure event arriving, also confusing
the window manager.
* xdg_toplevel.c (NoteConfigureTime): Fix coding style.
(HandleConfigureEvent): Call SetBoundsSize before posting the
configure event.
* 12to11.c (XLMain): Initialize wp_viewporter.
* Imakefile (ETAGS): Remove unused variable.
(SRCS, OBJS): Add wp_viewporter.c and wp_viewporter.o.
(GENHEADERS): Remove unnecessary headers.
(viewporter): New scanner target.
* README: Document support for wp_viewporter.
* compositor.h (struct _ViewportExt): New forward declaration.
(struct _DrawParams): New fields for cropping and stretching.
(struct _RenderFuncs): Describe how composite works.
(struct _BufferFuncs): Make update_buffer_for_damage take
DrawParams as an argument.
(struct _State): New fields for viewporting.
(struct _Surface): New field `viewport' and associated input
delta.
(struct _XdgRoleImplementationFuncs): New field
`is_window_mapped'. Do not commit while unmapped.
* dmabuf.c (XLInitDmabuf): Remove outdated comment.
* dnd.c (HandleMotion): Use TruncateWindowToSurface.
* egl.c (struct _EglBuffer): Add 3x3 reverse transformation
matrix.
(struct _CompositeProgram): Rename `scale' to `source'.
(Index): New macro.
(PickBetterVisual, FindVisual): Compensate for EGL picking a
non-RGBA visual.
(EglCompileCompositeProgram): Look for source, not scale.
(ComputeTransformMatrix): New function.
(Composite): Compute transformation matrix and draw using that.
(BufferFromDmaBuf, BufferFromShm): Copy identity transform and
stop setting scale.
(ReverseTransformToBox): New function.
(UpdateShmBufferIncrementally): Accept DrawParams and invert
damage according to that.
(UpdateBuffer, UpdateBufferForDamage): Pass draw params to the
incremental buffer update function.
* fns.c (XLExtendRegion): New function.
* frame_clock.c (CurrentHighPrecisionTimestamp): Delete
function.
(HighPrecisionTimestamp, HighPrecisionTimestamp32): New
functions.
(PostEndFrame): Handle X server time truncation to 32 bits.
(XLFrameClockFreeze): Remove trailing whitespace.
* picture_renderer.c (GetSourceX, GetSourceY, CompareStretch):
New functions.
(MaybeApplyTransform): Check more values before applying
transformations. Then, handle stretch and offset.
* positioner.c (GetAdjustmentOffset, ApplyConstraintAdjustment)
(XLPositionerCalculateGeometry): Scale coordinates using new
functions.
* renderer.c (RenderUpdateBufferForDamage): Accept DrawParams
instead of scale.
* shaders.txt (Composite Rectangle Fragment Shader RGBA)
(Composite Rectangle Fragment Shader RGBX)
(Composite Rectangle Fragment Shader External): Stop
transforming texcoords.
(Composite Rectangle Vertex Shader): Transform texcoords in the
vertex shader instead.
* subcompositor.c (IsViewported, SetViewported,
ClearViewported): New functions.
(struct _View): New fields for tracking viewports and fractional
offsets.
(ViewAttachBuffer): Do not garbage upon buffer size change if a
viewport is set.
(ViewMoveFractional): New function.
(ViewDamage): Describe what the damage is and is not transformed
by.
(GetContentScale): New function.
(ViewWidth, ViewHeight): Apply viewport.
(ViewSetScale): Use ViewAfterSizeUpdate instead of duplicating
code.
(ViewSetViewport, ViewClearViewport): New functions.
(ViewComputeTransform): Compute transform for viewports. New
arg draw; use it to determine whether or not to include a
fractional offset.
(IntersectBoxes): Fix intersection calculation.
(SubcompositorUpdate): Don't keep calling ViewWidth and
ViewHeight in a loop.
(SubcompositorExpose): Adjust for changes to buffer damage
uploading.
* subsurface.c (MoveFractional): New function. Handle
fractional offsets after scaling.
(MaybeUpdateOutputs, AfterParentCommit, Setup, Rescale): Use
that function to move the subsurface instead.
* surface.c (ApplyScale): Update comment.
(ApplyViewport, CheckViewportValues): New functions.
(HandleScaleChanged): Apply the viewport as well upon scale
change.
(ApplyDamage): Improve damage calculation for viewported
surfaces.
(SavePendingState, InternalCommit): Save and commit viewport
state; check old values upon buffer commit.
(InitState): Initialize viewport to initial values.
(XLSurfaceRunFrameCallbacks): Handle overflows of 32-bit time at
the 49-day mark.
(SurfaceToWindow, ScaleToWindow, WindowToSurface, ScaleToSurface)
(TruncateScaleToWindow, TruncateScaleToWindow)
(TruncateWindowToSurface, TruncateScaleToSurface): New functions
for handling scale.
* xdg_popup.c (MoveWindow, IsWindowMapped, XLGetXdgPopup):
* xdg_surface.c (IsRoleMapped, Commit, Subframe)
(GetResizeDimensions, XLXdgRoleCalcNewWindowSize):
* xdg_toplevel.c (IsWindowMapped, NoteConfigureTime, SendStates)
(RecordStateSize, HandleWindowGeometryChange, NoteWindowPreResize)
(XLGetXdgToplevel): Use them instead of manually multiplying
with the factor.
* egl.c (TargetFromPixmap): Set new `IsPixmap' flag.
(FinishRender): Call glFinish on single-buffered pixmap surface.
* picture_renderer.c (HavePixmapFormat): New function.
(FindSupportedFormats): Check that the relevant pixmap format is
supported.
(DepthForFormat): Return bpp in new bpp argument.
(BufferFromShm): Adjust accordingly.
(GetScanlinePad): New function.
(Roundup): New macro.
(ValidateShmParams): Take into account bytes per pixel and
scanline pad.
(SetupMitShm): Require pixmap formats mandated by Wayland
specification.
(InitBufferFuncs): Initialize supported pixmap formats.
* seat.c (CursorRingElements, CursorRingBusy): New macros.
(struct _CursorRing): New struct.
(struct _SeatCursor): Assign cursor ring to seat cursor.
(MakeCursorRing, MaybeCreateCursor, GetUnusedCursor)
(FreeCursorRing, ResizCursorRing): New functions for managing a
ring of cursor render targets.
(UpdateCursorOutput, FreeCursor, UpdateCursorFromSubcompositor)
(ApplyEmptyCursor, Subframe, EndSubframe): Use cursors provided
by that ring to avoid creating new render targets while
animating cursors.
* 12to11.c (XLMain): Initialize explicit synchronization.
* Imakefile (SRCS, OBJS): Remove generated files.
(ScannerTarget): New macro.
(clean): Clean GENSRCS as well.
(linux-dmabuf-unstable-v1.h):
(linux-dmabuf-unstable-v1.c):
(xdg-shell.h):
(xdg-shell.c):
(primary-selection-unstable-v1.h):
(primary-selection-unstable-v1.c): Remove and replace with
ScannerTarget.
* README: Announce explicit synchronization support.
* compositor.h (union _RenderFence): New union.
(struct _RenderFuncs): Add fence functions.
(struct _Surface): New fields for explicit synchronization
objects and release callbacks.
* egl.c (EglInitFuncs, EglInitGlFuncs, EglInitDisplay):
Initialize functions and extensions used for explicit
synchronization, and set render func flags.
(ImportFdFence, WaitFence, DeleteFence, HandleFenceReadable)
(GetFinishFence): New functions.
(egl_render_funcs): Add those functions.
(AddRenderFlag): New function.
* fns.c (MaybeInstallBusHandler): Fix coding style.
* picture_renderer.c (ImportFdFence, WaitFence, DeleteFence)
(GetFinishFence): New stubs.
(picture_render_funcs): Add those functions; they should never
be called.
* renderer.c (RenderImportFdFence):
(RenderWaitFence):
(RenderDeleteFence):
(RenderGetFinishFence): New wrapper functions.
* run.c (struct _PollFd, XLAddWriteFd, XLAddReadFd): Add pollfd
field to callback args.
(RunStep): Pass them to callbacks. Also, fix a comment.
* surface.c (DoRelease): New function.
(DestroySurface): Clear release if possible.
(SavePendingState, TryEarlyRelease): Extract release code to
DoRelease.
(InternalCommit): Wait for sync fences before continuing.
(Commit): Close acquire fence and release sync release object.
(HandleSurfaceDestroy): Destroy release callback and close
acquire fence.
(XLCreateSurface): Clear acquire fence field with right initial
value.
* xdata.c (NoticeTransferWritable):
(NoticeTransferReadable):
(NoticeConversionTransferReadable):
(NoticeConversionTransferWritable): Adjust arguments for new
callback data.
* 12to11.c (MakeColormap): Delete function.
(XLMain): Stop making colormap here.
* compositor.h (ImmediateRelease): New flag.
(struct _BufferFuncs): New field can_release_now.
(struct _State): New flag `BufferAlreadyReleased'.
* egl.c (struct _CompositeProgram): New field `invert_y'.
(EglCompileCompositeProgram): Get new uniform index.
(Composite): Apply InvertY.
(egl_render_funcs): Set ImmediateRelease flag.
(BufferFromDmaBuf): Set InvertY flag if set.
(UpdateTexture, UpdateShmBufferIncrementally): Set CanRelease
flag on SHM buffers.
(UpdateBuffer): Don't update if damage is empty.
(CanReleaseNow): New function.
(egl_buffer_funcs): Add CanReleaseNow.
* picture_renderer.c (MakeCheckWindow): New function.
(FindSupportedModifiers): Use a more similar window to look for
modifiers.
(CanReleaseNow): New function.
(picture_buffer_funcs): Add CanReleaseNow.
* renderer.c (RenderCanReleaseNow): New wrapper function.
(InstallRenderer): Create colormaps here, so the buffer init
function can get it.
* shaders.txt (Composite Rectangle Fragment Shader RGBA)
(Composite Rectangle Fragment Shader RGBX)
(Composite Rectangle Fragment Shader External): New uniform
`invert_y'.
(main): Use it.
* subcompositor.c (SubcompositorUpdate): Always update attached
buffer from damage, even if damage is empty.
* surface.c (TryEarlyRelease): New function.
(InternalCommit): Call it. Also, do not call role
release_buffer hook if ImmediateRelease is specified by the
renderer.
(SavePendingState): Likewise, release buffers immediately if
possible.
* egl.c (struct _EglBuffer): New field `scale'. Save the
projective scale here.
(struct _CompositeProgram): New field `scale'. Save the index
of new uniform here.
(EglCompileCompositeProgram): Fetch location of new uniform.
(ApplyTransform): Set scale.
(Composite): Apply value of new uniform.
(BufferFromDmaBuf, BufferFromShm): Initialize scale to 0.
(UpdateBufferForDamage): Scale damage if it and damage are set.
* shaders.txt (Composite Rectangle Fragment Shader RGBA)
(Composite Rectangle Fragment Shader RGBX)
(Composite Rectangle Fragment Shader External): New uniform
`scale'.
(main): Divide texcoord by scale.