当前位置: 首页>>代码示例>>C++>>正文


C++ ContextPtr类代码示例

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


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

示例1: detachEGLImage

void detachEGLImage(unsigned int imageId)
{
    ThreadInfo* thread  = getThreadInfo();
    ContextPtr  ctx     = thread->eglContext;
    if (ctx.Ptr()) {
        ctx->detachImage(imageId);
    }
}
开发者ID:Dorahe,项目名称:platform_external_qemu,代码行数:8,代码来源:EglImp.cpp

示例2: Context

ConstPathMatcherDataPtr ScenePlug::set( const IECore::InternedString &setName ) const
{
	ContextPtr tmpContext = new Context( *Context::current(), Context::Borrowed );
	tmpContext->set( setNameContextName, setName );
	removeNonGlobalContextVariables( tmpContext.get() );
	Context::Scope scopedContext( tmpContext.get() );
	return setPlug()->getValue();
}
开发者ID:hradec,项目名称:gaffer,代码行数:8,代码来源:ScenePlug.cpp

示例3: Context

IECore::MurmurHash ScenePlug::objectHash( const ScenePath &scenePath ) const
{
	ContextPtr tmpContext = new Context( *Context::current(), Context::Borrowed );
	tmpContext->set( scenePathContextName, scenePath );
	Context::Scope scopedContext( tmpContext.get() );
	return objectPlug()->hash();

}
开发者ID:dboogert,项目名称:gaffer,代码行数:8,代码来源:ScenePlug.cpp

示例4: Context

IECore::MurmurHash ImagePlug::channelDataHash( const std::string &channelName, const Imath::V2i &tile ) const
{
	ContextPtr tmpContext = new Context( *Context::current(), Context::Borrowed );
	tmpContext->set( ImagePlug::channelNameContextName, channelName );
	tmpContext->set( ImagePlug::tileOriginContextName, tile );
	Context::Scope scopedContext( tmpContext.get() );
	return channelDataPlug()->hash();
}
开发者ID:Eryckz,项目名称:gaffer,代码行数:8,代码来源:ImagePlug.cpp

示例5: eglGetCurrentContext

// Get the current rendering context.
EGLContext eglGetCurrentContext() {
  EGL_API_ENTRY("");
  ContextPtr context = GetContext();
  if (context == NULL) {
    return EGL_NO_CONTEXT;
  }
  return context->GetKey();
}
开发者ID:epowers,项目名称:arc,代码行数:9,代码来源:api_entries.cpp

示例6: generateJSServerImp

void CodeGenerator::generateJSServerImp(const ContextPtr &cPtr)
{
    string sFileName = TC_File::excludeFileExt(_sToPath + TC_File::extractFileName(cPtr->getFileName())) + "Imp.js";
    if (TC_File::isFileExist(sFileName))
    {
        return ;
    }

    ostringstream str;
    str << printHeaderRemark("Imp");
    str << "\"use strict\";" << endl << endl;

    vector<NamespacePtr> namespaces = cPtr->getNamespaces();
    set<string> setNamespace;
    for(size_t i = 0; i < namespaces.size(); i++)
    {
        if (setNamespace.count(namespaces[i]->getId()) != 0)
        {
            continue;
        }
        setNamespace.insert(namespaces[i]->getId());

        str << "var " << namespaces[i]->getId() << " = require(\"./" 
            << TC_File::excludeFileExt(TC_File::extractFileName(cPtr->getFileName())) << ".js\")." 
            << namespaces[i]->getId() << ";" << endl;

        str << "module.exports." << namespaces[i]->getId() << " = " << namespaces[i]->getId() << ";" << endl;
    }
    str << endl;

    set<string> setInterface;
    for(size_t i = 0; i < namespaces.size(); i++) 
    {
        vector<InterfacePtr> & is = namespaces[i]->getAllInterfacePtr();
        for (size_t ii = 0; ii < is.size(); ii++)
        {
            if (setInterface.count(namespaces[i]->getId() + "::" + is[ii]->getId()) != 0)
            {
                continue;
            }
            setInterface.insert(namespaces[i]->getId() + "::" + is[ii]->getId());

            str << namespaces[i]->getId() << "." << is[ii]->getId() << "Imp.prototype.initialize = function () {" << endl;
            INC_TAB;
            str << TAB << "//TODO::" << endl;
            DEL_TAB;
            str << "};" << endl << endl;
        }
    }

    for(size_t i = 0; i < namespaces.size(); i++)
	{
		str << generateJSServerImp(cPtr, namespaces[i]);
	}

    TC_File::makeDirRecursive(_sToPath, 0755);
    makeUTF8File(sFileName, str.str());
}
开发者ID:Blucezhang,项目名称:Tars,代码行数:58,代码来源:gen_server_imp.cpp

示例7: hashMaskedOutput

void ImageReader::hashMaskedOutput( const Gaffer::ValuePlug *output, const Gaffer::Context *context, IECore::MurmurHash &h, bool alwaysClampToFrame ) const
{
    ContextPtr maskedContext = NULL;
    if( !computeFrameMask( context, maskedContext ) || alwaysClampToFrame )
    {
        Context::Scope scope( maskedContext.get() );
        h = intermediateImagePlug()->getChild<ValuePlug>( output->getName() )->hash();
    }
}
开发者ID:mor-vfx,项目名称:gaffer,代码行数:9,代码来源:ImageReader.cpp

示例8: CreateCudaDeviceStream

ContextPtr CreateCudaDeviceStream(int argc, char** argv, bool printInfo) {
	int ordinal = 0;
	if(argc >= 2 && !sscanf(argv[1], "%d", &ordinal)) {
		fprintf(stderr, "INVALID COMMAND LINE ARGUMENT - NOT A CUDA ORDINAL\n");
		exit(0);
	}
	ContextPtr context = CreateCudaDeviceStream(ordinal);
	if(printInfo) printf("%s", context->DeviceString().c_str());
	return context;
}
开发者ID:BillOmg,项目名称:moderngpu,代码行数:10,代码来源:mgpucontext.cpp

示例9: Context

void ColorProcessor::hashColorData( const Gaffer::Context *context, IECore::MurmurHash &h ) const
{
	ContextPtr tmpContext = new Context( *context, Context::Borrowed );
	Context::Scope scopedContext( tmpContext.get() );
	tmpContext->set( ImagePlug::channelNameContextName, string( "R" ) );
	inPlug()->channelDataPlug()->hash( h );
	tmpContext->set( ImagePlug::channelNameContextName, string( "G" ) );
	inPlug()->channelDataPlug()->hash( h );
	tmpContext->set( ImagePlug::channelNameContextName, string( "B" ) );
	inPlug()->channelDataPlug()->hash( h );
}
开发者ID:dboogert,项目名称:gaffer,代码行数:11,代码来源:ColorProcessor.cpp

示例10: Context

void ExecutableNode::executeSequence( const std::vector<float> &frames ) const
{
	ContextPtr context = new Context( *Context::current(), Context::Borrowed );
	Context::Scope scopedContext( context.get() );

	for ( std::vector<float>::const_iterator it = frames.begin(); it != frames.end(); ++it )
	{
		context->setFrame( *it );
		execute();
	}
}
开发者ID:nicoduce,项目名称:gaffer,代码行数:11,代码来源:ExecutableNode.cpp

示例11: Calc

	bool AnyQuantifier::Calc( ContextPtr context )
	{
		for (ValueSet::Iterator it = mValues->Begin(); it != mValues->End(); ++it)
		{
			context->PushParam(mIdentifier, *it);
			bool result = mTerm->Calc(context);
			context->PopParam(mIdentifier);
			if (!result)
				return false;
		}
		return true;
	}
开发者ID:doveiya,项目名称:isilme,代码行数:12,代码来源:Quantifiers.cpp

示例12: eglCreateContext

EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay display, EGLConfig config,
                EGLContext share_context,
                const EGLint *attrib_list) {
    VALIDATE_DISPLAY_RETURN(display,EGL_NO_CONTEXT);
    VALIDATE_CONFIG_RETURN(config,EGL_NO_CONTEXT);

    GLESVersion version = GLES_1_1;
    if(!EglValidate::noAttribs(attrib_list)) {
        int i = 0;
        while(attrib_list[i] != EGL_NONE) {
            switch(attrib_list[i]) {
            case EGL_CONTEXT_CLIENT_VERSION:
                if(attrib_list[i+1] == 2) {
                    version = GLES_2_0;
                } else {
                    version = GLES_1_1;
                }
                break;
            default:
                RETURN_ERROR(EGL_NO_CONTEXT,EGL_BAD_ATTRIBUTE);
            }
            i+=2;
        }
    }
    const GLESiface* iface = g_eglInfo->getIface(version);
    GLEScontext* glesCtx = NULL;
    if(iface) {
        glesCtx = iface->createGLESContext();
    } else { // there is no interface for this gles version
                RETURN_ERROR(EGL_NO_CONTEXT,EGL_BAD_ATTRIBUTE);
    }

    ContextPtr sharedCtxPtr;
    if(share_context != EGL_NO_CONTEXT) {
        sharedCtxPtr = dpy->getContext(share_context);
        if(!sharedCtxPtr.Ptr()) {
            RETURN_ERROR(EGL_NO_CONTEXT,EGL_BAD_CONTEXT);
        }
    }

    EglOS::Context* globalSharedContext = dpy->getGlobalSharedContext();
    EglOS::Context* nativeContext = dpy->nativeType()->createContext(
            cfg->nativeFormat(), globalSharedContext);

    if(nativeContext) {
        ContextPtr ctx(new EglContext(dpy, nativeContext,sharedCtxPtr,cfg,glesCtx,version,dpy->getManager(version)));
        return dpy->addContext(ctx);
    } else {
        iface->deleteGLESContext(glesCtx);
    }

return EGL_NO_CONTEXT;
}
开发者ID:Dorahe,项目名称:platform_external_qemu,代码行数:53,代码来源:EglImp.cpp

示例13: computeMaskedOutput

void ImageReader::computeMaskedOutput( Gaffer::ValuePlug *output, const Gaffer::Context *context, bool alwaysClampToFrame ) const
{
    ContextPtr maskedContext = NULL;
    bool blackOutside = computeFrameMask( context, maskedContext );
    if( blackOutside && !alwaysClampToFrame )
    {
        output->setToDefault();
        return;
    }

    Context::Scope scope( maskedContext.get() );
    output->setFrom( intermediateImagePlug()->getChild<ValuePlug>( output->getName() ) );
}
开发者ID:mor-vfx,项目名称:gaffer,代码行数:13,代码来源:ImageReader.cpp

示例14: alphaChannelPlug

void Unpremultiply::hashChannelData( const GafferImage::ImagePlug *output, const Gaffer::Context *context, IECore::MurmurHash &h ) const
{
	std::string alphaChannel = alphaChannelPlug()->getValue();

	ChannelDataProcessor::hashChannelData( output, context, h );

	inPlug()->channelDataPlug()->hash( h );

	ContextPtr tmpContext = new Context( *context, Context::Borrowed );
	tmpContext->set( ImagePlug::channelNameContextName, alphaChannel );
	Context::Scope scopedContext( tmpContext.get() );

	inPlug()->channelDataPlug()->hash( h );
}
开发者ID:nicoduce,项目名称:gaffer,代码行数:14,代码来源:Unpremultiply.cpp

示例15: getThreadInfo

/************************** KHR IMAGE *************************************************************/
EglImage *attachEGLImage(unsigned int imageId)
{
    ThreadInfo* thread  = getThreadInfo();
    EglDisplay* dpy     = static_cast<EglDisplay*>(thread->eglDisplay);
    ContextPtr  ctx     = thread->eglContext;
    if (ctx.Ptr()) {
        ImagePtr img = dpy->getImage(reinterpret_cast<EGLImageKHR>(imageId));
        if(img.Ptr()) {
             ctx->attachImage(imageId,img);
             return img.Ptr();
        }
    }
    return NULL;
}
开发者ID:Dorahe,项目名称:platform_external_qemu,代码行数:15,代码来源:EglImp.cpp


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