OLD | NEW |
(Empty) | |
| 1 # To be used with |
| 2 # sel_universal_ppapi_replay_prolog.stdin |
| 3 # define a bunch of variables for readability |
| 4 |
| 5 set_variable MODULE i(4444) |
| 6 set_variable INSTANCE i(5555) |
| 7 # PP_Size |
| 8 set_variable IMG_FMT R(8,4:400,4:400) |
| 9 set_variable IMG_HANDLE i(7) |
| 10 set_variable GRAPHICS_HANLDE i(8) |
| 11 # PP_ImageDataDesc |
| 12 set_variable IMG_FMT2 R(16,4:0,4:400,4:400,4:1600) |
| 13 # image size is width x height x 4-byte-pixel |
| 14 set_variable IMG_SIZE 640000 |
| 15 # PP_Size |
| 16 set_variable GRAPHICS_FMT R(8,4:400,4:400) |
| 17 |
| 18 echo |
| 19 echo "*** INIT MODULE" |
| 20 replay 1 PPB_GetInterface:s:i s("PPB_Core;1.0") * i(1) |
| 21 replay 1 PPB_GetInterface:s:i s("PPB_Instance;1.0") * i(1) |
| 22 replay 1 PPB_GetInterface:s:i s("PPB_ImageData;1.0") * i(1) |
| 23 replay 1 PPB_GetInterface:s:i s("PPB_Graphics2D;1.0") * i(1) |
| 24 # The results contain a process id which is non-determinisitic. The |
| 25 # 'hide-results' option suppresses this output to help with golden file. |
| 26 rpc PPP_InitializeModule hide-results i(0) ${MODULE} h(pepper_desc) s("${service
_string}") * i(0) i(0) |
| 27 |
| 28 echo |
| 29 echo "*** INIT INSTANCE" |
| 30 set_variable TAGS C(6,color\000) |
| 31 set_variable VALUES C(5,0xaa\000) |
| 32 |
| 33 # The PPP_GetInterface() call is probably not necessary, we just emulate what |
| 34 # happens in real life |
| 35 rpc PPP_GetInterface s("PPP_Instance;1.0") * i(0) |
| 36 rpc PPP_Instance_DidCreate ${INSTANCE} i(1) ${TAGS} ${VALUES} * i(0) |
| 37 |
| 38 echo |
| 39 echo "*** SETTTING UP VIDEO MEMORY" |
| 40 |
| 41 # video size is image size rounded up to 64k |
| 42 shmem video_handle video_address 655360 |
| 43 memset ${video_address} 0 ${IMG_SIZE} 0 |
| 44 checksum ${video_address} 0 ${IMG_SIZE} |
| 45 |
| 46 echo |
| 47 echo "*** TRIGGER REPAINT" |
| 48 replay 1 PPB_Core_AddRefResource:i: ${GRAPHICS_HANLDE} * |
| 49 replay 1 PPB_ImageData_Create:iiCi:i ${INSTANCE} i(0) ${IMG_FMT} i(1) * ${IMG_HA
NDLE} |
| 50 replay 1 PPB_ImageData_Describe:i:Chii ${IMG_HANDLE} * ${IMG_FMT2} h(video_handl
e) i(${IMG_SIZE}) i(1) |
| 51 replay 1 PPB_Graphics2D_Create:iCi:i ${INSTANCE} ${GRAPHICS_FMT} i(0) * ${GRAPHI
CS_HANLDE} |
| 52 replay 1 PPB_Instance_BindGraphics:ii:i ${INSTANCE} ${GRAPHICS_HANLDE} * i(1) |
| 53 replay 1 PPB_Graphics2D_ReplaceContents:ii: ${GRAPHICS_HANLDE} ${IMG_HANDLE} * |
| 54 replay 1 PPB_Graphics2D_Flush:ii:i ${GRAPHICS_HANLDE} i(1) * i(-1) |
| 55 replay 1 ReleaseResourceMultipleTimes:ii: ${IMG_HANDLE} i(1) * |
| 56 replay 1 PPB_Core_ReleaseResource:i: ${GRAPHICS_HANLDE} * |
| 57 rpc PPP_Instance_DidChangeView ${INSTANCE} I(4,8,79,400,400) I(4,0,0,400,400) * |
| 58 |
| 59 echo |
| 60 echo "*** CHECKING MEMORY" |
| 61 checksum ${video_address} 0 ${IMG_SIZE} |
| 62 |
| 63 rpc PPP_ShutdownModule * |
OLD | NEW |