@@ -290,20 +290,27 @@ void RenderHandler::OnAcceleratedPaint(CefRefPtr<CefBrowser> browser,
290290 if (!jpaintInfo)
291291 return ;
292292
293- // Get view rect to determine width and height
294- CefRect viewRect;
295- GetViewRect (browser, viewRect);
296- // Set the fields of the paint info object
297- #if defined(OS_WIN)
298- SetJNIFieldLong (env, cls, jpaintInfo, " shared_texture_handle" ,
299- reinterpret_cast <jlong>(info.shared_texture_handle ));
300- #else
301- // On non-Windows platforms, shared_texture_handle is not available
302- SetJNIFieldLong (env, cls, jpaintInfo, " shared_texture_handle" , 0 );
303- #endif
293+ #if defined(OS_WIN)
294+ SetJNIFieldLong (env, cls, jpaintInfo, " shared_texture_handle" ,
295+ reinterpret_cast <jlong>(info.shared_texture_handle ));
296+ #else
297+ SetJNIFieldLong (env, cls, jpaintInfo, " shared_texture_handle" , 0 );
298+ #endif
299+
300+ #if defined(OS_MAC) || defined(OS_LINUX)
301+ SetJNIFieldLong (env, cls, jpaintInfo, " shared_texture_io_surface" ,
302+ reinterpret_cast <jlong>(info.shared_texture_io_surface ));
303+ #else
304+ SetJNIFieldLong (env, cls, jpaintInfo, " shared_texture_io_surface" , 0 );
305+ #endif
306+
304307 SetJNIFieldInt (env, cls, jpaintInfo, " format" , info.format );
305- SetJNIFieldInt (env, cls, jpaintInfo, " width" , viewRect.width );
306- SetJNIFieldInt (env, cls, jpaintInfo, " height" , viewRect.height );
308+
309+ #if defined(OS_LINUX)
310+ SetJNIFieldInt (env, cls, jpaintInfo, " plane_count" , info.plane_count );
311+ #else
312+ SetJNIFieldInt (env, cls, jpaintInfo, " plane_count" , 0 );
313+ #endif
307314
308315 JNI_CALL_VOID_METHOD (env, handle_, " onAcceleratedPaint" ,
309316 " (Lorg/cef/browser/CefBrowser;Z[Ljava/awt/"
0 commit comments