Changeset 51610 in vbox for trunk/src/VBox/Main
- Timestamp:
- Jun 12, 2014 10:40:59 AM (11 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r51606 r51610 15234 15234 </enum> 15235 15235 15236 <enum15237 name="FramebufferUpdateMode"15238 uuid="1268d8ab-dd2f-443c-bc56-d93d3ced5cde"15239 >15240 <desc>15241 How a framebuffer is notified about screen updates.15242 </desc>15243 15244 <const name="NotifyUpdate" value="0">15245 <desc>15246 IFramebuffer::NotifyUpdate is called.15247 </desc>15248 </const>15249 <const name="NotifyUpdateImage" value="1">15250 <desc>15251 IFramebuffer::NotifyUpdateImage is called.15252 </desc>15253 </const>15254 </enum>15255 15256 15236 <interface 15257 15237 name="IDisplaySourceBitmap" extends="$unknown" wsmap="suppress" … … 15273 15253 <interface 15274 15254 name="IFramebuffer" extends="$unknown" 15275 uuid=" c42d2714-6263-473f-a6c4-3d3b38983e74"15255 uuid="929e4228-f7cf-436d-99a0-dcf6596473b2" 15276 15256 wsmap="managed" 15277 15257 > … … 15354 15334 <param name="width" type="unsigned long" dir="in"/> 15355 15335 <param name="height" type="unsigned long" dir="in"/> 15356 </method>15357 15358 <method name="notifyUpdateImage">15359 <desc>15360 Informs about an update and provides 32bpp bitmap.15361 </desc>15362 <param name="x" type="unsigned long" dir="in"/>15363 <param name="y" type="unsigned long" dir="in"/>15364 <param name="width" type="unsigned long" dir="in"/>15365 <param name="height" type="unsigned long" dir="in"/>15366 <param name="image" type="octet" dir="in" safearray="yes">15367 <desc>15368 Array with 32BPP image data.15369 </desc>15370 </param>15371 15336 </method> 15372 15337 … … 15552 15517 <interface 15553 15518 name="IDisplay" extends="$unknown" 15554 uuid=" a2bb2e85-f797-4c5e-884c-2efd897af4f4"15519 uuid="efd0567f-8697-4b4c-965a-7f3672d1909e" 15555 15520 wsmap="managed" 15556 15521 > … … 15887 15852 <param name="displaySourceBitmap" type="IDisplaySourceBitmap" dir="out"/> 15888 15853 </method> 15889 15890 <attribute name="framebufferUpdateMode" type="FramebufferUpdateMode">15891 <desc>How the Framebuffer is informed aboput screen updates.</desc>15892 </attribute>15893 15854 15894 15855 </interface> -
trunk/src/VBox/Main/include/DisplayImpl.h
r51606 r51610 47 47 bool fDisabled; 48 48 49 struct50 {51 ComPtr<IDisplaySourceBitmap> pSourceBitmap;52 uint8_t *pu8Address;53 uint32_t cbLine;54 } updateImage;55 56 49 LONG xOrigin; 57 50 LONG yOrigin; … … 190 183 // IEventListener methods 191 184 STDMETHOD(HandleEvent)(IEvent * aEvent); 192 193 // IDisplay properties194 STDMETHOD(COMGETTER(FramebufferUpdateMode))(FramebufferUpdateMode_T *aFramebufferUpdateMode);195 STDMETHOD(COMSETTER(FramebufferUpdateMode))(FramebufferUpdateMode_T aFramebufferUpdateMode);196 185 197 186 // IDisplay methods … … 304 293 bool volatile fVGAResizing; 305 294 306 FramebufferUpdateMode_T mFramebufferUpdateMode;307 308 295 VBVAMEMORY *mpVbvaMemory; 309 296 bool mfVideoAccelEnabled; -
trunk/src/VBox/Main/src-client/DisplayImpl.cpp
r51607 r51610 586 586 fVGAResizing = false; 587 587 588 mFramebufferUpdateMode = FramebufferUpdateMode_NotifyUpdate;589 590 588 ULONG ul; 591 589 mParent->machine()->COMGETTER(MonitorCount)(&ul); … … 601 599 /* All secondary monitors are disabled at startup. */ 602 600 maFramebuffers[ul].fDisabled = ul > 0; 603 604 maFramebuffers[ul].updateImage.pu8Address = NULL;605 maFramebuffers[ul].updateImage.cbLine = 0;606 601 607 602 maFramebuffers[ul].xOrigin = 0; … … 665 660 { 666 661 maFramebuffers[uScreenId].pSourceBitmap.setNull(); 667 maFramebuffers[uScreenId].updateImage.pSourceBitmap.setNull();668 maFramebuffers[uScreenId].updateImage.pu8Address = NULL;669 maFramebuffers[uScreenId].updateImage.cbLine = 0;670 662 maFramebuffers[uScreenId].pFramebuffer.setNull(); 671 663 } … … 904 896 return VINF_SUCCESS; 905 897 } 906 907 COMSETTER(FramebufferUpdateMode)(FramebufferUpdateMode_NotifyUpdate);908 898 909 899 if (uScreenId == VBOX_VIDEO_PRIMARY_SCREEN) … … 1134 1124 { 1135 1125 if (w != 0 && h != 0) 1136 { 1137 if (RT_LIKELY(mFramebufferUpdateMode == FramebufferUpdateMode_NotifyUpdate)) 1138 { 1139 pFramebuffer->NotifyUpdate(x, y, w, h); 1140 } 1141 else if (mFramebufferUpdateMode == FramebufferUpdateMode_NotifyUpdateImage) 1142 { 1143 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 1144 1145 DISPLAYFBINFO *pFBInfo = &maFramebuffers[uScreenId]; 1146 1147 if (!pFBInfo->updateImage.pSourceBitmap.isNull()) 1148 { 1149 Assert(pFBInfo->updateImage.pu8Address); 1150 1151 size_t cbData = w * h * 4; 1152 com::SafeArray<BYTE> image(cbData); 1153 1154 uint8_t *pu8Dst = image.raw(); 1155 const uint8_t *pu8Src = pFBInfo->updateImage.pu8Address + pFBInfo->updateImage.cbLine * y + x * 4; 1156 1157 int i; 1158 for (i = y; i < y + h; ++i) 1159 { 1160 memcpy(pu8Dst, pu8Src, w * 4); 1161 pu8Dst += w * 4; 1162 pu8Src += pFBInfo->updateImage.cbLine; 1163 } 1164 1165 pFramebuffer->NotifyUpdateImage(x, y, w, h, ComSafeArrayAsInParam(image)); 1166 } 1167 } 1168 } 1126 pFramebuffer->NotifyUpdate(x, y, w, h); 1169 1127 } 1170 1128 … … 2224 2182 } 2225 2183 } 2226 }2227 2228 2229 /*2230 * IDisplay properties2231 */2232 2233 STDMETHODIMP Display::COMGETTER(FramebufferUpdateMode)(FramebufferUpdateMode_T *aFramebufferUpdateMode)2234 {2235 LogRelFlowFunc(("\n"));2236 2237 CheckComArgPointerValid(aFramebufferUpdateMode);2238 2239 AutoCaller autoCaller(this);2240 if (FAILED(autoCaller.rc())) return autoCaller.rc();2241 2242 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);2243 2244 *aFramebufferUpdateMode = mFramebufferUpdateMode;2245 2246 return S_OK;2247 }2248 2249 STDMETHODIMP Display::COMSETTER(FramebufferUpdateMode)(FramebufferUpdateMode_T aFramebufferUpdateMode)2250 {2251 LogRelFlowFunc(("aFramebufferUpdateMode %d\n", aFramebufferUpdateMode));2252 2253 AutoCaller autoCaller(this);2254 if (FAILED(autoCaller.rc())) return autoCaller.rc();2255 2256 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);2257 2258 /* Reset the update mode. */2259 unsigned uScreenId;2260 for (uScreenId = 0; uScreenId < mcMonitors; ++uScreenId)2261 {2262 DISPLAYFBINFO *pFBInfo = &maFramebuffers[uScreenId];2263 pFBInfo->updateImage.pu8Address = NULL;2264 pFBInfo->updateImage.cbLine = 0;2265 pFBInfo->updateImage.pSourceBitmap.setNull();2266 }2267 2268 if (aFramebufferUpdateMode == FramebufferUpdateMode_NotifyUpdateImage)2269 {2270 /* Query source bitmaps. */2271 for (uScreenId = 0; uScreenId < mcMonitors; ++uScreenId)2272 {2273 DISPLAYFBINFO *pFBInfo = &maFramebuffers[uScreenId];2274 HRESULT hr = querySourceBitmap(uScreenId, pFBInfo->updateImage.pSourceBitmap.asOutParam());2275 if (SUCCEEDED(hr))2276 {2277 BYTE *pAddress = NULL;2278 ULONG ulWidth = 0;2279 ULONG ulHeight = 0;2280 ULONG ulBitsPerPixel = 0;2281 ULONG ulBytesPerLine = 0;2282 ULONG ulPixelFormat = 0;2283 2284 hr = pFBInfo->updateImage.pSourceBitmap->QueryBitmapInfo(&pAddress,2285 &ulWidth,2286 &ulHeight,2287 &ulBitsPerPixel,2288 &ulBytesPerLine,2289 &ulPixelFormat);2290 if (SUCCEEDED(hr))2291 {2292 pFBInfo->updateImage.pu8Address = pAddress;2293 pFBInfo->updateImage.cbLine = ulBytesPerLine;2294 }2295 }2296 2297 if (FAILED(hr))2298 {2299 pFBInfo->updateImage.pSourceBitmap.setNull();2300 }2301 }2302 }2303 2304 mFramebufferUpdateMode = aFramebufferUpdateMode;2305 2306 return S_OK;2307 2184 } 2308 2185
Note:
See TracChangeset
for help on using the changeset viewer.