• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ setSurfaceFlags函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中setSurfaceFlags函数的典型用法代码示例。如果您正苦于以下问题:C++ setSurfaceFlags函数的具体用法?C++ setSurfaceFlags怎么用?C++ setSurfaceFlags使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: qDebug

void QWSHtml5CanvasSurface::setPermanentState(const QByteArray &data)
{
#ifdef QT_DEBUG_SURFACE
    qDebug() << "QWSHtml5CanvasSurface::setPermanentState()"<< "(" << (void*)this << ")";
#endif
    int width;
    int height;
    QImage::Format format;
    SurfaceFlags flags;

    const char *ptr = data.constData();

    m_backingCanvasHandle = reinterpret_cast<const CanvasHandle*>(ptr)[0];
    ptr += sizeof(CanvasHandle);

    width = reinterpret_cast<const int*>(ptr)[0];
    height = reinterpret_cast<const int*>(ptr)[1];
    ptr += 2 * sizeof(int);

    format = QImage::Format(*reinterpret_cast<const int*>(ptr));
    ptr += sizeof(int);

    flags = *reinterpret_cast<const SurfaceFlags*>(ptr);

    setSurfaceFlags(flags);

    //pixmap = QPixmap(pixmapData);
    //qDebug() << "pixmapWidth: " << pixmap.width();
    //qDebug() << "pixmapHeight: " << pixmap.height();
    //qDebug() << "pixmap null?: " << pixmap.isNull();
    m_isServerSide = true;
}
开发者ID:tsuibin,项目名称:emscripten-qt,代码行数:32,代码来源:qwindowsurface_qws.cpp


示例2: sizeof

void QWSLocalMemSurface::setPermanentState(const QByteArray &data)
{
    if (memsize) {
        delete[] mem;
        memsize = 0;
    }

    int width;
    int height;
    QImage::Format format;
    SurfaceFlags flags;

    const char *ptr = data.constData();

    mem = *reinterpret_cast<uchar* const*>(ptr);
    ptr += sizeof(uchar*);

    width = reinterpret_cast<const int*>(ptr)[0];
    height = reinterpret_cast<const int*>(ptr)[1];
    ptr += 2 * sizeof(int);

    format = QImage::Format(*reinterpret_cast<const int*>(ptr));
    ptr += sizeof(int);

    flags = *reinterpret_cast<const SurfaceFlags*>(ptr);

    const int bpl = nextMulOf4(bytesPerPixel(format) * width);
    QWSMemorySurface::img = QImage(mem, width, height, bpl, format);
    setSurfaceFlags(flags);
}
开发者ID:AlekSi,项目名称:phantomjs,代码行数:30,代码来源:qwindowsurface_qws.cpp


示例3: QWSWindowSurface

QDirectFBWindowSurface::QDirectFBWindowSurface(DFBSurfaceFlipFlags flip, QDirectFBScreen *scr, QWidget *widget)
    : QWSWindowSurface(widget), QDirectFBPaintDevice(scr)
#ifndef QT_NO_DIRECTFB_WM
    , dfbWindow(0)
#endif
    , flipFlags(flip)
    , boundingRectFlip(scr->directFBFlags() & QDirectFBScreen::BoundingRectFlip)
    , flushPending(false)
{
    SurfaceFlags flags = 0;
    if (!widget || widget->window()->windowOpacity() == 0xff)
        flags |= Opaque;
#ifdef QT_NO_DIRECTFB_WM
    if (widget && widget->testAttribute(Qt::WA_PaintOnScreen)) {
        flags = RegionReserved;
        mode = Primary;
    } else {
        mode = Offscreen;
        flags = Buffered;
    }
#endif
    setSurfaceFlags(flags);
#ifdef QT_DIRECTFB_TIMING
    frames = 0;
    timer.start();
#endif
}
开发者ID:Blizzard,项目名称:qt4,代码行数:27,代码来源:qdirectfbwindowsurface.cpp


示例4: QWSGLWindowSurface

EGLNullWSWindowSurface::EGLNullWSWindowSurface(QWidget *w)
    :
    QWSGLWindowSurface(w),
    widget(w)
{
    setSurfaceFlags(Flags);
}
开发者ID:AtlantisCD9,项目名称:Qt,代码行数:7,代码来源:eglnullwswindowsurface.cpp


示例5: QWSGLWindowSurface

PvrEglWindowSurface::PvrEglWindowSurface
        (QWidget *widget, PvrEglScreen *screen, int screenNum)
    : QWSGLWindowSurface(widget)
{
    setSurfaceFlags(QWSWindowSurface::Opaque);

    this->widget = widget;
    this->screen = screen;
    this->pdevice = 0;

    QPoint pos = offset(widget);
    QSize size = widget->size();

    PvrQwsRect pvrRect;
    pvrRect.x = pos.x();
    pvrRect.y = pos.y();
    pvrRect.width = size.width();
    pvrRect.height = size.height();
    transformRects(&pvrRect, 1);

    // Try to recover a previous PvrQwsDrawable object for the widget
    // if there is one.  This can happen when a PvrEglWindowSurface
    // is created for a widget, bound to a EGLSurface, and then destroyed.
    // When a new PvrEglWindowSurface is created for the widget, it will
    // pick up the previous PvrQwsDrawable if the EGLSurface has not been
    // destroyed in the meantime.
    drawable = pvrQwsFetchWindow((long)widget);
    if (drawable)
        pvrQwsSetGeometry(drawable, &pvrRect);
    else
        drawable = pvrQwsCreateWindow(screenNum, (long)widget, &pvrRect);
    pvrQwsSetRotation(drawable, screen->transformation());
}
开发者ID:Marforius,项目名称:qt,代码行数:33,代码来源:pvreglwindowsurface.cpp


示例6: SurfaceFlags

void QWSSharedMemSurface::setPermanentState(const QByteArray &data)
{
    int memId;
    int width;
    int height;
    int lockId;
    QImage::Format format;
    SurfaceFlags flags;

    const int *ptr = reinterpret_cast<const int*>(data.constData());

    memId = ptr[0];
    width = ptr[1];
    height = ptr[2];
    lockId = ptr[3];
    format = QImage::Format(ptr[4]);
    flags = SurfaceFlags(ptr[5]);

    setSurfaceFlags(flags);
    setMemory(memId);
    setLock(lockId);

#ifdef QT_QWS_CLIENTBLIT
    uchar *base = static_cast<uchar*>(mem.address()) + sizeof(uint);
#else
    uchar *base = static_cast<uchar*>(mem.address());
#endif
    const int bpl = nextMulOf4(bytesPerPixel(format) * width);
    QWSMemorySurface::img = QImage(base, width, height, bpl, format);
}
开发者ID:AlekSi,项目名称:phantomjs,代码行数:30,代码来源:qwindowsurface_qws.cpp


示例7: QWSWindowSurface

QWSHtml5CanvasSurface::QWSHtml5CanvasSurface()
    : QWSWindowSurface(), m_isServerSide(false), m_backingCanvasHandle(-1)
{
#ifdef QT_DEBUG_SURFACE
    qDebug() << "QWSHtml5CanvasSurface::QWSHtml5CanvasSurface()" << "(" << (void*)this << ")";
#endif
    setSurfaceFlags(Buffered);
}
开发者ID:tsuibin,项目名称:emscripten-qt,代码行数:8,代码来源:qwindowsurface_qws.cpp


示例8: QWSWindowSurface

QWSMemorySurface::QWSMemorySurface()
    : QWSWindowSurface()
#ifndef QT_NO_QWS_MULTIPROCESS
    , memlock(0)
#endif
{
    setSurfaceFlags(Buffered);
}
开发者ID:AlekSi,项目名称:phantomjs,代码行数:8,代码来源:qwindowsurface_qws.cpp


示例9: QWSGLWindowSurface

HybridSurface::HybridSurface(QWidget *w, EGLDisplay disp)
    :  QWSGLWindowSurface(w), memlock(0), display(disp), config(0),
       surface(EGL_NO_SURFACE), context(EGL_NO_CONTEXT),
       pdevice(new QWSGLPaintDevice(w))
{
    setSurfaceFlags(Buffered | Opaque);

    EGLint configAttribs[] = {
        EGL_RED_SIZE,        0,
        EGL_GREEN_SIZE,      0,
        EGL_BLUE_SIZE,       0,
        EGL_ALPHA_SIZE,      0,
        EGL_DEPTH_SIZE,      0,
        EGL_STENCIL_SIZE,   EGL_DONT_CARE,
        EGL_SURFACE_TYPE,   EGL_WINDOW_BIT,
        EGL_NONE,           EGL_NONE
    };


    EGLBoolean status;
    EGLint numConfigs;
    status = eglChooseConfig(display, configAttribs, 0, 0, &numConfigs);
    if (!status) {
        error("chooseConfig");
        return;
    }

    //If there isn't any configuration good enough
    if (numConfigs < 1) {
        error("chooseConfig, no matching configurations found");
        return;
    }

    QVarLengthArray<EGLConfig> configs(numConfigs);

    status = eglChooseConfig(display, configAttribs, configs.data(),
                             numConfigs, &numConfigs);
    if (!status) {
        error("chooseConfig");
        return;
    }

    // hw: if used on an image buffer we need to check whether the resulting
    // configuration matches our requirements exactly!
    config = configs[0];

    context = eglCreateContext(display, config, 0, 0);
                                      //(shareContext ? shareContext->d_func()->cx : 0),
                                      //configAttribs);
    if (context == EGL_NO_CONTEXT)
        error("eglCreateContext");

}
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:53,代码来源:hybridsurface.cpp


示例10: surfaceFlags

void QDirectFBWindowSurface::setOpaque(bool opaque)
{
    SurfaceFlags flags = surfaceFlags();
    if (opaque != (flags & Opaque)) {
        if (opaque) {
            flags |= Opaque;
        } else {
            flags &= ~Opaque;
        }
        setSurfaceFlags(flags);
    }
}
开发者ID:Blizzard,项目名称:qt4,代码行数:12,代码来源:qdirectfbwindowsurface.cpp


示例11: QWSGLWindowSurface

PvrEglWindowSurface::PvrEglWindowSurface(PvrEglSurfaceHolder *holder)
    : QWSGLWindowSurface()
{
    setSurfaceFlags(QWSWindowSurface::Opaque);
    drawable = 0;
    widget = 0;
    screen = 0;
    pdevice = 0;

    this->holder = holder;
    holder->addSurface();
}
开发者ID:Fale,项目名称:qtmoko,代码行数:12,代码来源:pvreglwindowsurface.cpp


示例12: sizeof

void HybridSurface::setPermanentState(const QByteArray &data)
{
    int memId;
    int width;
    int height;
    int lockId;
    QImage::Format format;
    SurfaceFlags flags;

    const char *ptr = data.constData();

    memId = reinterpret_cast<const int*>(ptr)[0];
    width = reinterpret_cast<const int*>(ptr)[1];
    height = reinterpret_cast<const int*>(ptr)[2];
    lockId = reinterpret_cast<const int*>(ptr)[3];
    ptr += 4 * sizeof(int);

    format = *reinterpret_cast<const QImage::Format*>(ptr);
    ptr += sizeof(QImage::Format);
    flags = *reinterpret_cast<const SurfaceFlags*>(ptr);

    setSurfaceFlags(flags);

//  setMemory(memId);
    if (mem.id() != memId) {
        mem.detach();
        if (!mem.attach(memId)) {
            perror("QWSSharedMemSurface: attaching to shared memory");
            qCritical("QWSSharedMemSurface: Error attaching to"
                      " shared memory 0x%x", memId);
        }
    }

//  setLock(lockId);
    if (!memlock || memlock->id() == lockId) {
        delete memlock;
        memlock = (lockId == -1 ? 0 : new QWSLock(lockId));
    }

    uchar *base = static_cast<uchar*>(mem.address());
    img = QImage(base, width, height, format);
}
开发者ID:muromec,项目名称:qtopia-ezx,代码行数:42,代码来源:hybridsurface.cpp


示例13: QDirectFBPaintDevice

QT_BEGIN_NAMESPACE

QDirectFBWindowSurface::QDirectFBWindowSurface(DFBSurfaceFlipFlags flip, QDirectFBScreen *scr)
    : QDirectFBPaintDevice(scr)
#ifndef QT_NO_DIRECTFB_WM
    , dfbWindow(0)
#endif
    , flipFlags(flip)
    , boundingRectFlip(scr->directFBFlags() & QDirectFBScreen::BoundingRectFlip)
    , flushPending(false)
{
#ifdef QT_NO_DIRECTFB_WM
    mode = Offscreen;
#endif
    setSurfaceFlags(Opaque | Buffered);
#ifdef QT_DIRECTFB_TIMING
    frames = 0;
    timer.start();
#endif
}
开发者ID:Blizzard,项目名称:qt4,代码行数:20,代码来源:qdirectfbwindowsurface.cpp


示例14: memcpy

void QDirectFBWindowSurface::setPermanentState(const QByteArray &state)
{
    const char *ptr = state.constData();
    IDirectFBDisplayLayer *layer = screen->dfbDisplayLayer();
    SurfaceFlags flags;
    memcpy(&flags, ptr, sizeof(SurfaceFlags));

    setSurfaceFlags(flags);
    ptr += sizeof(SurfaceFlags);
    DFBWindowID id;
    memcpy(&id, ptr, sizeof(DFBWindowID));
    if (dfbSurface)
        dfbSurface->Release(dfbSurface);
    if (id != (DFBWindowID)-1) {
        IDirectFBWindow *dw;
        layer->GetWindow(layer, id, &dw);
        if (dw->GetSurface(dw, &dfbSurface) != DFB_OK)
                dfbSurface = 0;
        dw->Release(dw);
    }
    else {
        dfbSurface = 0;
    }
}
开发者ID:Blizzard,项目名称:qt4,代码行数:24,代码来源:qdirectfbwindowsurface.cpp


示例15: QWSMemorySurface

QWSOnScreenSurface::QWSOnScreenSurface()
    : QWSMemorySurface()
{
    setSurfaceFlags(Opaque);
}
开发者ID:AlekSi,项目名称:phantomjs,代码行数:5,代码来源:qwindowsurface_qws.cpp


示例16: QWSWindowSurface

SvgalibSurface::SvgalibSurface() : QWSWindowSurface(), pdevice(0)
{
    setSurfaceFlags(Opaque);
}
开发者ID:bailsoftware,项目名称:qt-embedded,代码行数:4,代码来源:svgalibsurface.cpp


示例17: setReserved

void QWSDirectPainterSurface::setPermanentState(const QByteArray &ba)
{
    if (ba.size() > 0 && ba.at(0) == 'r')
        setReserved();
    setSurfaceFlags(surfaceFlags() | Opaque);
}
开发者ID:AlekSi,项目名称:phantomjs,代码行数:6,代码来源:qwindowsurface_qws.cpp


示例18: widget

EGLNullWSWindowSurface::EGLNullWSWindowSurface()
    : widget(0)
{
    setSurfaceFlags(Flags);
}
开发者ID:AtlantisCD9,项目名称:Qt,代码行数:5,代码来源:eglnullwswindowsurface.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ setSymbol函数代码示例发布时间:2022-05-30
下一篇:
C++ setSubtype函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap