Eliminate struct pipe_region.
[mesa.git] / src / mesa / pipe / softpipe / sp_clear.c
index 08b87417aa4f6a510a7cac5c905b6be22a7bd8a4..496b38fd5f12b82ef5449823ebd0945286a80da5 100644 (file)
@@ -47,43 +47,27 @@ softpipe_clear(struct pipe_context *pipe, struct pipe_surface *ps,
                unsigned clearValue)
 {
    struct softpipe_context *softpipe = softpipe_context(pipe);
-   struct softpipe_surface *sps = softpipe_surface(ps);
-   unsigned x, y, w, h;
 
    softpipe_update_derived(softpipe); /* not needed?? */
 
-   w = softpipe->framebuffer.cbufs[0]->width;
-   h = softpipe->framebuffer.cbufs[0]->height;
-
-   /* Use the X coord to trick region_fill() into filling at an offset
-    * from the start of the region.  Perhaps pipe_region should have the
-    * 'offset' field, not pipe_surface???
-    */
-   assert(ps->offset % ps->region->cpp == 0);
-   x = ps->offset / ps->region->cpp;
-   y = 0;
-
-   assert(w <= ps->region->pitch);
-   assert(h <= ps->region->height);
-
-   if (sps == sp_tile_cache_get_surface(softpipe->zbuf_cache)) {
+   if (ps == sp_tile_cache_get_surface(softpipe, softpipe->zbuf_cache)) {
       float clear[4];
       clear[0] = 1.0; /* XXX hack */
       sp_tile_cache_clear(softpipe->zbuf_cache, clear);
    }
-   else if (sps == sp_tile_cache_get_surface(softpipe->cbuf_cache[0])) {
+   else if (ps == sp_tile_cache_get_surface(softpipe, softpipe->cbuf_cache[0])) {
       float clear[4];
-      clear[0] = 0.2; /* XXX hack */
-      clear[1] = 0.2; /* XXX hack */
-      clear[2] = 0.2; /* XXX hack */
-      clear[3] = 0.2; /* XXX hack */
+      clear[0] = 0.2f; /* XXX hack */
+      clear[1] = 0.2f; /* XXX hack */
+      clear[2] = 0.2f; /* XXX hack */
+      clear[3] = 0.2f; /* XXX hack */
       sp_tile_cache_clear(softpipe->cbuf_cache[0], clear);
    }
 
-   pipe->region_fill(pipe, ps->region, 0, x, y, w, h, clearValue);
+   pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, clearValue);
 
 
 #if 0
-   sp_clear_tile_cache(sps, clearValue);
+   sp_clear_tile_cache(ps, clearValue);
 #endif
 }