Changeset 24891 in vbox
- Timestamp:
- Nov 24, 2009 11:36:06 AM (15 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/GuestHost/OpenGL/state_tracker/state_snapshot.c
r24573 r24891 26 26 #include "cr_mem.h" 27 27 #include "cr_string.h" 28 #include "cr_pixeldata.h" 28 29 #include <stdio.h> 29 30 … … 1050 1051 #endif 1051 1052 1053 { 1054 CRViewportState *pVP = &pContext->viewport; 1055 CRPixelPackState packing = pContext->client.pack; 1056 GLint cbData = crPixelSize(GL_RGBA, GL_UNSIGNED_BYTE) * pVP->viewportH * pVP->viewportW; 1057 void *pData = crAlloc(cbData); 1058 1059 if (!pData) 1060 { 1061 return VERR_NO_MEMORY; 1062 } 1063 1064 diff_api.PixelStorei(GL_PACK_SKIP_ROWS, 0); 1065 diff_api.PixelStorei(GL_PACK_SKIP_PIXELS, 0); 1066 diff_api.PixelStorei(GL_PACK_ALIGNMENT, 1); 1067 diff_api.PixelStorei(GL_PACK_ROW_LENGTH, 0); 1068 diff_api.PixelStorei(GL_PACK_IMAGE_HEIGHT, 0); 1069 diff_api.PixelStorei(GL_PACK_SKIP_IMAGES, 0); 1070 diff_api.PixelStorei(GL_PACK_SWAP_BYTES, 0); 1071 diff_api.PixelStorei(GL_PACK_LSB_FIRST, 0); 1072 1073 diff_api.ReadPixels(0, 0, pVP->viewportW, pVP->viewportH, GL_RGBA, GL_UNSIGNED_BYTE, pData); 1074 1075 diff_api.PixelStorei(GL_PACK_SKIP_ROWS, packing.skipRows); 1076 diff_api.PixelStorei(GL_PACK_SKIP_PIXELS, packing.skipPixels); 1077 diff_api.PixelStorei(GL_PACK_ALIGNMENT, packing.alignment); 1078 diff_api.PixelStorei(GL_PACK_ROW_LENGTH, packing.rowLength); 1079 diff_api.PixelStorei(GL_PACK_IMAGE_HEIGHT, packing.imageHeight); 1080 diff_api.PixelStorei(GL_PACK_SKIP_IMAGES, packing.skipImages); 1081 diff_api.PixelStorei(GL_PACK_SWAP_BYTES, packing.swapBytes); 1082 diff_api.PixelStorei(GL_PACK_LSB_FIRST, packing.psLSBFirst); 1083 1084 rc = SSMR3PutMem(pSSM, pData, cbData); 1085 AssertRCReturn(rc, rc); 1086 1087 crFree(pData); 1088 } 1089 1052 1090 return VINF_SUCCESS; 1053 1091 } … … 1692 1730 #endif 1693 1731 1732 { 1733 CRViewportState *pVP = &pContext->viewport; 1734 CRPixelPackState unpack = pContext->client.unpack; 1735 GLint cbData = crPixelSize(GL_RGBA, GL_UNSIGNED_BYTE) * pVP->viewportH * pVP->viewportW; 1736 void *pData = crAlloc(cbData); 1737 1738 if (!pData) 1739 { 1740 return VERR_NO_MEMORY; 1741 } 1742 1743 rc = SSMR3GetMem(pSSM, pData, cbData); 1744 AssertRCReturn(rc, rc); 1745 1746 diff_api.PixelStorei(GL_UNPACK_SKIP_ROWS, 0); 1747 diff_api.PixelStorei(GL_UNPACK_SKIP_PIXELS, 0); 1748 diff_api.PixelStorei(GL_UNPACK_ALIGNMENT, 1); 1749 diff_api.PixelStorei(GL_UNPACK_ROW_LENGTH, 0); 1750 diff_api.PixelStorei(GL_UNPACK_IMAGE_HEIGHT, 0); 1751 diff_api.PixelStorei(GL_UNPACK_SKIP_IMAGES, 0); 1752 diff_api.PixelStorei(GL_UNPACK_SWAP_BYTES, 0); 1753 diff_api.PixelStorei(GL_UNPACK_LSB_FIRST, 0); 1754 1755 diff_api.WindowPos2iARB(0, 0); 1756 diff_api.DrawPixels(pVP->viewportW, pVP->viewportH, GL_RGBA, GL_UNSIGNED_BYTE, pData); 1757 1758 diff_api.PixelStorei(GL_UNPACK_SKIP_ROWS, unpack.skipRows); 1759 diff_api.PixelStorei(GL_UNPACK_SKIP_PIXELS, unpack.skipPixels); 1760 diff_api.PixelStorei(GL_UNPACK_ALIGNMENT, unpack.alignment); 1761 diff_api.PixelStorei(GL_UNPACK_ROW_LENGTH, unpack.rowLength); 1762 diff_api.PixelStorei(GL_UNPACK_IMAGE_HEIGHT, unpack.imageHeight); 1763 diff_api.PixelStorei(GL_UNPACK_SKIP_IMAGES, unpack.skipImages); 1764 diff_api.PixelStorei(GL_UNPACK_SWAP_BYTES, unpack.swapBytes); 1765 diff_api.PixelStorei(GL_UNPACK_LSB_FIRST, unpack.psLSBFirst); 1766 1767 crFree(pData); 1768 } 1769 1694 1770 return VINF_SUCCESS; 1695 1771 } -
trunk/src/VBox/HostServices/SharedOpenGL/crserver/crservice.cpp
r24503 r24891 71 71 72 72 static const char* gszVBoxOGLSSMMagic = "***OpenGL state data***"; 73 #define SHCROGL_SSM_VERSION 1 073 #define SHCROGL_SSM_VERSION 11 74 74 75 75 typedef struct
Note:
See TracChangeset
for help on using the changeset viewer.