Hi Mike,
I tried enabling offscreen memory context and I do see an improvement in memory usage.
However the horizontal scroll functionality which I implemented using PtScrollContainer stopped working.
Only the PtPane gets scrolled instead of the whole drawing area.Following is the code I used to create scroll container.
app->phwindow=PtCreateWidget(PtWindow, Pt_NO_PARENT, winargc, winargs);
/* Create PtOSContainer widget for flicker-free updating */
PtSetArg(&winargs[winargc++], Pt_ARG_DIM, &app->window.dimension, 0);
app->phoscontainer=PtCreateWidget(PtOSContainer, app->phwindow, winargc, winargs);
/*Create ScrollContainer for Horizontal Scroll in This Application*/
winargc=0;
PtSetArg(&winargs[winargc++], Pt_ARG_DIM, &app->window.dimension, 0);
PtSetArg(&winargs[winargc++], Pt_ARG_SCROLLBAR_Y_DISPLAY, Pt_NEVER, 0);//Vertical Scroll bar is not displayed as it
is already implemented.
app->scrollarea=PtCreateWidget(PtScrollContainer, app->phoscontainer, winargc, winargs);
/* Create PtRaw widget for drawings */
winargc=0;
PtSetArg(&winargs[winargc++], Pt_ARG_DIM, &app->window.dimension, 0);
PtSetArg(&winargs[winargc++], Pt_ARG_FILL_COLOR, PgRGB(0x70, 0x70, 0x70), 0);
PtSetArg(&winargs[winargc++], Pt_ARG_RAW_DRAW_F, phmupdf_draw_content, 0);
PtSetArg(&winargs[winargc++], Pt_ARG_POINTER, (void*)app, 0);
raw_cb.event_mask=Ph_EV_BUT_PRESS | Ph_EV_PTR_MOTION_BUTTON |
Ph_EV_PTR_MOTION_NOBUTTON | Ph_EV_BOUNDARY;
raw_cb.event_f=phmupdf_content_callback_raw;
raw_cb.data=(void*)app;
PtSetArg(&winargs[winargc++], Pt_CB_RAW, &raw_cb, 0);
/* Create the PtRaw widget */
app->phcontent=PtCreateWidget(PtRaw, app->scrollarea, winargc, winargs);
Does it have any relation of scroll container created on PtOSContainer and offscreen-memory context enabled at the same
time?