当前位置: 首页>>代码示例>>C++>>正文


C++ IDirectFB::CreateDataBuffer方法代码示例

本文整理汇总了C++中IDirectFB::CreateDataBuffer方法的典型用法代码示例。如果您正苦于以下问题:C++ IDirectFB::CreateDataBuffer方法的具体用法?C++ IDirectFB::CreateDataBuffer怎么用?C++ IDirectFB::CreateDataBuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDirectFB的用法示例。


在下文中一共展示了IDirectFB::CreateDataBuffer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: fromDataBufferDescription

bool QDirectFBPixmapData::fromDataBufferDescription(const DFBDataBufferDescription &dataBufferDescription)
{
    IDirectFB *dfb = screen->dfb();
    Q_ASSERT(dfb);
    DFBResult result = DFB_OK;
    IDirectFBDataBuffer *dataBufferPtr;
    if ((result = dfb->CreateDataBuffer(dfb, &dataBufferDescription, &dataBufferPtr)) != DFB_OK) {
        DirectFBError("QDirectFBPixmapData::fromDataBufferDescription()", result);
        return false;
    }
    QDirectFBPointer<IDirectFBDataBuffer> dataBuffer(dataBufferPtr);

    IDirectFBImageProvider *providerPtr;
    if ((result = dataBuffer->CreateImageProvider(dataBuffer.data(), &providerPtr)) != DFB_OK)
        return false;

    QDirectFBPointer<IDirectFBImageProvider> provider(providerPtr);

    DFBImageDescription imageDescription;
    result = provider->GetImageDescription(provider.data(), &imageDescription);
    if (result != DFB_OK) {
        DirectFBError("QDirectFBPixmapData::fromSurfaceDescription(): Can't get image description", result);
        return false;
    }

    if (imageDescription.caps & DICAPS_COLORKEY) {
        return false;
    }

    DFBSurfaceDescription surfaceDescription;
    if ((result = provider->GetSurfaceDescription(provider.data(), &surfaceDescription)) != DFB_OK) {
        DirectFBError("QDirectFBPixmapData::fromDataBufferDescription(): Can't get surface description", result);
        return false;
    }

    alpha = imageDescription.caps & DICAPS_ALPHACHANNEL;
    imageFormat = alpha ? screen->alphaPixmapFormat() : screen->pixelFormat();

    dfbSurface = screen->createDFBSurface(QSize(surfaceDescription.width, surfaceDescription.height),
                                          imageFormat, QDirectFBScreen::TrackSurface);

    result = provider->RenderTo(provider.data(), dfbSurface, 0);
    if (result != DFB_OK) {
        DirectFBError("QDirectFBPixmapData::fromSurfaceDescription(): Can't render to surface", result);
        return false;
    }

    w = surfaceDescription.width;
    h = surfaceDescription.height;
    is_null = (w <= 0 || h <= 0);
    d = QDirectFBScreen::depth(imageFormat);
    setSerialNumber(++global_ser_no);

#if defined QT_DIRECTFB_IMAGEPROVIDER_KEEPALIVE
    screen->setDirectFBImageProvider(providerPtr);
    provider.take();
#endif

    return true;
}
开发者ID:stephaneAG,项目名称:PengPod700,代码行数:60,代码来源:qdirectfbpixmap.cpp

示例2: Thread

	DFBDataBuffer::DFBDataBuffer(void* data, unsigned int dataSize) : Thread() {
		IDirectFB* dfb = NULL;

		deviceUri          = NULL;
		deviceFd           = -1;
		this->dataSize     = dataSize;
		this->data         = new char[dataSize];

		desc.file          = NULL;
		desc.memory.data   = data;
		desc.memory.length = dataSize;
		desc.flags         = (DFBDataBufferDescriptionFlags)DBDESC_MEMORY;

		dfb = (IDirectFB*)(LocalDeviceManager::getInstance()->getGfxRoot());
		dfb->CreateDataBuffer(dfb, &desc, &dataBuffer);
	}
开发者ID:Gingar,项目名称:port,代码行数:16,代码来源:DFBDataBuffer.cpp


注:本文中的IDirectFB::CreateDataBuffer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。