Changeset 29542 in vbox
- Timestamp:
- May 17, 2010 1:41:20 PM (15 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxSDL/VBoxSDL.cpp
r29518 r29542 107 107 com::SafeArray <BYTE> aShape(ComSafeArrayInArg (pShape)); 108 108 size_t cbShapeSize = aShape.size(); 109 shape.resize(cbShapeSize); 110 ::memcpy(shape.raw(), aShape.raw(), cbShapeSize); 109 if (cbShapeSize > 0) 110 { 111 shape.resize(cbShapeSize); 112 ::memcpy(shape.raw(), aShape.raw(), cbShapeSize); 113 } 111 114 } 112 115 -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleView.cpp
r29518 r29542 216 216 com::SafeArray <BYTE> aShape(ComSafeArrayInArg (pShape)); 217 217 size_t cbShapeSize = aShape.size(); 218 shape.resize(cbShapeSize); 219 ::memcpy(shape.raw(), aShape.raw(), cbShapeSize); 218 if (cbShapeSize > 0) 219 { 220 shape.resize(cbShapeSize); 221 ::memcpy(shape.raw(), aShape.raw(), cbShapeSize); 222 } 220 223 } 221 224 ~MousePointerChangeEvent() … … 228 231 uint width() const { return w; } 229 232 uint height() const { return h; } 230 const uchar *shapeData() const { return shape. raw(); }233 const uchar *shapeData() const { return shape.size() > 0 ? shape.raw() : NULL; } 231 234 private: 232 235 bool vis, alph; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r29518 r29542 60 60 { 61 61 com::SafeArray <BYTE> aShape(ComSafeArrayInArg (pShape)); 62 size_t cbShapeSize = aShape.size(); 63 m_shape.resize(cbShapeSize); 64 ::memcpy(m_shape.raw(), aShape.raw(), cbShapeSize); 62 size_t cbShapeSize = aShape.size(); 63 if (cbShapeSize > 0) 64 { 65 m_shape.resize(cbShapeSize); 66 ::memcpy(m_shape.raw(), aShape.raw(), cbShapeSize); 67 } 65 68 } 66 69 … … 75 78 uint width() const { return m_uWidth; } 76 79 uint height() const { return m_uHeight; } 77 const uchar *shapeData() const { return m_shape. raw(); }80 const uchar *shapeData() const { return m_shape.size() > 0 ? m_shape.raw() : NULL; } 78 81 79 82 private: -
trunk/src/VBox/Main/DisplayImpl.cpp
r29518 r29542 3829 3829 Display *pThis = pDrv->pDisplay; 3830 3830 3831 size_t cbShapeSize = (cx + 7) / 8 * cy; /* size of the AND mask */ 3832 cbShapeSize = ((cbShapeSize + 3) & ~3) + cx * 4 * cy; /* + gap + size of the XOR mask */ 3831 size_t cbShapeSize = 0; 3832 3833 if (pvShape) 3834 { 3835 cbShapeSize = (cx + 7) / 8 * cy; /* size of the AND mask */ 3836 cbShapeSize = ((cbShapeSize + 3) & ~3) + cx * 4 * cy; /* + gap + size of the XOR mask */ 3837 } 3833 3838 com::SafeArray<BYTE> shapeData(cbShapeSize); 3834 ::memcpy(shapeData.raw(), pvShape, cbShapeSize); 3839 3840 if (pvShape) 3841 ::memcpy(shapeData.raw(), pvShape, cbShapeSize); 3835 3842 3836 3843 /* Tell the console about it */ -
trunk/src/VBox/Main/VMMDevInterface.cpp
r29518 r29542 284 284 285 285 /* tell the console about it */ 286 size_t cbShapeSize = (width + 7) / 8 * height; /* size of the AND mask */ 287 cbShapeSize = ((cbShapeSize + 3) & ~3) + width * 4 * height; /* + gap + size of the XOR mask */ 286 size_t cbShapeSize = 0; 287 288 if (pShape) 289 { 290 cbShapeSize = (width + 7) / 8 * height; /* size of the AND mask */ 291 cbShapeSize = ((cbShapeSize + 3) & ~3) + width * 4 * height; /* + gap + size of the XOR mask */ 292 } 288 293 com::SafeArray<BYTE> shapeData(cbShapeSize); 289 ::memcpy(shapeData.raw(), pShape, cbShapeSize); 294 if (pShape) 295 ::memcpy(shapeData.raw(), pShape, cbShapeSize); 290 296 pDrv->pVMMDev->getParent()->onMousePointerShapeChange(fVisible, fAlpha, 291 297 xHot, yHot, width, height, ComSafeArrayAsInParam(shapeData));
Note:
See TracChangeset
for help on using the changeset viewer.