Skip to content

Commit ae1ffa3

Browse files
committed
Remove video_gfx_noblend()
1 parent 34f4322 commit ae1ffa3

File tree

13 files changed

+7
-108
lines changed

13 files changed

+7
-108
lines changed

kos/include/libvideo/gfx/buffer.h

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -114,17 +114,7 @@ struct video_buffer_ops {
114114
(LIBVIDEO_GFX_FCC *vi_updategfx)(struct video_gfx *__restrict __self,
115115
unsigned int __what);
116116

117-
/* Disable blending for `__self', which uses this video buffer. Same as:
118-
* >> __self->vx_blend = GFX_BLENDMODE_OVERRIDE;
119-
* >> __self->vx_flags &= ~VIDEO_GFX_F_BLUR;
120-
* >> __self->vx_colorkey = 0;
121-
* >> (*vi_updategfx)(__self, VIDEO_GFX_UPDATE_ALL);
122-
*
123-
* CAUTION: Do not use this operator when `__self' may be used by other threads! */
124-
__ATTR_RETNONNULL_T __ATTR_INOUT_T(1) struct video_gfx *
125-
(LIBVIDEO_GFX_FCC *vi_noblendgfx)(struct video_gfx *__restrict __self);
126-
127-
void (*_vi_pad1[4])(void);
117+
void (*_vi_pad1[5])(void);
128118

129119
/* Lock the video buffer into memory for reading.
130120
* WARNING: Attempting to perform "gfx" operations on "this" while holding

kos/include/libvideo/gfx/gfx.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -524,16 +524,6 @@ extern __ATTR_RETNONNULL __ATTR_INOUT(1) struct video_gfx *video_gfx_disableflag
524524
extern __ATTR_RETNONNULL __ATTR_PURE __ATTR_IN(1) video_color_t video_gfx_getcolorkey(struct video_gfx const *__restrict __self);
525525
extern __ATTR_RETNONNULL __ATTR_INOUT(1) struct video_gfx *video_gfx_setcolorkey(struct video_gfx *__restrict __self, video_color_t __colorkey);
526526

527-
/* Disable blending for `__self'. Same as:
528-
* >> __self->vx_blend = GFX_BLENDMODE_OVERRIDE;
529-
* >> __self->vx_flags &= ~VIDEO_GFX_F_BLUR;
530-
* >> __self->vx_colorkey = 0;
531-
* >> video_gfx_update(__self, VIDEO_GFX_UPDATE_ALL);
532-
*
533-
* CAUTION: Do not use this operator when `__self' may be used by other threads! */
534-
extern __ATTR_RETNONNULL __ATTR_INOUT(1) struct video_gfx *
535-
video_gfx_noblend(struct video_gfx *__restrict __self);
536-
537527
/* Apply a clipping rect to "self", shrinking the pixel
538528
* area relative to offsets specified by the given coords.
539529
*
@@ -738,8 +728,6 @@ video_gfx_stretch3(struct video_gfx const *__wrdst, video_offset_t __wrdst_x, vi
738728
#define video_gfx_enableflags(self, flags) ((self)->vx_flags |= (flags), video_gfx_update(self, VIDEO_GFX_UPDATE_FLAGS))
739729
#define video_gfx_disableflags(self, flags) ((self)->vx_flags &= ~(flags), video_gfx_update(self, VIDEO_GFX_UPDATE_FLAGS))
740730
#define video_gfx_setcolorkey(self, colorkey) ((self)->vx_colorkey = (colorkey), video_gfx_update(self, VIDEO_GFX_UPDATE_COLORKEY))
741-
#define video_gfx_noblend(self) \
742-
(*(self)->vx_buffer->vb_ops->vi_noblendgfx)(self)
743731
#define video_gfx_getcolor(self, x, y) \
744732
(*(self)->vx_hdr.vxh_ops->vgfo_getcolor)(self, x, y)
745733
#define video_gfx_putcolor(self, x, y, color) \

kos/src/libvideo/gfx/buffer.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,6 @@ libvideo_buffer_swgfx_updategfx(struct video_gfx *__restrict self, unsigned int
4949
return self;
5050
}
5151

52-
INTERN ATTR_RETNONNULL ATTR_INOUT(1) struct video_gfx *FCC
53-
libvideo_buffer_swgfx_noblend(struct video_gfx *__restrict self) {
54-
self->vx_blend = GFX_BLENDMODE_OVERRIDE;
55-
self->vx_flags &= ~(VIDEO_GFX_F_BLUR);
56-
self->vx_colorkey = 0;
57-
libvideo_swgfx_populate_noblend(self);
58-
return self;
59-
}
60-
6152
INTERN WUNUSED ATTR_INOUT(1) ATTR_INOUT(2) int FCC
6253
libvideo_buffer_notsup_lock(struct video_buffer *__restrict self,
6354
struct video_lock *__restrict lock) {

kos/src/libvideo/gfx/buffer.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,6 @@ DECL_BEGIN
5656
/* Generic implementations for video buffer operators. */
5757
INTDEF ATTR_RETNONNULL ATTR_INOUT(1) struct video_gfx *FCC
5858
libvideo_buffer_swgfx_updategfx(struct video_gfx *__restrict self, unsigned int what);
59-
INTDEF ATTR_RETNONNULL ATTR_INOUT(1) struct video_gfx *FCC
60-
libvideo_buffer_swgfx_noblend(struct video_gfx *__restrict self);
6159

6260

6361
#define libvideo_buffer_notsup_rlock libvideo_buffer_notsup_lock

kos/src/libvideo/gfx/buffer/bitmask.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -155,17 +155,9 @@ bitmask_updategfx(struct video_gfx *__restrict self, unsigned int what) {
155155
bitmask_gfx_optimize(self);
156156
return self;
157157
}
158-
159-
PRIVATE ATTR_RETNONNULL ATTR_INOUT(1) struct video_gfx *FCC
160-
bitmask_noblend(struct video_gfx *__restrict self) {
161-
self = libvideo_buffer_swgfx_noblend(self);
162-
bitmask_gfx_optimize(self);
163-
return self;
164-
}
165158
#else /* !__OPTIMIZE_SIZE__ */
166159
#define bitmask_gfx_optimize(self) (void)0
167160
#define bitmask_updategfx libvideo_buffer_swgfx_updategfx
168-
#define bitmask_noblend libvideo_buffer_swgfx_noblend
169161
#endif /* __OPTIMIZE_SIZE__ */
170162

171163

@@ -202,7 +194,6 @@ INTERN ATTR_RETNONNULL WUNUSED struct video_buffer_ops const *CC _bitmask_ops(vo
202194
bitmask_ops.vi_unlockregion = &libvideo_buffer_noop_unlockregion;
203195
bitmask_ops.vi_initgfx = &bitmask_initgfx;
204196
bitmask_ops.vi_updategfx = &bitmask_updategfx;
205-
bitmask_ops.vi_noblendgfx = &bitmask_noblend;
206197
COMPILER_WRITE_BARRIER();
207198
bitmask_ops.vi_destroy = &bitmask_destroy;
208199
COMPILER_WRITE_BARRIER();

kos/src/libvideo/gfx/buffer/custom.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ INTERN ATTR_RETNONNULL WUNUSED struct video_buffer_ops const *CC _custom_ops(voi
207207
custom_ops.vi_unlockregion = &custom_unlockregion;
208208
custom_ops.vi_initgfx = &custom_initgfx;
209209
custom_ops.vi_updategfx = &libvideo_buffer_swgfx_updategfx;
210-
custom_ops.vi_noblendgfx = &libvideo_buffer_swgfx_noblend;
211210
COMPILER_WRITE_BARRIER();
212211
custom_ops.vi_destroy = &custom_destroy;
213212
COMPILER_WRITE_BARRIER();

kos/src/libvideo/gfx/buffer/gfx.c

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -183,14 +183,6 @@ subregion_buffer_updategfx(struct video_gfx *__restrict self, unsigned int what)
183183
return (*base->vb_ops->vi_updategfx)(self, what);
184184
}
185185

186-
PRIVATE ATTR_RETNONNULL ATTR_INOUT(1) struct video_gfx *FCC
187-
subregion_buffer_noblend(struct video_gfx *__restrict self) {
188-
struct subregion_buffer *me = (struct subregion_buffer *)self->vx_buffer;
189-
struct video_buffer *base = me->srb_base;
190-
self->vx_buffer = base; /* This is allowed! */
191-
return (*base->vb_ops->vi_noblendgfx)(self);
192-
}
193-
194186

195187
INTERN struct video_buffer_ops subregion_buffer_ops = {};
196188
INTERN struct video_buffer_ops subregion_buffer_ops_norem = {};
@@ -205,7 +197,6 @@ _subregion_buffer_ops(void) {
205197
subregion_buffer_ops.vi_unlockregion = &subregion_buffer_unlockregion;
206198
subregion_buffer_ops.vi_initgfx = &subregion_buffer_initgfx;
207199
subregion_buffer_ops.vi_updategfx = &subregion_buffer_updategfx;
208-
subregion_buffer_ops.vi_noblendgfx = &subregion_buffer_noblend;
209200
COMPILER_WRITE_BARRIER();
210201
subregion_buffer_ops.vi_destroy = &subregion_buffer_destroy;
211202
COMPILER_WRITE_BARRIER();
@@ -224,7 +215,6 @@ _subregion_buffer_ops_norem(void) {
224215
subregion_buffer_ops_norem.vi_unlock = &subregion_buffer_unlock;
225216
subregion_buffer_ops_norem.vi_initgfx = &subregion_buffer_initgfx;
226217
subregion_buffer_ops_norem.vi_updategfx = &subregion_buffer_updategfx;
227-
subregion_buffer_ops_norem.vi_noblendgfx = &subregion_buffer_noblend;
228218
COMPILER_WRITE_BARRIER();
229219
subregion_buffer_ops_norem.vi_destroy = &subregion_buffer_destroy;
230220
COMPILER_WRITE_BARRIER();
@@ -268,26 +258,15 @@ gfx_buffer_updategfx(struct video_gfx *__restrict self, unsigned int what) {
268258
return (*base->vb_ops->vi_updategfx)(self, what);
269259
}
270260

271-
PRIVATE ATTR_RETNONNULL ATTR_INOUT(1) struct video_gfx *FCC
272-
gfx_buffer_noblend(struct video_gfx *__restrict self) {
273-
struct gfx_buffer *me = (struct gfx_buffer *)self->vx_buffer;
274-
struct video_buffer *base = me->gxb_base;
275-
self->vx_buffer = base; /* This is allowed! */
276-
self->vx_flags = me->gxb_flags;
277-
self->vx_colorkey = me->gxb_colorkey;
278-
return (*base->vb_ops->vi_noblendgfx)(self);
279-
}
280-
281261

282262

283263
INTERN struct video_buffer_ops gfx_buffer_ops = {};
284264
PRIVATE ATTR_RETNONNULL WUNUSED struct video_buffer_ops *CC
285265
_gfx_buffer_ops(void) {
286266
if unlikely(!gfx_buffer_ops.vi_destroy) {
287267
video_buffer_ops_set_LOCKOPS_like_NOTSUP(&gfx_buffer_ops);
288-
gfx_buffer_ops.vi_initgfx = &gfx_buffer_initgfx;
289-
gfx_buffer_ops.vi_updategfx = &gfx_buffer_updategfx;
290-
gfx_buffer_ops.vi_noblendgfx = &gfx_buffer_noblend;
268+
gfx_buffer_ops.vi_initgfx = &gfx_buffer_initgfx;
269+
gfx_buffer_ops.vi_updategfx = &gfx_buffer_updategfx;
291270
COMPILER_WRITE_BARRIER();
292271
gfx_buffer_ops.vi_destroy = &gfx_buffer_destroy;
293272
COMPILER_WRITE_BARRIER();

kos/src/libvideo/gfx/buffer/lockable.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -326,14 +326,6 @@ lockable_updategfx(struct video_gfx *__restrict self, unsigned int what) {
326326
return (*base->vb_ops->vi_updategfx)(self, what);
327327
}
328328

329-
PRIVATE ATTR_RETNONNULL ATTR_INOUT(1) struct video_gfx *FCC
330-
lockable_noblend(struct video_gfx *__restrict self) {
331-
struct lockable_buffer *me = (struct lockable_buffer *)self->vx_buffer;
332-
struct video_buffer *base = me->lb_base;
333-
self->vx_buffer = base; /* This is allowed! */
334-
return (*base->vb_ops->vi_noblendgfx)(self);
335-
}
336-
337329

338330
#undef lockable_ops
339331
PRIVATE struct video_buffer_ops lockable_ops = {};
@@ -347,7 +339,6 @@ INTERN ATTR_RETNONNULL WUNUSED struct video_buffer_ops const *CC _lockable_ops(v
347339
lockable_ops.vi_unlockregion = &lockable_unlockregion;
348340
lockable_ops.vi_initgfx = &lockable_initgfx;
349341
lockable_ops.vi_updategfx = &lockable_updategfx;
350-
lockable_ops.vi_noblendgfx = &lockable_noblend;
351342
COMPILER_WRITE_BARRIER();
352343
lockable_ops.vi_destroy = &lockable_destroy;
353344
COMPILER_WRITE_BARRIER();

kos/src/libvideo/gfx/buffer/ram.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -387,23 +387,6 @@ GFX_FOREACH_DEDICATED_PREBLENDMODE(LINK_libvideo_swgfx_generic__render_preblend_
387387
return self;
388388
}
389389

390-
INTERN ATTR_RETNONNULL ATTR_INOUT(1) struct video_gfx *FCC
391-
rambuffer_noblend(struct video_gfx *__restrict self) {
392-
struct gfx_ramdrv *drv = video_ramgfx_getdrv(self);
393-
self->vx_blend = GFX_BLENDMODE_OVERRIDE;
394-
self->vx_flags &= ~(VIDEO_GFX_F_BLUR);
395-
self->vx_colorkey = 0;
396-
libvideo_swgfx_populate_noblend(self);
397-
if (drv->xsw_getcolor != drv->xsw_getpixel)
398-
drv->xsw_getcolor = &libvideo_ramgfx__getcolor_noblend;
399-
if (drv->xsw_putcolor != drv->xsw_setpixel) {
400-
drv->xsw_putcolor = &libvideo_ramgfx__putcolor_noblend;
401-
drv->xsw_putcolor_p = &libvideo_ramgfx__putcolor_noblend;
402-
}
403-
return self;
404-
}
405-
406-
407390
INTERN struct video_buffer_ops rambuffer_ops = {};
408391
INTERN ATTR_RETNONNULL WUNUSED struct video_buffer_ops const *CC _rambuffer_ops(void) {
409392
if unlikely(!rambuffer_ops.vi_destroy) {

kos/src/libvideo/gfx/buffer/ram.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ INTDEF ATTR_INOUT(1) ATTR_OUT(2) int FCC rambuffer_lock(struct video_buffer *__r
5050
INTDEF ATTR_INOUT(1) NONNULL((2)) int FCC rambuffer_lockregion(struct video_buffer *__restrict self, struct video_regionlock *__restrict lock);
5151
INTDEF ATTR_RETNONNULL ATTR_INOUT(1) struct video_gfx *FCC rambuffer_initgfx(struct video_gfx *__restrict self);
5252
INTDEF ATTR_RETNONNULL ATTR_INOUT(1) struct video_gfx *FCC rambuffer_updategfx(struct video_gfx *__restrict self, unsigned int what);
53-
INTDEF ATTR_RETNONNULL ATTR_INOUT(1) struct video_gfx *FCC rambuffer_noblend(struct video_gfx *__restrict self);
5453
#define rambuffer_rlock rambuffer_lock
5554
#define rambuffer_wlock rambuffer_lock
5655
#define rambuffer_rlockregion rambuffer_lockregion
@@ -64,9 +63,8 @@ INTDEF ATTR_RETNONNULL ATTR_INOUT(1) struct video_gfx *FCC rambuffer_noblend(str
6463
(self)->vi_wlockregion = &rambuffer_wlockregion, \
6564
(self)->vi_unlockregion = &libvideo_buffer_noop_unlockregion)
6665
#define video_buffer_ops_set_GFXOPS_like_RAMBUFFER(self) \
67-
(void)((self)->vi_initgfx = &rambuffer_initgfx, \
68-
(self)->vi_updategfx = &rambuffer_updategfx, \
69-
(self)->vi_noblendgfx = &rambuffer_noblend)
66+
(void)((self)->vi_initgfx = &rambuffer_initgfx, \
67+
(self)->vi_updategfx = &rambuffer_updategfx)
7068

7169

7270

0 commit comments

Comments
 (0)