ServerWindow needs only to call DirectWindowData::SetState() now, since it does all the work to sync with the client itself. Made DirectWindowData::SynchronizeWithClient() private and renamed it accordingly
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32644 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -76,7 +76,7 @@ DirectWindowData::GetSyncData(direct_window_sync_data& data) const
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
DirectWindowData::SyncronizeWithClient()
|
DirectWindowData::_SyncronizeWithClient()
|
||||||
{
|
{
|
||||||
// Releasing this semaphore causes the client to call
|
// Releasing this semaphore causes the client to call
|
||||||
// BDirectWindow::DirectConnected()
|
// BDirectWindow::DirectConnected()
|
||||||
@@ -94,7 +94,7 @@ DirectWindowData::SyncronizeWithClient()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool
|
status_t
|
||||||
DirectWindowData::SetState(const direct_buffer_state& bufferState,
|
DirectWindowData::SetState(const direct_buffer_state& bufferState,
|
||||||
const direct_driver_state& driverState, RenderingBuffer *buffer,
|
const direct_driver_state& driverState, RenderingBuffer *buffer,
|
||||||
const BRect& windowFrame, const BRegion& clipRegion)
|
const BRect& windowFrame, const BRegion& clipRegion)
|
||||||
@@ -108,8 +108,10 @@ DirectWindowData::SetState(const direct_buffer_state& bufferState,
|
|||||||
|
|
||||||
bool isStopped = fTransition <= 0;
|
bool isStopped = fTransition <= 0;
|
||||||
|
|
||||||
if (wasStopped && isStopped)
|
if (wasStopped && isStopped) {
|
||||||
return false;
|
// Nothing to change
|
||||||
|
return B_OK;
|
||||||
|
}
|
||||||
|
|
||||||
buffer_info->buffer_state = bufferState;
|
buffer_info->buffer_state = bufferState;
|
||||||
|
|
||||||
@@ -167,5 +169,5 @@ DirectWindowData::SetState(const direct_buffer_state& bufferState,
|
|||||||
buffer_info->clip_list[i] = clipRegion.RectAtInt(i);
|
buffer_info->clip_list[i] = clipRegion.RectAtInt(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return _SyncronizeWithClient();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ public:
|
|||||||
direct_window_sync_data& data) const;
|
direct_window_sync_data& data) const;
|
||||||
status_t SyncronizeWithClient();
|
status_t SyncronizeWithClient();
|
||||||
|
|
||||||
bool SetState(const direct_buffer_state& bufferState,
|
status_t SetState(const direct_buffer_state& bufferState,
|
||||||
const direct_driver_state& driverState,
|
const direct_driver_state& driverState,
|
||||||
RenderingBuffer *renderingBuffer,
|
RenderingBuffer *renderingBuffer,
|
||||||
const BRect& windowFrame,
|
const BRect& windowFrame,
|
||||||
@@ -54,8 +54,7 @@ public:
|
|||||||
bool full_screen;
|
bool full_screen;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool _HandleStop(const direct_buffer_state& state);
|
status_t _SyncronizeWithClient();
|
||||||
bool _HandleStart(const direct_buffer_state& state);
|
|
||||||
|
|
||||||
sem_id fSem;
|
sem_id fSem;
|
||||||
sem_id fAcknowledgeSem;
|
sem_id fAcknowledgeSem;
|
||||||
|
|||||||
@@ -3484,16 +3484,12 @@ ServerWindow::HandleDirectConnection(int32 bufferState, int32 driverState)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
if (fDesktop->LockSingleWindow()) {
|
if (fDesktop->LockSingleWindow()) {
|
||||||
if (!fDirectWindowData->SetState((direct_buffer_state)bufferState,
|
status_t status = fDirectWindowData->SetState(
|
||||||
(direct_driver_state)driverState,
|
(direct_buffer_state)bufferState,
|
||||||
fDesktop->HWInterface()->FrontBuffer(), fWindow->Frame(),
|
(direct_driver_state)driverState,
|
||||||
fWindow->VisibleContentRegion())) {
|
fDesktop->HWInterface()->FrontBuffer(), fWindow->Frame(),
|
||||||
fDesktop->UnlockSingleWindow();
|
fWindow->VisibleContentRegion());
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
status_t status = fDirectWindowData->SyncronizeWithClient();
|
|
||||||
|
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
char errorString[256];
|
char errorString[256];
|
||||||
snprintf(errorString, sizeof(errorString),
|
snprintf(errorString, sizeof(errorString),
|
||||||
|
|||||||
Reference in New Issue
Block a user