server_presenter.h revision 07c4af24c9b4431ab9a934079b348adbc66d6ff9
/* $Id$ */
/** @file
* Presenter API definitions.
*/
/*
* Copyright (C) 2014 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#ifndef __SERVER_PRESENTER_H__
#define __SERVER_PRESENTER_H__
#include "cr_spu.h"
#include "chromium.h"
#include "cr_error.h"
#include "cr_net.h"
#include "cr_rand.h"
#include "server_dispatch.h"
#include "server.h"
#include "cr_mem.h"
#include "cr_string.h"
#include <cr_vreg.h>
#include <cr_htable.h>
#include <cr_bmpscale.h>
#include "render/renderspu.h"
{
virtual int EntryReplaced(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hNewEntry, HCR_FRAMEBUFFER_ENTRY hReplacedEntry) = 0;
virtual ~ICrFbDisplay() {}
};
typedef struct CR_FRAMEBUFFER
{
struct VBVAINFOSCREEN ScreenInfo;
void *pvVram;
typedef union CR_FBENTRY_FLAGS
{
struct {
};
typedef struct CR_FRAMEBUFFER_ENTRY
{
typedef struct CR_FBTEX
{
} CR_FBTEX;
{
virtual bool isComposite();
bool isInList();
bool isUpdating();
int setRegionsChanged();
struct CR_FRAMEBUFFER* getFramebuffer();
virtual int EntryReplaced(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hNewEntry, HCR_FRAMEBUFFER_ENTRY hReplacedEntry);
/*@todo: move to protected and switch from RTLISTNODE*/
virtual void onUpdateEnd();
static DECLCALLBACK(bool) entriesCreateCb(HCR_FRAMEBUFFER hFb, HCR_FRAMEBUFFER_ENTRY hEntry, void *pvContext);
static DECLCALLBACK(bool) entriesDestroyCb(HCR_FRAMEBUFFER hFb, HCR_FRAMEBUFFER_ENTRY hEntry, void *pvContext);
int fbSynchAddAllEntries();
int fbCleanupRemoveAllEntries();
static DECLCALLBACK(void) slotEntryReleaseCB(HCR_FRAMEBUFFER hFb, HCR_FRAMEBUFFER_ENTRY hEntry, void *pvContext);
virtual void slotRelease();
typedef union CR_FBDISPBASE_FLAGS
{
struct {
};
struct CR_FRAMEBUFFER *mpFb;
};
{
virtual bool isComposite();
CrFbDisplayBase* first();
virtual int EntryReplaced(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hNewEntry, HCR_FRAMEBUFFER_ENTRY hReplacedEntry);
void cleanup(bool fCleanupDisplays = true);
};
{
bool IsCreated() const;
bool IsVisivle() const;
void Destroy();
int SetVisible(bool fVisible);
int SetVisibleRegionsChanged();
int UpdateBegin();
void UpdateEnd();
~CrFbWindow();
int Create();
void checkRegions();
bool isPresentNeeded();
bool checkInitedUpdating();
typedef union CR_FBWIN_FLAGS
{
struct {
};
const struct VBOXVR_SCR_COMPOSITOR * mpCompositor;
};
{
virtual int EntryReplaced(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hNewEntry, HCR_FRAMEBUFFER_ENTRY hReplacedEntry);
const RTRECT* getViewportRect();
int winVisibilityChanged();
CrFbWindow* getWindow();
virtual void onUpdateEnd();
virtual int screenChanged();
virtual int windowCleanup();
bool isActive();
int windowDimensionsSync(bool fForceCleanup = false);
virtual int windowSync();
typedef union CR_FBDISPWINDOW_FLAGS
{
struct {
};
};
{
virtual int EntryReplaced(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hNewEntry, HCR_FRAMEBUFFER_ENTRY hReplacedEntry);
int compositorMarkUpdated();
virtual int screenChanged();
int synchCompositorRegions();
virtual int synchCompositor();
virtual int clearCompositor();
void rootVrTranslateForPos();
static DECLCALLBACK(VBOXVR_SCR_COMPOSITOR_ENTRY*) rootVrGetCEntry(const VBOXVR_SCR_COMPOSITOR_ENTRY*pEntry, void *pvContext);
};
{
virtual int EntryReplaced(struct CR_FRAMEBUFFER *pFb, HCR_FRAMEBUFFER_ENTRY hNewEntry, HCR_FRAMEBUFFER_ENTRY hReplacedEntry);
void syncPos();
};
typedef struct CR_FB_INFO
{
} CR_FB_INFO;
typedef struct CR_FBDISPLAY_INFO
{
typedef struct CR_PRESENTER_GLOBALS
{
#ifndef VBOXVDBG_MEMCACHE_DISABLE
#endif
bool fEnabled;
bool fWindowsForceHidden;
void *pvTmpBuf;
void *pvTmpBuf2;
extern CR_PRESENTER_GLOBALS g_CrPresenter;
HCR_FRAMEBUFFER_ENTRY CrFbEntryFromCompositorEntry(const struct VBOXVR_SCR_COMPOSITOR_ENTRY* pCEntry);
#endif /* __SERVER_PRESENTER_H__ */