本文整理汇总了C++中IDirectFBSurface::GetSubSurface方法的典型用法代码示例。如果您正苦于以下问题:C++ IDirectFBSurface::GetSubSurface方法的具体用法?C++ IDirectFBSurface::GetSubSurface怎么用?C++ IDirectFBSurface::GetSubSurface使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDirectFBSurface
的用法示例。
在下文中一共展示了IDirectFBSurface::GetSubSurface方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: l_GetSubSurface
static int l_GetSubSurface (lua_State* L)
{
// [ sfc | t_rect ]
IDirectFBSurface* sfc = * (IDirectFBSurface**) luaL_checkudata(L, 1, "ldirectfb.IDirectFBSurface");
IDirectFBSurface* sub;
DFBRectangle rect;
table2DFBRectangle(L, &rect);
DFBCHECK( sfc->GetSubSurface(sfc, &rect, &sub) );
lua_pushlightuserdata(L, sub); // [ sfc | t_rect | sub ]
l_IDirectFBSurface_toudata(L); // [ sfc | t_rect | _sub ]
return 1;
}
示例2: setGeometry
void QDirectFBWindowSurface::setGeometry(const QRect &rect)
{
const QRect oldRect = geometry();
if (oldRect == rect)
return;
IDirectFBSurface *oldSurface = dfbSurface;
const bool sizeChanged = oldRect.size() != rect.size();
if (sizeChanged) {
delete engine;
engine = 0;
releaseSurface();
Q_ASSERT(!dfbSurface);
}
if (rect.isNull()) {
#ifndef QT_NO_DIRECTFB_WM
if (dfbWindow) {
if (window())
window()->setProperty("_q_DirectFBWindowID", QVariant());
dfbWindow->Release(dfbWindow);
dfbWindow = 0;
}
#endif
Q_ASSERT(!dfbSurface);
#ifdef QT_DIRECTFB_SUBSURFACE
Q_ASSERT(!subSurface);
#endif
} else {
#ifdef QT_DIRECTFB_WM
if (!dfbWindow) {
createWindow(rect);
} else {
setWindowGeometry(dfbWindow, oldRect, rect);
Q_ASSERT(!sizeChanged || !dfbSurface);
if (sizeChanged)
dfbWindow->GetSurface(dfbWindow, &dfbSurface);
}
#else
IDirectFBSurface *primarySurface = screen->primarySurface();
DFBResult result = DFB_OK;
if (mode == Primary) {
Q_ASSERT(primarySurface);
if (rect == screen->region().boundingRect()) {
dfbSurface = primarySurface;
} else {
const DFBRectangle r = { rect.x(), rect.y(),
rect.width(), rect.height() };
result = primarySurface->GetSubSurface(primarySurface, &r, &dfbSurface);
}
} else { // mode == Offscreen
if (!dfbSurface) {
dfbSurface = screen->createDFBSurface(rect.size(), surfaceFlags() & Opaque ? screen->pixelFormat() : screen->alphaPixmapFormat(),
QDirectFBScreen::DontTrackSurface);
}
}
if (result != DFB_OK)
DirectFBErrorFatal("QDirectFBWindowSurface::setGeometry()", result);
#endif
}
if (oldSurface != dfbSurface) {
imageFormat = dfbSurface ? QDirectFBScreen::getImageFormat(dfbSurface) : QImage::Format_Invalid;
}
if (oldRect.size() != rect.size()) {
QWSWindowSurface::setGeometry(rect);
} else {
QWindowSurface::setGeometry(rect);
}
}