/*! read server cababilities
 */
void SortLastWindow::clientInit( void )
{
    getNetwork()->getAspect()->addFieldFilter(Node::getClassType().getId(),
                                              Node::VolumeFieldMask);
    getNetwork()->getAspect()->addFieldFilter(Node::getClassType().getId(),
                                              Node::TravMaskFieldMask);

    // create default composer
    if(getComposer() == NULL)
    {
/*
        FieldContainerPtr fcPtr = 
            FieldContainerFactory::the()->createFieldContainer("BinarySwapComposer");
        setComposer(ImageComposerPtr::dcast(fcPtr));
*/
    }
    if(getComposer() != NULL)
    {
        SortLastWindow *clusterWindow(this);
        getComposer()->setup(true,
                             getMFServers()->size32(),
                             getClientWindow(),
                             clusterWindow);
        getComposer()->open();
        // build node groups
        buildGroups();
    }
}
/*! init composition
 */
void SortLastWindow::serverInit(Window *serverWindow,
                                UInt32  id)
{
    // create default composer
    if(getComposer() == NULL)
    {
/*
        FieldContainerPtr fcPtr = 
            FieldContainerFactory::the()->createFieldContainer("BinarySwapComposer");
        setComposer(ImageComposerPtr::dcast(fcPtr));
*/
    }

    if(getComposer() != NULL)
    {
        // init composer
        ClusterWindow *clusterWindow = this;

        getComposer()->setup(false,
                             id,
                             serverWindow,
                             clusterWindow);

        getComposer()->open();
    }
}
void* eglGetComposerANDROID(EGLDisplay dpy, EGLSurface draw)
{
	struct context *current_context = brcm_egl_get_current();
	if (current_context)
		return getComposer(current_context->composer);
	else
		return NULL;
}
/*! swap
 */
void SortLastWindow::clientSwap( void )
{
    if(getComposer() == NULL)
    {
        Connection *connection=getNetwork()->getMainConnection();
        // wait for all servers to finish
        connection->wait();
        // initiate swap
        connection->signal();
    }
    Inherited::clientSwap();
}
Beispiel #5
0
 void PointsToAnalysis::genInitLattice(PartPtr part, PartEdgePtr pedge,
                                       std::vector<Lattice*>& initLattices)
 {
   AbstractObjectMap* productlattice = new AbstractObjectMap(boost::make_shared<AbstractObjectSet>(pedge, 
                                                                                                   getComposer(), 
                                                                                                   this, 
                                                                                                   AbstractObjectSet::may),
                                                             pedge,
                                                             getComposer(),
                                                             this);
   initLattices.push_back(productlattice);                                                                                                  
 }
/*! swap
 */
void SortLastWindow::serverSwap(Window *window,
                                UInt32  id    )
{
    if(getComposer() == NULL)
    {
        Connection *connection = getNetwork()->getMainConnection();
        // tell client that we are finish
        connection->signal();
        // wait for swap
        connection->wait();
    }
    Inherited::serverSwap(window,id);
}
status_t SurfaceComposerClient::unfreeze(SurfaceID id) {
    return getComposer().setFlags(this, id,
            0,
            ISurfaceComposer::eLayerFrozen);
}
status_t SurfaceComposerClient::show(SurfaceID id, int32_t) {
    return getComposer().setFlags(this, id,
            0,
            ISurfaceComposer::eLayerHidden);
}
status_t SurfaceComposerClient::hide(SurfaceID id) {
    return getComposer().setFlags(this, id,
            ISurfaceComposer::eLayerHidden,
            ISurfaceComposer::eLayerHidden);
}
status_t SurfaceComposerClient::setFreezeTint(SurfaceID id, uint32_t tint) {
    return getComposer().setFreezeTint(this, id, tint);
}
status_t SurfaceComposerClient::setSize(const sp<IBinder>& id, uint32_t w, uint32_t h) {
    return getComposer().setSize(this, id, w, h);
}
status_t SurfaceComposerClient::show(SurfaceID id) {
    return getComposer().setFlags(this, id,
            0,
            layer_state_t::eLayerHidden);
}
status_t SurfaceComposerClient::setSize(SurfaceID id, uint32_t w, uint32_t h) {
    return getComposer().setSize(this, id, w, h);
}
status_t SurfaceComposerClient::setMatrix(const sp<IBinder>& id, float dsdx, float dtdx,
        float dsdy, float dtdy) {
    return getComposer().setMatrix(this, id, dsdx, dtdx, dsdy, dtdy);
}
status_t SurfaceComposerClient::setLayerStack(const sp<IBinder>& id, uint32_t layerStack) {
    return getComposer().setLayerStack(this, id, layerStack);
}
status_t SurfaceComposerClient::setAlpha(const sp<IBinder>& id, float alpha) {
    return getComposer().setAlpha(this, id, alpha);
}
status_t SurfaceComposerClient::setFlags(const sp<IBinder>& id, uint32_t flags,
        uint32_t mask) {
    return getComposer().setFlags(this, id, flags, mask);
}
status_t SurfaceComposerClient::show(const sp<IBinder>& id) {
    return getComposer().setFlags(this, id,
            0,
            layer_state_t::eLayerHidden);
}
status_t SurfaceComposerClient::setLayer(const sp<IBinder>& id, int32_t z) {
    return getComposer().setLayer(this, id, z);
}
status_t SurfaceComposerClient::setCrop(SurfaceID id, const Rect& crop) {
    return getComposer().setCrop(this, id, crop);
}
status_t SurfaceComposerClient::setPosition(SurfaceID id, float x, float y) {
    return getComposer().setPosition(this, id, x, y);
}
status_t SurfaceComposerClient::setTransparentRegionHint(SurfaceID id,
        const Region& transparentRegion) {
    return getComposer().setTransparentRegionHint(this, id, transparentRegion);
}
status_t SurfaceComposerClient::setLayer(SurfaceID id, int32_t z) {
    return getComposer().setLayer(this, id, z);
}
status_t SurfaceComposerClient::setLayerStack(SurfaceID id, uint32_t layerStack) {
    return getComposer().setLayerStack(this, id, layerStack);
}
status_t SurfaceComposerClient::setFlags(SurfaceID id, uint32_t flags,
        uint32_t mask) {
    return getComposer().setFlags(this, id, flags, mask);
}
status_t SurfaceComposerClient::setPosition(const sp<IBinder>& id, float x, float y) {
    return getComposer().setPosition(this, id, x, y);
}
status_t SurfaceComposerClient::setAlpha(SurfaceID id, float alpha) {
    return getComposer().setAlpha(this, id, alpha);
}
Beispiel #28
0
 boost::shared_ptr<DFTransferVisitor>
 PointsToAnalysis::getTransferVisitor(PartPtr _part, CFGNode cn, NodeState& state, 
                                      std::map<PartEdgePtr, std::vector<Lattice*> >& dfInfo)                                     
 {
   PointsToAnalysisTransfer* idftv = new PointsToAnalysisTransfer(_part, cn, state, dfInfo, getComposer(), this, ptaDebugLevel);
   return boost::shared_ptr<DFTransferVisitor>(idftv);
 }
status_t SurfaceComposerClient::setMatrix(SurfaceID id, float dsdx, float dtdx,
        float dsdy, float dtdy) {
    return getComposer().setMatrix(this, id, dsdx, dtdx, dsdy, dtdy);
}
Beispiel #30
0
  MemLocObjectPtr PointsToAnalysis::Expr2MemLoc(SgNode* sgn, PartEdgePtr pedge)
  {
    scope reg(txt()<<"PointsToAnalysis::Expr2MemLoc(sgn=" << SgNode2Str(sgn) << ")", scope::medium, ptaDebugLevel, 1);
    if(ptaDebugLevel>=1) dbg << "pedge=" << pedge->str() << endl;

    // NOTE: source and target of edge are not wildcard
    if(pedge->source() && pedge->target())
    {
      NodeState* state = NodeState::getNodeState(this, pedge->source());
      if(ptaDebugLevel>=1) dbg << "state="<<state->str(this)<<endl;
      AbstractObjectMap* aom = dynamic_cast<AbstractObjectMap*>(state->getLatticeBelow(this, pedge, 0));
      assert(aom);
      boost::shared_ptr<AbstractObjectSet> aos = getPointsToSet(sgn, pedge, aom);
      return boost::dynamic_pointer_cast<MemLocObject>(Expr2PointsToMLPtr(sgn, pedge, aos));
    }    
    // NOTE: merge information across all outgoing edges
    // target of this edge is wildcard
    else if(pedge->source()) 
    { 
      NodeState* state = NodeState::getNodeState(this, pedge->source());
      //dbg << "state="<<state->str(this)<<endl;
    
      // Merge the lattices along all the outgoing edges
      map<PartEdgePtr, std::vector<Lattice*> >& e2lats = state->getLatticeBelowAllMod(this);
      assert(e2lats.size()>=1);
      boost::shared_ptr<AbstractObjectSet> mergedSet = boost::make_shared<AbstractObjectSet>(pedge, getComposer(), this, AbstractObjectSet::may);
      for(map<PartEdgePtr, std::vector<Lattice*> >::iterator lats=e2lats.begin(); lats!=e2lats.end(); lats++) 
      {
        PartEdge* edgePtr = lats->first.get();
        assert(edgePtr->source() == pedge.get()->source());
      
        AbstractObjectMap* aom = dynamic_cast<AbstractObjectMap*>(state->getLatticeBelow(this, lats->first, 0));
        assert(aom);
        if(ptaDebugLevel>=1) dbg << "aom="<<aom->str()<<endl;
        boost::shared_ptr<AbstractObjectSet> aos = getPointsToSet(sgn, pedge, aom);
        // NOTE: It can be empty if no entry was found in AbstractObjectMap
        // Safe approximation : merge only if it contains pointsTo information along this particular edge
        // 
        if(aos.get())
          mergedSet->meetUpdate(aos.get());
      }
      return boost::dynamic_pointer_cast<MemLocObject>(Expr2PointsToMLPtr(sgn, pedge, mergedSet));
    }
    // source of this edge is a wildcard
    else if(pedge->target()) 
    {
      NodeState* state = NodeState::getNodeState(this, pedge->target());
      if(ptaDebugLevel>=1) dbg << "state="<<state->str()<<endl;
      AbstractObjectMap* aom = dynamic_cast<AbstractObjectMap*>(state->getLatticeAbove(this, NULLPartEdge, 0));
      assert(aom);
      boost::shared_ptr<AbstractObjectSet> aos = getPointsToSet(sgn, pedge, aom);
      return boost::dynamic_pointer_cast<MemLocObject>(Expr2PointsToMLPtr(sgn, pedge, aos));
    }
    else { assert(false); return PointsToMLPtr(); }
  }