static void draw_picture(void* _context, const BPoint& where, int32 token) { DrawingContext* context = reinterpret_cast<DrawingContext *>(_context); ServerPicture* picture = context->GetPicture(token); if (picture != NULL) { context->PushState(); context->SetDrawingOrigin(where); context->PushState(); picture->Play(context); context->PopState(); context->PopState(); picture->ReleaseReference(); } }
static void clip_to_picture(void* _context, int32 pictureToken, const BPoint& where, bool clipToInverse) { DrawingContext* context = reinterpret_cast<DrawingContext *>(_context); ServerPicture* picture = context->GetPicture(pictureToken); if (picture == NULL) return; AlphaMask* mask = new(std::nothrow) AlphaMask( picture, clipToInverse, where, *context->CurrentState()); context->SetAlphaMask(mask); context->UpdateCurrentDrawingRegion(); if (mask != NULL) mask->ReleaseReference(); picture->ReleaseReference(); }