Revision ffe8b821 ui/sdl.c

b/ui/sdl.c
176 176

  
177 177
    surface->width = width;
178 178
    surface->height = height;
179
    
179

  
180 180
    if (scaling_active) {
181
        int linesize;
182
        PixelFormat pf;
181 183
        if (host_format.BytesPerPixel != 2 && host_format.BytesPerPixel != 4) {
182
            surface->linesize = width * 4;
183
            surface->pf = qemu_default_pixelformat(32);
184
            linesize = width * 4;
185
            pf = qemu_default_pixelformat(32);
184 186
        } else {
185
            surface->linesize = width * host_format.BytesPerPixel;
186
            surface->pf = sdl_to_qemu_pixelformat(&host_format);
187
            linesize = width * host_format.BytesPerPixel;
188
            pf = sdl_to_qemu_pixelformat(&host_format);
187 189
        }
188
#ifdef HOST_WORDS_BIGENDIAN
189
        surface->flags = QEMU_ALLOCATED_FLAG | QEMU_BIG_ENDIAN_FLAG;
190
#else
191
        surface->flags = QEMU_ALLOCATED_FLAG;
192
#endif
193
        surface->data = (uint8_t*) qemu_mallocz(surface->linesize * surface->height);
194

  
190
        qemu_alloc_display(surface, width, height, linesize, pf, 0);
195 191
        return surface;
196 192
    }
197 193

  

Also available in: Unified diff