MCPcopy Create free account
hub / github.com/HumbleUI/Skija / draw

Method draw

examples/scenes/src/BitmapScene.java:277–321  ·  view source on GitHub ↗
(Canvas canvas, int width, int height, float dpi, int xpos, int ypos)

Source from the content-addressed store, hash-verified

275 }
276
277 @Override
278 public void draw(Canvas canvas, int width, int height, float dpi, int xpos, int ypos) {
279 assert null != canvas.getBaseProps();
280 assert null != canvas.getTopProps();
281
282 try (var fill = new Paint();
283 var stroke = new Paint().setColor(0xFFE5E5E5).setMode(PaintMode.STROKE).setStrokeWidth(1);)
284 {
285 for (var tuple: shapes) {
286 fill.setColor(tuple.getSecond());
287 canvas.drawPath(tuple.getFirst(), fill);
288 }
289
290 IRect screen = IRect.makeXYWH(0, 0, width, height);
291 int bw = 200;
292 int bh = 200;
293
294 int left = xpos - bw - 20 - bw / 2 - 10;
295 int top = ypos - bh - 20 - bh / 2 - 10;
296 drawGray(canvas, IRect.makeXYWH(left, top, bw, bh), dpi);
297
298 left = xpos - bw / 2 - 10;
299 drawBlur(canvas, IRect.makeXYWH(left, top, bw, bh), screen, 20, dpi);
300
301 left = xpos + 10 + bw / 2;
302 drawBitmapCanvas(canvas, IRect.makeXYWH(left, top, bw, bh), dpi);
303
304 left = xpos - bw - 20 - bw / 2 - 10;
305 top = ypos - bh / 2 - 10;
306 drawPixels(canvas, IRect.makeXYWH(left, top, bw, bh), screen, dpi);
307
308 left = xpos - bw / 2 - 10;
309 drawSubset(canvas, IRect.makeXYWH(left, top, bw, bh), screen, dpi);
310
311 left = xpos + bw / 2 + 10;
312 drawPixelRef(canvas, IRect.makeXYWH(left, top, bw, bh), screen, dpi);
313
314 left = xpos - bw - 20 - bw / 2 - 10;
315 top = ypos + bh / 2 + 10;
316 drawAlpha(canvas, IRect.makeXYWH(left, top, bw, bh), screen, dpi);
317
318 left = xpos - bw / 2 - 10;
319 drawErase(canvas, IRect.makeXYWH(left, top, bw, bh), screen, dpi);
320 }
321 }
322}

Callers

nothing calls this directly

Calls 14

drawGrayMethod · 0.95
drawBlurMethod · 0.95
drawBitmapCanvasMethod · 0.95
drawPixelsMethod · 0.95
drawSubsetMethod · 0.95
drawPixelRefMethod · 0.95
drawAlphaMethod · 0.95
drawEraseMethod · 0.95
getBasePropsMethod · 0.80
getTopPropsMethod · 0.80
setStrokeWidthMethod · 0.80
setModeMethod · 0.80

Tested by

no test coverage detected