Commit Graph

1457 Commits

Author SHA1 Message Date
Bernd Busse
33c5a5a36b Add support for new blur method dual_kawase [WIP]
**Work-in-Progress**

Add `dual_kawase` to configuration and argument parsing. Allow `kawase`
for backward compatibility. Add `--blur-strength` parameter for
blur-method `dual_kawase`.

Update documentation to reflect the new blur-method and parameters.
2020-08-31 14:06:17 +02:00
Bernd Busse
0000cc1d98 backend: gl_common: support arbitrary number of aux. blur textures/fbos
Support an arbitrary number of auxiliary textures and framebuffers for
blur. Preparation for the dual-filter kawase algorithm.
2020-08-31 14:06:17 +02:00
yshui
ceb9b7f1f2 Merge pull request #476 from tonijarjour/next
Update picom.sample.conf
2020-08-30 22:05:17 +01:00
Toni Jarjour
7f1c08907d picom.sample.conf: remove deprecated options 2020-08-30 22:02:41 +01:00
Yuxuan Shui
5ebac238e2 Remove documentation, usage messages and examples about sw-opti
It have been deprecated.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-08-30 21:26:19 +01:00
Yuxuan Shui
24f0241907 gitignore: ignore language server indices
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-08-30 17:57:05 +01:00
Yuxuan Shui
9c7b8597e0 core: rename _draw_callback to draw_callback_impl
All names start with underscore are reserved in C.

Also just testing out the language server's renaming feature.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-08-30 17:44:21 +01:00
Yuxuan Shui
8c1b0657ff Refresh the TODO comments
Removed the outdated ones, clarified some of them, and assigned them to
me.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-08-30 15:25:58 +01:00
Yuxuan Shui
cdb9765802 Add a .clang-tidy file
We currently don't use it for anything. We could add a CI pass in the
future.

We don't enable clang-analyzer checks. The checks enabled here should
mostly be syntax/style linting only, and should be cheap to run.
clang-analyzer checks are usually compute-intensive, and can easily be run
separately anyway, with scan-build and such.

The list of checks definitely isn't final.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-08-30 14:42:39 +01:00
Yuxuan Shui
0574e63658 Be explicit when checking XCB_NONE
Obvisouly this commit only cover a tiny portion of these checks.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-08-30 14:10:26 +01:00
Yuxuan Shui
617503a5de core: use a long-lived XFixes region
This is a workaround for #301. This doesn't fix the bug, but by
allocating X resources much less frequently, this should make the
bug almost never happen.

Also, it might generally be a good idea to not create/destroy X
resources so often. (XFixes Region accounts for >99% of the resource
creations/destructions)

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-08-30 09:17:20 +01:00
Bernd Busse
7077609c01 c2: correctly initialize new branch for combined rule 2020-08-29 16:27:56 +02:00
Yuxuan Shui
5207996232 picom-trans: fixes when setting transparency with window id
Two problems:

1) the regex used to match the wid in the window tree can match the wid
   appearing in window titles as well.
2) instead of picking the parent window of the target window to set
   transparency, a random window which is listed just below the target
   window will be chosen. not sure why was there a + 1.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-08-25 19:21:31 +01:00
Yuxuan Shui
933f2cfe80 diagnostics: improve driver printing
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-08-25 06:54:10 +01:00
Yuxuan Shui
1f65d88858 x: add more picture helper functions
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-08-19 23:39:50 +01:00
Yuxuan Shui
4c1360f92a render: add trapezoid helper functions
Add functions to create shapes like rectangles and circles using xcb
trapezoids.

Contributed-by: Samuel Hand <samuel.d.hand@gmail.com>
2020-08-19 23:39:35 +01:00
Yuxuan Shui
2b677c8fc4 options: support shadow-color as a commandline option
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-08-18 02:39:43 +01:00
Yuxuan Shui
e90bd92a53 config: remove unused shadow_color variable
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-08-18 02:35:57 +01:00
Yuxuan Shui
3ae21aa9a3 config: rename shadow-hex to shadow-color
It's not directly clear from the name "shadow-hex" that it's related to
color.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-08-18 02:28:01 +01:00
yshui
f99be829d1 Merge pull request #454 from adelin-b/feat/shadowHex
add shadow-hex option
2020-08-18 02:23:49 +01:00
adelin-b
a4a7b25436 config: add shadow-hex option
This allows the user to specify the shadow color via a single option,
instead of specifying red, green and blue separately.
2020-08-18 02:18:13 +01:00
yshui
6eb6a247a5 Merge pull request #428 from tryone144/better-blur-texture-sampling
Better blur texture sampling (in experimental backends)
2020-08-04 16:54:45 +01:00
yshui
3913920572 Merge pull request #457 from zilrich/patch-1
Remove deprecated options from picom.sample.conf
2020-08-04 16:09:17 +01:00
zilrich
fe27ddf8f5 update picom.sample.conf
Remove deprecated menu-opacity option from sample config.
2020-08-02 09:27:49 +00:00
Bernd Busse
7cf13906ae backend: xrender: use correct REPEAT mode when creating blur textures
Create pictures used for bluring with REPEAT attribute set to PAD (same logic
as GL_CLAMP_TO_EDGE in OpenGL). Fixes darkening at the screen edges with
larger blur radii caused by sampling out of texture bounds.

Related: 4b0ff37b36
2020-06-08 20:40:02 +02:00
Bernd Busse
88b1638487 backend: gl_common: Use linear interpolation on GPU for blur kernels.
Make use of hardware linear interpolation in a GPU to sample 2 pixels
with a single texture access inside the blur shaders by sampling between
both pixels based on their relative weight.

This is significantly easier for a single dimension as 2D bilinear
filtering would raise additional constraints on the kernels (not single
zero-entries, no zero-diagonals, ...) which require additional checks
with limited improvements. Therfore, only use interpolation along the
larger dimension should be a sufficient improvement.

Using this will effectively half the number of texture accesses and
additions needed for a kernel. E.g. a 1D-pass of the gaussian blur
with radius 15 will only need 16 samples instead of 31.
2020-06-08 20:32:46 +02:00
Bernd Busse
4b0ff37b36 backend: gl_common: Use texture2D with filtering and clamping in blur
Create texture with GL_LINEAR filtering and GL_CLAMP_TO_EDGE wrapping. Change
`texelFetch()`-call in fragement shader to `texture2D()` to be taken into
account. This requires supplying the size of a pixel in normalized texture
coordinates via an additional uniform.

Fixes darkening at the screen edges with larger blur radii caused by
sampling coordinates being out of texture bounds. This is undefined behaviour
unless the context has set the flag *GL_ARB_robust_buffer_access_behaviour*,
in which case "zero"-pixels are returned (i.e. black). Current behaviour
seems to depend on the driver.
2020-06-08 20:31:32 +02:00
yshui
fd6ff8264c Merge pull request #422 from jbeich/dragonfly
Unbreak build on DragonFly and OpenBSD
2020-06-06 15:14:14 +01:00
yshui
38b9d41f46 Merge pull request #423 from orbea/man
meson: Respect mandir.
2020-06-06 15:12:18 +01:00
yshui
00a0d27007 Merge pull request #424 from orbea/compton
meson: Allow building without compton compat.
2020-06-06 15:11:48 +01:00
orbea
c2d8072343 meson: Respect mandir. 2020-05-28 07:24:37 -07:00
orbea
b74f9d7616 meson: Allow building without compton compat. 2020-05-28 07:05:05 -07:00
Jan Beich
78223caea3 build: make Meson treat kqueue conditional as one
src/meson.build:82:3: ERROR: Unknown statement.
2020-05-28 10:07:58 +00:00
Yuxuan Shui
0b377537ec backend: gl_common: no need to store maximum viewport size
Just get it from GL_MAX_VIEWPORT_DIMS

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-24 19:14:35 +01:00
yshui
77d733f521 Merge pull request #389 from tryone144/glviewport-max
gl_common: Set `glViewport()` once at startup
2020-04-24 19:09:52 +01:00
Bernd Busse
74094e3c04 gl_common: Remove superfluous calls to glViewport
Call `glViewport()` once when initializing the backend with the maximum
supported dimensions. Since all shaders are equipped with the
corresponding projection matrix, the viewport does not have to be
updated prior to each draw call.

Related: a7bd48f5ab
2020-04-24 14:40:24 +02:00
Bernd Busse
553783869a gl_common: Wrong viewport in gl_average_texture_color()
Set viewport in `gl_average_texture_color()` to global `vp_width` and
`vp_height` as the projection matrix has been initialized to these dimensions
as well.

Related: a7bd48f5ab
2020-04-24 14:40:04 +02:00
yshui
b94fe5271c Merge pull request #388 from tryone144/glviewport-max
gl_common: set `glViewport()` to maximum supported size
2020-04-23 20:31:31 +01:00
Bernd Busse
a7bd48f5ab gl_common: set glViewport() to maximum supported size
- Query maximum supported dimensions of `glViewport()` when initializing
so we don't have to worry about differently sized textures when
rendering (usually the same as the maximum supported texture size, but
dependend on the driver).
- Set projection matrix in all shaders at startup to queried viewport
dimensions. Allows using screen coordinates for all vertex positions
without having to keep track of framebuffer dimensions.
- Follow recommendations and set `glViewport()` to queried maximum dimensions
for each draw call (`glDraw*()`, `glClear()`).

Related: #349
2020-04-23 20:30:41 +01:00
Yuxuan Shui
da2b824aa6 backend: remove unneeded check for NVIDIA driver
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-22 20:24:15 +01:00
Yuxuan Shui
30dfc8e0ac driver: enable xrender-sync-fence on NVIDIA driver
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-22 20:20:22 +01:00
Yuxuan Shui
cbe34158f3 core: create a xsync fence always
xrender-sync-fence might be enabled after init because of driver
detection. Instead of creating it on demand, just always create it as
this is simpler.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-22 20:17:31 +01:00
Yuxuan Shui
adeb09b775 driver: allow apply_driver_workaround to set options
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-22 20:13:18 +01:00
Yuxuan Shui
0efdb6c2d9 backend: glx: tentatively enable glFinish for NVIDIA
We use the __GL_YIELD=usleep workaround when we detect the NVIDIA
driver, so we could use glFinish without the NVIDIA driver taking all
the CPU.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-22 18:05:04 +01:00
Yuxuan Shui
7043b2da5e meson.build: Bump version number
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-21 19:35:10 +01:00
Yuxuan Shui
d1f4969fc1 render: move argb_fbconfig to struct session
Because it needs to be cleared when we reset, so we don't use a freed
fbconfig across reset.

Related: #381

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-20 19:10:53 +01:00
Yuxuan Shui
754531ea2e opengl: clear fbcfg in free_paint_glx
So we don't reuse the old, freed fbcfg across reset.

Related: #381

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-20 19:05:58 +01:00
Yuxuan Shui
701eb0a2f3 opengl: release context in glx_destroy
GLX context is not destroyed immediately after calling
glXDestroyContext. It is only destroyed when it's no longer
being used. So make sure to release the context

Fixes #381

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-20 05:33:26 +01:00
Yuxuan Shui
17831a7be3 config: remove xrender-sync
Deprecated since v5

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-11 16:17:30 +01:00
Yuxuan Shui
bcb1ef1654 config: remove the --dbe command line option
Deprecated since v4

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
2020-04-11 16:15:27 +01:00