31 {
32 final Canvas canvas = mock(Canvas.class);
33 final Surface
surface = mock(Surface.class);
34 when(
surface.lockHardwareCanvas()).thenReturn(canvas);
35 when(
surface.isValid()).thenReturn(
true);
36 final SurfaceTexture surfaceTexture = mock(SurfaceTexture.class);
37 final SurfaceTextureEntry surfaceTextureEntry = mock(SurfaceTextureEntry.class);
38 when(surfaceTextureEntry.surfaceTexture()).thenReturn(surfaceTexture);
39 when(surfaceTexture.isReleased()).thenReturn(false);
40
41 final SurfaceTexturePlatformViewRenderTarget renderTarget =
42 new SurfaceTexturePlatformViewRenderTarget(surfaceTextureEntry) {
43 @Override
44 protected Surface createSurface() {
46 }
47 };
48
49
50 final View platformView =
51 new View(ctx) {
52 @Override
53 public void draw(Canvas canvas) {
54 super.draw(canvas);
55 canvas.drawColor(
Color.RED);
56 }
57 };
60 platformView.layout(0, 0,
size,
size);
61
62
63 final Surface
s = renderTarget.getSurface();
64 final Canvas c =
s.lockHardwareCanvas();
65 platformView.draw(c);
66 s.unlockCanvasAndPost(c);
67
68
72 verifyNoMoreInteractions(
surface);
73 }
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
SK_API sk_sp< SkShader > Color(SkColor)
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size