MCPcopy Create free account
hub / github.com/JetBrains/skija / draw

Method draw

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

Source from the content-addressed store, hash-verified

225 }
226
227 @Override
228 public void draw(Canvas canvas, int width, int height, float dpi, int xpos, int ypos) {
229 try (var fill = new Paint();
230 var stroke = new Paint().setColor(0xFFE5E5E5).setMode(PaintMode.STROKE).setStrokeWidth(1);)
231 {
232 for (var tuple: shapes) {
233 fill.setColor(tuple.getSecond());
234 canvas.drawPath(tuple.getFirst(), fill);
235 }
236
237 IRect screen = IRect.makeXYWH(0, 0, width, height);
238 int bw = 200;
239 int bh = 200;
240
241 int left = xpos - bw - 20 - bw / 2 - 10;
242 int top = ypos - bh - 20 - bh / 2 - 10;
243 drawGray(canvas, IRect.makeXYWH(left, top, bw, bh), dpi);
244
245 left = xpos - bw / 2 - 10;
246 drawBlur(canvas, IRect.makeXYWH(left, top, bw, bh), screen, 20, dpi);
247
248 left = xpos + 10 + bw / 2;
249 drawBitmapCanvas(canvas, IRect.makeXYWH(left, top, bw, bh), dpi);
250
251 left = xpos - bw - 20 - bw / 2 - 10;
252 top = ypos - bh / 2 - 10;
253 drawPixels(canvas, IRect.makeXYWH(left, top, bw, bh), screen, dpi);
254
255 left = xpos - bw / 2 - 10;
256 drawSubset(canvas, IRect.makeXYWH(left, top, bw, bh), screen, dpi);
257
258 left = xpos + bw / 2 + 10;
259 drawPixelRef(canvas, IRect.makeXYWH(left, top, bw, bh), screen, dpi);
260
261 left = xpos - bw - 20 - bw / 2 - 10;
262 top = ypos + bh / 2 + 10;
263 drawAlpha(canvas, IRect.makeXYWH(left, top, bw, bh), screen, dpi);
264 }
265 }
266}

Callers

nothing calls this directly

Calls 12

makeXYWHMethod · 0.95
drawGrayMethod · 0.95
drawBlurMethod · 0.95
drawBitmapCanvasMethod · 0.95
drawPixelsMethod · 0.95
drawSubsetMethod · 0.95
drawPixelRefMethod · 0.95
drawAlphaMethod · 0.95
setStrokeWidthMethod · 0.80
setModeMethod · 0.80
setColorMethod · 0.45
drawPathMethod · 0.45

Tested by

no test coverage detected