61 {
62 final TestImageTextureEntry textureEntry = new TestImageTextureEntry();
63 final ImageReaderPlatformViewRenderTarget renderTarget =
64 new ImageReaderPlatformViewRenderTarget(textureEntry);
65
66 final View platformView =
67 new View(ctx) {
68 @Override
69 public void draw(Canvas canvas) {
70 super.draw(canvas);
71 canvas.drawColor(
Color.RED);
72 }
73 };
76 platformView.layout(0, 0,
size,
size);
78
79
80 assertNull(textureEntry.acquireLatestImage());
81
82
83 final Surface
s = renderTarget.getSurface();
85 final Canvas targetCanvas =
s.lockHardwareCanvas();
86 assertNotNull(targetCanvas);
87
88 try {
89
90
91 targetCanvas.drawColor(
Color.TRANSPARENT, PorterDuff.Mode.CLEAR);
92
93 platformView.draw(targetCanvas);
94 } finally {
95
96 s.unlockCanvasAndPost(targetCanvas);
97 }
98
99
100
101 shadowOf(getMainLooper()).idle();
102
103
104 Image pushedImage = textureEntry.acquireLatestImage();
105 assertNotNull(pushedImage);
106 assertEquals(pushedImage.getWidth(),
size);
107 assertEquals(pushedImage.getHeight(),
size);
108 }
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