本文整理汇总了C++中SurfaceDescriptor::get_Shmem方法的典型用法代码示例。如果您正苦于以下问题:C++ SurfaceDescriptor::get_Shmem方法的具体用法?C++ SurfaceDescriptor::get_Shmem怎么用?C++ SurfaceDescriptor::get_Shmem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SurfaceDescriptor
的用法示例。
在下文中一共展示了SurfaceDescriptor::get_Shmem方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Open
/*static*/ already_AddRefed<gfxASurface>
ShadowLayerForwarder::PlatformOpenDescriptor(OpenMode aMode,
const SurfaceDescriptor& aSurface)
{
if (SurfaceDescriptor::TShmem != aSurface.type()) {
return nullptr;
}
return gfxSharedQuartzSurface::Open(aSurface.get_Shmem());
}
示例2: PlatformOpenDescriptor
/*static*/ already_AddRefed<gfxASurface>
ShadowLayerForwarder::OpenDescriptor(const SurfaceDescriptor& aSurface)
{
nsRefPtr<gfxASurface> surf = PlatformOpenDescriptor(aSurface);
if (surf) {
return surf.forget();
}
switch (aSurface.type()) {
case SurfaceDescriptor::TShmem: {
surf = gfxSharedImageSurface::Open(aSurface.get_Shmem());
return surf.forget();
}
default:
NS_RUNTIMEABORT("unexpected SurfaceDescriptor type!");
return nsnull;
}
}
示例3: Open
/*static*/ already_AddRefed<gfxASurface>
ShadowLayerForwarder::PlatformOpenDescriptor(OpenMode aMode,
const SurfaceDescriptor& aSurface)
{
if (aSurface.type() == SurfaceDescriptor::TShmem) {
return gfxSharedQuartzSurface::Open(aSurface.get_Shmem());
} else if (aSurface.type() == SurfaceDescriptor::TMemoryImage) {
const MemoryImage& image = aSurface.get_MemoryImage();
gfxASurface::gfxImageFormat format
= static_cast<gfxASurface::gfxImageFormat>(image.format());
nsRefPtr<gfxASurface> surf =
new gfxQuartzSurface((unsigned char*)image.data(),
image.size(),
image.stride(),
format);
return surf.forget();
}
return nullptr;
}