本文整理汇总了C++中nsAutoPtr::GetDDSurface方法的典型用法代码示例。如果您正苦于以下问题:C++ nsAutoPtr::GetDDSurface方法的具体用法?C++ nsAutoPtr::GetDDSurface怎么用?C++ nsAutoPtr::GetDDSurface使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nsAutoPtr
的用法示例。
在下文中一共展示了nsAutoPtr::GetDDSurface方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnPaint
//.........这里部分代码省略.........
} else
#endif
#ifdef CAIRO_HAS_D2D_SURFACE
if (result) {
if (mD2DWindowSurface) {
mD2DWindowSurface->Present();
}
}
#endif
if (result) {
if (IsRenderMode(gfxWindowsPlatform::RENDER_GDI)) {
// Only update if DispatchWindowEvent returned TRUE; otherwise, nothing handled
// this, and we'll just end up painting with black.
thebesContext->PopGroupToSource();
thebesContext->SetOperator(gfxContext::OPERATOR_SOURCE);
thebesContext->Paint();
} else if (IsRenderMode(gfxWindowsPlatform::RENDER_DDRAW) ||
IsRenderMode(gfxWindowsPlatform::RENDER_DDRAW_GL))
{
#ifdef CAIRO_HAS_DDRAW_SURFACE
// blit with direct draw
HRESULT hr = glpDDClipper->SetHWnd(0, mWnd);
#ifdef DEBUG
if (FAILED(hr))
DDError("SetHWnd", hr);
#endif
// blt from the affected area from the window back-buffer to the
// screen-relative coordinates of the window paint area
RECT dst_rect = ps.rcPaint;
MapWindowPoints(mWnd, NULL, (LPPOINT)&dst_rect, 2);
hr = glpDDPrimary->Blt(&dst_rect,
gpDDSurf->GetDDSurface(),
&dst_rect,
DDBLT_WAITNOTBUSY,
NULL);
#ifdef DEBUG
if (FAILED(hr))
DDError("SetHWnd", hr);
#endif
#endif
} else if (IsRenderMode(gfxWindowsPlatform::RENDER_IMAGE_STRETCH24) ||
IsRenderMode(gfxWindowsPlatform::RENDER_IMAGE_STRETCH32))
{
gfxIntSize surfaceSize = targetSurfaceImage->GetSize();
// Just blit this directly
BITMAPINFOHEADER bi;
memset(&bi, 0, sizeof(BITMAPINFOHEADER));
bi.biSize = sizeof(BITMAPINFOHEADER);
bi.biWidth = surfaceSize.width;
bi.biHeight = - surfaceSize.height;
bi.biPlanes = 1;
bi.biBitCount = 32;
bi.biCompression = BI_RGB;
if (IsRenderMode(gfxWindowsPlatform::RENDER_IMAGE_STRETCH24)) {
// On Windows CE/Windows Mobile, 24bpp packed-pixel sources
// seem to be far faster to blit than 32bpp (see bug 484864).
// So, convert the bits to 24bpp by stripping out the unused
// alpha byte. 24bpp DIBs also have scanlines that are 4-byte
// aligned though, so that must be taken into account.
int srcstride = surfaceSize.width*4;
int dststride = surfaceSize.width*3;
dststride = (dststride + 3) & ~3;