IPDL/Proposal:Shmem access control: Difference between revisions

Jump to navigation Jump to search
Line 36: Line 36:


== drawWindow Example ==
== drawWindow Example ==
Protocol


  sync protocol PDrawWindow {
  sync protocol PDrawWindow {
  child:
  child:
     InitBuffers(-w  +r  Shmem front,
     Init(-w  +r  Shmem front,
                -r-w +r+w Shmem back);
          -r-w +r+w Shmem back);
   
   
  parent:
  parent:
     sync Draw(-r  +r  Shmem curFront,
     sync Drew(-r  +r  Shmem curFront,
               -r-w +r+w Shmem curBack,
               -r-w +r+w Shmem curBack,
               DirtyRects[] dirty,
               DirtyRects[] dirty,
               ...)
               ...)
       returns (-r-w +r+w Shmem newBack,
       returns (-r-w +r+w Shmem newBack,
                 -w  +r  Shmem newFront);
                 -w  +r  Shmem newFront,
                ...);
  };
  };


Line 55: Line 58:
   chrome                                        content
   chrome                                        content
  -----------------------------------------      ---------------------------
  -----------------------------------------      ---------------------------
   front = AllocShmem()                           [recv ShmemCreated()]
  // --- Init sequence ---
     // front: rw rights                             // front: no rights
   front = AllocShmem()                           [recv ShmemCreated()]
     // front: rw rights                           // front: no rights
   back = AllocShmem()                            [recv ShmemCreated()]
   back = AllocShmem()                            [recv ShmemCreated()]
     // back: rw rights                               // back: no rights
     // back: rw rights                             // back: no rights
   
   
   // draw default background into |front|
   // draw default background into |front|
   
   
   SendInit(front, back)                          [recv Init()]
   SendInit(front, back)                          recv Init(front, back)
     // front: r rights                              // front: r
     // front: r, w reserved                        // front: r
     // back: no rights                              // back: rw
     // back: no rights                              // back: rw
  // --- Steady state ----
                                                  // draw stuff
                                                  SentDrew(front, back,
                                                            &back, &front,
                                                            dirtyRects)
                                                    // front: no rights
                                                    // back: no rights
  recv SendDrew(front, back, ...)
    // front: r, w reserved
    // back: rw
  swap(front, back)
  reply Drew(back, front)
    // front: r, w reserved
    // back: no rights
                                                  recv ReplyDrew(back, front)
  // render |front| to screen                        // back: rw
                                                    // front: r
                                                  // blit |front| changes into |back| using dirtyRects
                                                  // draw stuff, repeat
Confirmed users
699

edits

Navigation menu