     }
   }
 }
-#endif
-
-void discard_pixels_in_rounded_borders(vec2 local_pos) {
-  float distanceFromRef = distance(vRefPoint, local_pos);
-  if (vRadii.x > 0.0 && (distanceFromRef > vRadii.x || distanceFromRef < vRadii.z)) {
-      discard;
-  }
-}
 
 void draw_antialiased_solid_border_corner(vec2 local_pos) {
   if (vRadii.x <= 0.0) {

            break;
        case BORDER_STYLE_OUTSET:
        case BORDER_STYLE_INSET:
            discard_pixels_in_rounded_borders(local_pos);
            oFragColor = mix(vVerticalColor, vHorizontalColor, step(0.0, vF));
            break;
        case BORDER_STYLE_SOLID:
            oFragColor = mix(vHorizontalColor, vVerticalColor, step(0.0, vF));
            switch (vBorderPart) {
              case PST_TOP_LEFT:
              case PST_TOP_RIGHT:
              case PST_BOTTOM_LEFT:
              case PST_BOTTOM_RIGHT:
                draw_antialiased_solid_border_corner(local_pos);
                break;
              default:
                discard_pixels_in_rounded_borders(local_pos);
              }
            break;
        case BORDER_STYLE_NONE:
            discard_pixels_in_rounded_borders(local_pos);
            oFragColor = mix(vHorizontalColor, vVerticalColor, step(0.0, vF));
            break;
        case BORDER_STYLE_DOUBLE:
            discard_pixels_in_rounded_borders(local_pos);

/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

void discard_pixels_in_rounded_borders(vec2 local_pos) {
  float distanceFromRef = distance(vRefPoint, local_pos);
  if (vRadii.x > 0.0 && (distanceFromRef > vRadii.x || distanceFromRef < vRadii.z)) {
      discard;
  }
}

#ifdef WR_FEATURE_TRANSFORM

