Thanks to latest changes, BDirectWindow now draws something. Though, looks like either the clipping region is wrong, or the app_server overwrites what the BDirectWindow app writes.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14610 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stefano Ceccherini 2005-11-01 09:53:47 +00:00
parent 9a80b5fa01
commit 0c378a5714
2 changed files with 9 additions and 9 deletions

View File

@ -272,11 +272,8 @@ ServerWindow::Show()
rootLayer->Unlock();
}
// TODO: This doesn't work: Here we aren't shown yet as RootLayer::ShowWinBorder()
// does its work asynchronously. As we lock the rootlayer, I think it could be synchronous.
// Otherwise, we need a "Shown()" hook or something like that.
if (fDirectWindowData != NULL)
_HandleDirectConnection(B_DIRECT_START);
_HandleDirectConnection(B_DIRECT_START|B_BUFFER_RESET);
}
@ -2410,14 +2407,18 @@ ServerWindow::_EnableDirectWindowMode()
void
ServerWindow::_HandleDirectConnection(direct_buffer_state state)
ServerWindow::_HandleDirectConnection(int bufferState, int driverState)
{
if (fDirectWindowData == NULL)
return;
fDirectWindowData->direct_info->buffer_state = state;
if (bufferState != -1)
fDirectWindowData->direct_info->buffer_state = (direct_buffer_state)bufferState;
if ((state & B_DIRECT_MODE_MASK) != B_DIRECT_STOP) {
if (driverState != -1)
fDirectWindowData->direct_info->driver_state = (direct_driver_state)driverState;
if ((bufferState & B_DIRECT_MODE_MASK) != B_DIRECT_STOP) {
// TODO: Locking ?
RenderingBuffer *buffer = fDesktop->GetHWInterface()->FrontBuffer();
fDirectWindowData->direct_info->bits = buffer->Bits();

View File

@ -13,7 +13,6 @@
#define _SERVERWIN_H_
#include <DirectWindow.h> // for direct_buffer_state
#include <GraphicsDefs.h>
#include <PortLink.h>
#include <Locker.h>
@ -119,7 +118,7 @@ private:
virtual void _GetLooperName(char* name, size_t size);
status_t _EnableDirectWindowMode();
void _HandleDirectConnection(direct_buffer_state state);
void _HandleDirectConnection(int bufferState = -1, int driverState = -1);
// TODO: Move me elsewhere
status_t PictureToRegion(ServerPicture *picture,