DisplaySourceBitmapImpl.cpp revision 3cdef5504e9fb186b78113c97636a33a479ffeeb
/* $Id$ */
/** @file
*
* Bitmap of a guest screen implementation.
*/
/*
* Copyright (C) 2014 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#include "DisplayImpl.h"
#include "Logging.h"
/*
* DisplaySourceBitmap implementation.
*/
{
return BaseFinalConstruct();
}
void DisplaySourceBitmap::FinalRelease()
{
uninit();
}
HRESULT DisplaySourceBitmap::init(ComObjPtr<Display> pDisplay, unsigned uScreenId, DISPLAYFBINFO *pFBInfo)
{
/* Enclose the state transition NotReady->InInit->Ready */
AutoInitSpan autoInitSpan(this);
m.pu8Allocated = NULL;
m.pu8Address = NULL;
m.ulWidth = 0;
m.ulHeight = 0;
m.ulBitsPerPixel = 0;
m.ulBytesPerLine = 0;
m.ulPixelFormat = 0;
if (RT_FAILURE(rc))
return E_FAIL;
/* Confirm a successful initialization */
return S_OK;
}
void DisplaySourceBitmap::uninit()
{
/* Enclose the state transition Ready->InUninit->NotReady */
AutoUninitSpan autoUninitSpan(this);
if (autoUninitSpan.uninitDone())
return;
}
{
return hr;
}
{
*aAddress = m.pu8Address;
*aBitsPerPixel = m.ulBitsPerPixel;
*aBytesPerLine = m.ulBytesPerLine;
*aPixelFormat = m.ulPixelFormat;
return hr;
}
{
int rc = VINF_SUCCESS;
{
return VERR_NOT_SUPPORTED;
}
ULONG ulBitsPerPixel = 0;
ULONG ulBytesPerLine = 0;
ULONG ulPixelFormat = 0;
{
/* From VRAM. */
ulPixelFormat = 0;
m.pu8Allocated = NULL;
}
else
{
/* Allocated byffer */
ulBitsPerPixel = 32;
ulPixelFormat = 0;
if (m.pu8Allocated == NULL)
{
rc = VERR_NO_MEMORY;
}
else
{
pAddress = m.pu8Allocated;
}
}
if (RT_SUCCESS(rc))
{
m.pu8Address = pAddress;
}
return rc;
}
/* vi: set tabstop=4 shiftwidth=4 expandtab: */