summaryrefslogtreecommitdiff
path: root/src/Fl_Image_Surface.cxx
diff options
context:
space:
mode:
authormaxim nikonov <maxim.nikonov@hqo.co>2026-02-06 18:12:40 +0500
committermaxim nikonov <maxim.nikonov@hqo.co>2026-02-06 18:12:40 +0500
commitb4995f979d127cea667b4e2b71c91e9db4ab52ef (patch)
treefbebc775e10932bace8d6a7c3481b1ba200c64db /src/Fl_Image_Surface.cxx
parent9575eb0a1ffa8150f70f88b5f6b55f342c3c0088 (diff)
wip
Diffstat (limited to 'src/Fl_Image_Surface.cxx')
-rw-r--r--src/Fl_Image_Surface.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/Fl_Image_Surface.cxx b/src/Fl_Image_Surface.cxx
index 38cda73d9..cc65175fa 100644
--- a/src/Fl_Image_Surface.cxx
+++ b/src/Fl_Image_Surface.cxx
@@ -95,12 +95,14 @@ void Fl_Image_Surface_Driver::copy_with_mask(Fl_RGB_Image* mask, uchar *dib_dst,
uchar *dib_src, int line_size,
bool bottom_to_top) {
int w = mask->data_w(), h = mask->data_h();
- for (int i = 0; i < h; i++) {
+ int i;
+ for (i = 0; i < h; i++) {
const uchar* alpha = (const uchar*)mask->array +
(bottom_to_top ? (h-i-1) : i) * w;
uchar *src = dib_src + i * line_size;
uchar *dst = dib_dst + i * line_size;
- for (int j = 0; j < w; j++) {
+ int j;
+ for (j = 0; j < w; j++) {
// mix src and dst into dst weighted by mask pixel's value
uchar u = *alpha++, v = 255 - u;
*dst = ((*dst) * v + (*src) * u)/255;
@@ -269,7 +271,8 @@ static int count_offscreens = 0;
static int find_slot(void) { // return an available slot to memorize an Fl_Image_Surface object
static int max = 0;
- for (int num = 0; num < count_offscreens; num++) {
+ int num;
+ for (num = 0; num < count_offscreens; num++) {
if (!offscreen_api_surface[num]) return num;
}
if (count_offscreens >= max) {
@@ -315,7 +318,8 @@ Fl_Offscreen fl_create_offscreen(int w, int h) {
*/
void fl_delete_offscreen(Fl_Offscreen ctx) {
if (!ctx) return;
- for (int i = 0; i < count_offscreens; i++) {
+ int i;
+ for (i = 0; i < count_offscreens; i++) {
if (offscreen_api_surface[i] && offscreen_api_surface[i]->offscreen() == ctx) {
delete offscreen_api_surface[i];
offscreen_api_surface[i] = NULL;
@@ -329,7 +333,8 @@ void fl_delete_offscreen(Fl_Offscreen ctx) {
\note The \p ctx argument must have been created by fl_create_offscreen().
*/
void fl_begin_offscreen(Fl_Offscreen ctx) {
- for (int i = 0; i < count_offscreens; i++) {
+ int i;
+ for (i = 0; i < count_offscreens; i++) {
if (offscreen_api_surface[i] && offscreen_api_surface[i]->offscreen() == ctx) {
Fl_Surface_Device::push_current(offscreen_api_surface[i]);
return;