Skip to content

Commit 9225a3a

Browse files
committed
fix: unix compile
1 parent 251c7aa commit 9225a3a

1 file changed

Lines changed: 5 additions & 25 deletions

File tree

native/render_handler.cpp

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -253,13 +253,6 @@ void RenderHandler::OnPaint(CefRefPtr<CefBrowser> browser,
253253
const void* buffer,
254254
int width,
255255
int height) {
256-
// Debug output for regular paint calls
257-
printf("[DEBUG] OnPaint (regular) called:\n");
258-
printf(" - Type: %s\n", type == PET_VIEW ? "VIEW" : "POPUP");
259-
printf(" - Dirty rects count: %zu\n", dirtyRects.size());
260-
printf(" - Buffer: %p\n", buffer);
261-
printf(" - Width: %d, Height: %d\n", width, height);
262-
263256
ScopedJNIEnv env;
264257
if (!env)
265258
return;
@@ -275,21 +268,12 @@ void RenderHandler::OnPaint(CefRefPtr<CefBrowser> browser,
275268
"Rectangle;Ljava/nio/ByteBuffer;II)V",
276269
jbrowser.get(), jtype, jrectArray.get(),
277270
jdirectBuffer.get(), width, height);
278-
279-
printf("[DEBUG] OnPaint (regular) completed\n");
280271
}
281272

282273
void RenderHandler::OnAcceleratedPaint(CefRefPtr<CefBrowser> browser,
283274
PaintElementType type,
284275
const RectList& dirtyRects,
285276
const CefAcceleratedPaintInfo& info) {
286-
// Debug output for accelerated paint calls
287-
printf("[DEBUG] OnAcceleratedPaint called:\n");
288-
printf(" - Type: %s\n", type == PET_VIEW ? "VIEW" : "POPUP");
289-
printf(" - Dirty rects count: %zu\n", dirtyRects.size());
290-
printf(" - Shared texture handle: 0x%llx\n", reinterpret_cast<unsigned long long>(info.shared_texture_handle));
291-
printf(" - Format: %d\n", info.format);
292-
293277
ScopedJNIEnv env;
294278
if (!env)
295279
return;
@@ -310,26 +294,22 @@ void RenderHandler::OnAcceleratedPaint(CefRefPtr<CefBrowser> browser,
310294
CefRect viewRect;
311295
GetViewRect(browser, viewRect);
312296
// Set the fields of the paint info object
297+
#if defined(OS_WIN)
313298
SetJNIFieldLong(env, cls, jpaintInfo, "shared_texture_handle",
314299
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
315304
SetJNIFieldInt(env, cls, jpaintInfo, "format", info.format);
316305
SetJNIFieldInt(env, cls, jpaintInfo, "width", viewRect.width);
317306
SetJNIFieldInt(env, cls, jpaintInfo, "height", viewRect.height);
318307

319-
// Debug output for Java object values
320-
printf("[DEBUG] Sending to Java:\n");
321-
printf(" - shared_texture_handle: 0x%llx\n", reinterpret_cast<unsigned long long>(info.shared_texture_handle));
322-
printf(" - format: %d\n", info.format);
323-
printf(" - width: %d (from viewRect)\n", viewRect.width);
324-
printf(" - height: %d (from viewRect)\n", viewRect.height);
325-
326308
JNI_CALL_VOID_METHOD(env, handle_, "onAcceleratedPaint",
327309
"(Lorg/cef/browser/CefBrowser;Z[Ljava/awt/"
328310
"Rectangle;Lorg/cef/handler/CefAcceleratedPaintInfo;)V",
329311
jbrowser.get(), jtype, jrectArray.get(),
330312
jpaintInfo.get());
331-
332-
printf("[DEBUG] OnAcceleratedPaint completed\n");
333313
}
334314

335315
bool RenderHandler::StartDragging(CefRefPtr<CefBrowser> browser,

0 commit comments

Comments
 (0)