Changeset 84465 in vbox for trunk/src/VBox/Additions/WINNT/Graphics
- Timestamp:
- May 22, 2020 5:34:44 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Video/mp/wddm/VBoxMPWddm.cpp
r84325 r84465 2685 2685 } 2686 2686 2687 BOOL vboxWddmPointerCopyColorData(CONST DXGKARG_SETPOINTERSHAPE* pSetPointerShape, PVIDEO_POINTER_ATTRIBUTES pPointerAttributes) 2687 BOOL vboxWddmPointerCopyColorData(CONST DXGKARG_SETPOINTERSHAPE* pSetPointerShape, PVIDEO_POINTER_ATTRIBUTES pPointerAttributes, 2688 bool fDwordAlignScanlines) 2688 2689 { 2689 2690 ULONG srcMaskW, srcMaskH; … … 2713 2714 pDst = pPointerAttributes->Pixels; 2714 2715 dstBytesPerLine = (pPointerAttributes->Width+7)/8; 2716 if (fDwordAlignScanlines) 2717 dstBytesPerLine = RT_ALIGN_T(dstBytesPerLine, 4, ULONG); 2715 2718 2716 2719 /* sanity check */ … … 2752 2755 } 2753 2756 2754 BOOL vboxWddmPointerCopyMonoData(CONST DXGKARG_SETPOINTERSHAPE* pSetPointerShape, PVIDEO_POINTER_ATTRIBUTES pPointerAttributes) 2757 BOOL vboxWddmPointerCopyMonoData(CONST DXGKARG_SETPOINTERSHAPE* pSetPointerShape, PVIDEO_POINTER_ATTRIBUTES pPointerAttributes, 2758 bool fDwordAlignScanlines) 2755 2759 { 2756 2760 ULONG srcMaskW, srcMaskH; … … 2790 2794 pDst = pPointerAttributes->Pixels; 2791 2795 dstBytesPerLine = (pPointerAttributes->Width+7)/8; 2796 if (fDwordAlignScanlines) 2797 dstBytesPerLine = RT_ALIGN_T(dstBytesPerLine, 4, ULONG); 2792 2798 2793 2799 for (y=0; y<pPointerAttributes->Height; ++y) … … 2814 2820 } 2815 2821 2816 static BOOLEAN vboxVddmPointerShapeToAttributes(CONST DXGKARG_SETPOINTERSHAPE* pSetPointerShape, PVBOXWDDM_POINTER_INFO pPointerInfo) 2822 static BOOLEAN vboxVddmPointerShapeToAttributes(CONST DXGKARG_SETPOINTERSHAPE* pSetPointerShape, PVBOXWDDM_POINTER_INFO pPointerInfo, 2823 bool fDwordAlignScanlines) 2817 2824 { 2818 2825 PVIDEO_POINTER_ATTRIBUTES pPointerAttributes = &pPointerInfo->Attributes.data; … … 2823 2830 if (pSetPointerShape->Flags.Color) 2824 2831 { 2825 if (vboxWddmPointerCopyColorData(pSetPointerShape, pPointerAttributes ))2832 if (vboxWddmPointerCopyColorData(pSetPointerShape, pPointerAttributes, fDwordAlignScanlines)) 2826 2833 { 2827 2834 pPointerAttributes->Flags = VIDEO_MODE_COLOR_POINTER; … … 2838 2845 else if (pSetPointerShape->Flags.Monochrome) 2839 2846 { 2840 if (vboxWddmPointerCopyMonoData(pSetPointerShape, pPointerAttributes ))2847 if (vboxWddmPointerCopyMonoData(pSetPointerShape, pPointerAttributes, fDwordAlignScanlines)) 2841 2848 { 2842 2849 pPointerAttributes->Flags = VIDEO_MODE_MONO_POINTER; … … 2887 2894 { 2888 2895 /* Size of the pointer data: sizeof(AND mask) + sizeof(XOR mask) */ 2889 cbAndMask = ((((cWidth + 7) / 8) * cHeight + 3) & ~3); 2896 /* "Each scanline is padded to a 32-bit boundary." */ 2897 cbAndMask = ((((cWidth + 7) / 8) + 3) & ~3) * cHeight; 2890 2898 cbXorMask = cWidth * 4 * cHeight; 2891 2899 … … 3028 3036 PVBOXMP_DEVEXT pDevExt = (PVBOXMP_DEVEXT)hAdapter; 3029 3037 PVBOXWDDM_POINTER_INFO pPointerInfo = &pDevExt->aSources[pSetPointerShape->VidPnSourceId].PointerInfo; 3038 bool const fDwordAlignScanlines = pDevExt->enmHwType != VBOXVIDEO_HWTYPE_VBOX; 3030 3039 /** @todo to avoid extra data copy and extra heap allocation, 3031 3040 * need to maintain the pre-allocated HGSMI buffer and convert the data directly to it */ 3032 if (vboxVddmPointerShapeToAttributes(pSetPointerShape, pPointerInfo ))3041 if (vboxVddmPointerShapeToAttributes(pSetPointerShape, pPointerInfo, fDwordAlignScanlines)) 3033 3042 { 3034 3043 pDevExt->PointerInfo.iLastReportedScreen = pSetPointerShape->VidPnSourceId;
Note:
See TracChangeset
for help on using the changeset viewer.