Exemplo n.º 1
0
void OffscreenCanvas::initPlayback()
{
    m_bUseMipmaps = getMipmap();
    m_pFBO = FBOPtr(new FBO(getSize(), B8G8R8A8, 1, getMultiSampleSamples(), true,
            m_bUseMipmaps));
    Canvas::initPlayback(getMultiSampleSamples());
    m_bIsRendered = false;
}
Exemplo n.º 2
0
ImageNode::ImageNode(const ArgList& args)
    : m_Compression(TEXCOMPRESSION_NONE)
{
    args.setMembers(this);
    m_pGPUImage = GPUImagePtr(new GPUImage(getSurface(), getMipmap()));
    m_Compression = string2TexCompression(args.getArgVal<string>("compression"));
    setHRef(m_href);
    ObjectCounter::get()->incRef(&typeid(*this));
}
Exemplo n.º 3
0
void ImageNode::disconnect(bool bKill)
{
    OffscreenCanvasPtr pCanvas = m_pGPUImage->getCanvas();
    if (pCanvas) {
        pCanvas->removeDependentCanvas(getCanvas());
    }
    if (bKill) {
        RasterNode::disconnect(bKill);
        m_pGPUImage = GPUImagePtr(new GPUImage(getSurface(), getMipmap()));
        m_href = "";
    } else {
        m_pGPUImage->moveToCPU();
        RasterNode::disconnect(bKill);
    }
}
Exemplo n.º 4
0
void RasterNode::setupFX()
{
    if (m_pSurface && m_pSurface->getSize() != IntPoint(-1,-1) && m_pFXNode) {
        m_pFXNode->setSize(m_pSurface->getSize());
        m_pFXNode->connect();
        m_bFXDirty = true;
        if (!m_pFBO || m_pFBO->getSize() != m_pSurface->getSize()) {
            PixelFormat pf = BitmapLoader::get()->getDefaultPixelFormat(true);
#ifdef AVG_ENABLE_EGL
            unsigned wrapMode = GL_CLAMP_TO_EDGE;
#else
            unsigned wrapMode = GL_CLAMP_TO_BORDER;
#endif
            GLContextManager* pCM = GLContextManager::get();
            m_pFBO = pCM->createFBO(IntPoint(m_pSurface->getSize()), pf, 1, 1, false, 
                    false, getMipmap(), wrapMode, wrapMode);
            m_pImagingProjection = ImagingProjectionPtr(new ImagingProjection(
                    m_pSurface->getSize()));
        }
    }
}