本文整理汇总了C++中IDirectFBSurface::AddRef方法的典型用法代码示例。如果您正苦于以下问题:C++ IDirectFBSurface::AddRef方法的具体用法?C++ IDirectFBSurface::AddRef怎么用?C++ IDirectFBSurface::AddRef使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IDirectFBSurface
的用法示例。
在下文中一共展示了IDirectFBSurface::AddRef方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: while
DFBResult
lite_theme_frame_load( LiteThemeFrame *frame,
const char **filenames )
{
int i, y;
int width = 0;
int height = 0;
DFBResult ret;
D_ASSERT( frame != NULL );
D_ASSERT( filenames != NULL );
for (i=0; i<_LITE_THEME_FRAME_PART_NUM; i++) {
D_ASSERT( filenames[i] != NULL );
ret = lite_util_load_image( filenames[i],
DSPF_UNKNOWN,
&frame->parts[i].source,
&frame->parts[i].rect.w,
&frame->parts[i].rect.h,
NULL );
if (ret) {
D_DERROR( ret, "Lite/ThemeFrame: Loading '%s' failed!\n", filenames[i] );
while (i--)
frame->parts[i].source->Release( frame->parts[i].source );
return ret;
}
if (width < frame->parts[i].rect.w)
width = frame->parts[i].rect.w;
height += frame->parts[i].rect.h;
}
IDirectFB *dfb;
IDirectFBSurface *compact;
DFBSurfaceDescription desc;
desc.flags = DSDESC_WIDTH | DSDESC_HEIGHT | DSDESC_PIXELFORMAT;
desc.width = width;
desc.height = height;
desc.pixelformat = DSPF_ARGB; //FIXME
DirectFBCreate( &dfb );
dfb->CreateSurface( dfb, &desc, &compact );
compact->Clear( compact, 0, 0, 0, 0 );
for (i=0, y=0; i<_LITE_THEME_FRAME_PART_NUM; i++) {
compact->Blit( compact, frame->parts[i].source, &frame->parts[i].rect, 0, y );
compact->AddRef( compact );
frame->parts[i].source->Release( frame->parts[i].source );
frame->parts[i].source = compact;
frame->parts[i].rect.x = 0;
frame->parts[i].rect.y = y;
y += frame->parts[i].rect.h;
}
compact->ReleaseSource( compact );
compact->Release( compact );
dfb->Release( dfb );
D_MAGIC_SET( frame, LiteThemeFrame );
return DFB_OK;
}