st/nine: Simplify ColorFill
authorAxel Davy <axel.davy@ens.fr>
Sun, 13 Nov 2016 11:40:10 +0000 (12:40 +0100)
committerAxel Davy <axel.davy@ens.fr>
Tue, 20 Dec 2016 22:44:23 +0000 (23:44 +0100)
For render targets, NineSurface9_GetSurface is not
expected to fail.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
src/gallium/state_trackers/nine/device9.c

index 271aa2b6b9f18e84314562d130457f23d25b3084..28442eb76fcac5410089b93f13926e2a32b0ca17 100644 (file)
@@ -1757,7 +1757,6 @@ NineDevice9_ColorFill( struct NineDevice9 *This,
     struct pipe_surface *psurf;
     unsigned x, y, w, h;
     union pipe_color_union rgba;
-    boolean fallback;
 
     DBG("This=%p pSurface=%p pRect=%p color=%08x\n", This,
         pSurface, pRect, color);
@@ -1793,15 +1792,8 @@ NineDevice9_ColorFill( struct NineDevice9 *This,
     }
     d3dcolor_to_pipe_color_union(&rgba, color);
 
-    fallback = !(surf->base.info.bind & PIPE_BIND_RENDER_TARGET);
-
-    if (!fallback) {
+    if (surf->base.info.bind & PIPE_BIND_RENDER_TARGET) {
         psurf = NineSurface9_GetSurface(surf, 0);
-        if (!psurf)
-            fallback = TRUE;
-    }
-
-    if (!fallback) {
         pipe->clear_render_target(pipe, psurf, &rgba, x, y, w, h, false);
     } else {
         D3DLOCKED_RECT lock;