- if (rb->surface) {
- /* pipe_surface/region */
- if (rb->surface->region) {
- pipe->region_unmap(pipe, rb->surface->region);
- pipe->region_release(pipe, &rb->surface->region);
- }
- rb->surface->region = pipe->region_alloc(pipe, pixelSize, width, height);
- /* XXX probably don't want to really map here */
- pipe->region_map(pipe, rb->surface->region);
- rb->Data = rb->surface->region->map;
- }
- else {
- /* legacy renderbuffer (this will go away) */
- rb->Data = malloc(width * height * pixelSize);
- }