Start defining the screen mask. After calling this use graphics functions to
mask out the area
191265
public static void defineMask() {
		GL.glDepthMask(true);
		GL.glClearDepth(1);
		GL.glClear(SGL.GL_DEPTH_BUFFER_BIT);
		GL.glDepthFunc(SGL.GL_ALWAYS);
		GL.glEnable(SGL.GL_DEPTH_TEST);
		GL.glDepthMask(true);
		GL.glColorMask(false, false, false, false);
	}
803138
protected void initGraphics() {
        // Set initial size
        if (Double.compare(tile.getPrefWidth(), 0.0) <= 0 || Double.compare(tile.getPrefHeight(), 0.0) <= 0 ||
            Double.compare(tile.getWidth(), 0.0) <= 0 || Double.compare(tile.getHeight(), 0.0) <= 0) {
            if (tile.getPrefWidth() > 0 && tile.getPrefHeight() > 0) {
                tile.setPrefSize(tile.getPrefWidth(), tile.getPrefHeight());
            } else {
                tile.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
            }
        }

        shadow = new DropShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.65), 3, 0, 0, 0);

        backgroundImageView = new ImageView();
        backgroundImageView.setPreserveRatio(true);
        backgroundImageView.setMouseTransparent(true);
        if (null == tile.getBackgroundImage()) {
            enableNode(backgroundImageView, false);
        } else {
            backgroundImageView.setImage(tile.getBackgroundImage());
            enableNode(backgroundImageView, true);
        }

        notifyRegion = new NotifyRegion();
        enableNode(notifyRegion, false);

        infoRegion = new InfoRegion();
        infoRegion.setPickOnBounds(false);
        enableNode(infoRegion, false);

        pane = new Pane(backgroundImageView, notifyRegion, infoRegion);
        pane.setBorder(new Border(new BorderStroke(tile.getBorderColor(), BorderStrokeStyle.SOLID, new CornerRadii(PREFERRED_WIDTH * 0.025), new BorderWidths(tile.getBorderWidth()))));
        pane.setBackground(new Background(new BackgroundFill(tile.getBackgroundColor(), new CornerRadii(PREFERRED_WIDTH * 0.025), Insets.EMPTY)));

        getChildren().setAll(pane);
    }
623352
def _clear_surface(self, surface, rect=None):
        
        clear_color = self._rgb_clear_color if self._clear_color is None else self._clear_color
        surface.fill(clear_color, rect)
870176
def draw_screen(self, size):
        
        self.tui.clear()
        canvas = self.top.render(size, focus=True)
        self.tui.draw_screen(size, canvas)
114218
def set_on_mask(self, mask):
        """"""
        set_cmd = self._create_set_property_msg('_on_mask', 0x02, mask)
        self._send_method(set_cmd, self._property_set)
599975
def _apply_mask(self, roi_mask):
        """"""

        # TODO ensure compatible with input image
        #   - must have < N dim and same size in moving dims.
        rows_to_delete = list() # to allow for additional masks to be applied in the future
        if isinstance(roi_mask,
                      np.ndarray):  # not (roi_mask is None or roi_mask=='auto'):
            self._set_roi_mask(roi_mask)

            rows_roi = np.where(self.roi_mask.flatten() == cfg.background_value)

            # TODO below would cause differences in size/shape across mask and carpet!
            self.carpet = np.delete(self.carpet, rows_roi, axis=0)

        else:
            self.roi_mask = np.ones(self.carpet.shape)
971753
private void paintForegroundEnabled(Graphics2D g, int width, int height) {
        Shape s = decodeArrowPath(width, height);

        g.setPaint(enabledColor);
        g.fill(s);

    }
1057079
public void setAreaFill(final ColorDef AREA_FILL_COLOR) {
        this.areaFill = AREA_FILL_COLOR;
        init(INNER_BOUNDS.width, INNER_BOUNDS.height);
        repaint(INNER_BOUNDS);
    }
207516
def fill_area(self, x, y, width, height, color, opacity = 1):
        """"""
        self.save_context()
        self.rectangle(x, y, width, height)
        self._add_instruction("clip")
        self.rectangle(x, y, width, height)
        self.fill(color, opacity)
        self.restore_context()
85150
function enterFullScreen() {
    if (Windows.UI.ViewManagement.ApplicationViewBoundsMode) { // else crash on 8.1
        var view = Windows.UI.ViewManagement.ApplicationView.getForCurrentView();
        view.setDesiredBoundsMode(Windows.UI.ViewManagement.ApplicationViewBoundsMode.useCoreWindow);
        view.suppressSystemOverlays = true;
    }
}
1073999
def _apply_mask(self,p,mat):
        """"""
        mask = p.mask
        ms=p.mask_shape
        if ms is not None:
            mask = ms(x=p.x+p.size*(ms.x*np.cos(p.orientation)-ms.y*np.sin(p.orientation)),
                      y=p.y+p.size*(ms.x*np.sin(p.orientation)+ms.y*np.cos(p.orientation)),
                      orientation=ms.orientation+p.orientation,size=ms.size*p.size,
                      bounds=p.bounds,ydensity=p.ydensity,xdensity=p.xdensity)
        if mask is not None:
            mat*=mask
750707
function(mask) {
        var options = this.options,
            message;

        // Prepare mask
        mask.addClass('hide').appendTo(this.element);

        if (this.element.is('body')) {
            mask.css('position', 'fixed');
        }

        if (options.revealOnClick) {
            mask.click(this.hide.bind(this));
        }

        this.mask = mask;

        // Create message if it does not exist
        message = mask.find(this.ns('message'));

        if (!message.length && options.messageContent) {
            message = this.render(options.messageTemplate)
                .html(options.messageContent)
                .appendTo(mask);
        }

        this.message = message;
    }
578752
def build_screen_image(edit_buffer)
      working_region = edit_buffer[left_margin..right_margin]

      if (mask = @options[:secret_mask])
        mask[0] * working_region.length
      else
        working_region
      end.ljust(active_width)
    end
932800
public static void drawMasked(Bitmap src, Drawable mask, Bitmap dest) {
        drawMasked(src, mask, dest, CLEAR_COLOR);
    }
226650
void putScreen(Context context) {
    Map<String, Object> screen = createMap();
    WindowManager manager = getSystemService(context, Context.WINDOW_SERVICE);
    Display display = manager.getDefaultDisplay();
    DisplayMetrics displayMetrics = new DisplayMetrics();
    display.getMetrics(displayMetrics);
    screen.put(SCREEN_DENSITY_KEY, displayMetrics.density);
    screen.put(SCREEN_HEIGHT_KEY, displayMetrics.heightPixels);
    screen.put(SCREEN_WIDTH_KEY, displayMetrics.widthPixels);
    put(SCREEN_KEY, screen);
  }
279113
private void initGraphics() {
        if (Double.compare(getPrefWidth(), 0.0) <= 0 || Double.compare(getPrefHeight(), 0.0) <= 0 ||
            Double.compare(getWidth(), 0.0) <= 0 || Double.compare(getHeight(), 0.0) <= 0) {
            if (getPrefWidth() > 0 && getPrefHeight() > 0) {
                setPrefSize(getPrefWidth(), getPrefHeight());
            } else {
                setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
            }
        }

        nameText = new Text(getName());
        nameText.setTextOrigin(VPos.TOP);

        valueText = new Text(String.format(locale, formatString, getValue()));
        valueText.setTextOrigin(VPos.TOP);

        barBackground = new Rectangle();

        bar = new Rectangle();

        pane = new Pane(nameText, valueText, barBackground, bar);
        pane.setBackground(new Background(new BackgroundFill(Color.TRANSPARENT, CornerRadii.EMPTY, Insets.EMPTY)));

        getChildren().setAll(pane);
    }
828179
private void initGraphics() {
        // Set initial size
        if (Double.compare(gauge.getPrefWidth(), 0.0) <= 0 || Double.compare(gauge.getPrefHeight(), 0.0) <= 0 ||
            Double.compare(gauge.getWidth(), 0.0) <= 0 || Double.compare(gauge.getHeight(), 0.0) <= 0) {
            if (gauge.getPrefWidth() > 0 && gauge.getPrefHeight() > 0) {
                gauge.setPrefSize(gauge.getPrefWidth(), gauge.getPrefHeight());
            } else {
                gauge.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
            }
        }

        for (int i = 0 ; i < 12 ; i++) {
            Region bar = new Region();
            bar.setPrefSize(20, 20 + (i * 4));
            bars[i] = bar;
        }

        pane = new HBox(bars);
        pane.setSpacing(PREFERRED_WIDTH * 0.01960784);
        pane.setAlignment(Pos.BOTTOM_CENTER);
        pane.setFillHeight(false);
        pane.setBackground(new Background(new BackgroundFill(backgroundPaint, new CornerRadii(1024), Insets.EMPTY)));
        pane.setBorder(new Border(new BorderStroke(borderPaint, BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(borderWidth))));

        getChildren().setAll(pane);
    }