Skip to content
Snippets Groups Projects
Commit 7185075c authored by Steve Kondik's avatar Steve Kondik
Browse files

More changes for latest TigerVNC

parent f19d1422
No related branches found
No related tags found
No related merge requests found
......@@ -12,7 +12,6 @@
#include <rfb/PixelFormat.h>
#include <rfb/Rect.h>
#include <rfb/ScreenSet.h>
#include <rfb/VNCServerST.h>
#include "AndroidDesktop.h"
#include "AndroidPixelBuffer.h"
......@@ -41,7 +40,7 @@ AndroidDesktop::~AndroidDesktop() {
void AndroidDesktop::start(rfb::VNCServer* vs) {
mMainDpy = SurfaceComposerClient::getBuiltInDisplay(ISurfaceComposer::eDisplayIdMain);
mServer = (rfb::VNCServerST*)vs;
mServer = vs;
mPixels = new AndroidPixelBuffer();
mPixels->setDimensionsChangedListener(this);
......@@ -137,10 +136,6 @@ void AndroidDesktop::onFrameAvailable(const BufferItem& item) {
notify();
}
rfb::Point AndroidDesktop::getFbSize() {
return rfb::Point(mPixels->width(), mPixels->height());
}
void AndroidDesktop::keyEvent(rdr::U32 keysym, __unused_attr rdr::U32 keycode, bool down) {
mInputDevice->keyEvent(down, keysym);
}
......@@ -173,6 +168,13 @@ status_t AndroidDesktop::updateDisplayInfo() {
return NO_ERROR;
}
rfb::ScreenSet AndroidDesktop::computeScreenLayout() {
rfb::ScreenSet screens;
screens.add_screen(rfb::Screen(0, 0, 0, mPixels->width(), mPixels->height(), 0));
return screens;
mServer->setScreenLayout(screens);
}
void AndroidDesktop::onBufferDimensionsChanged(uint32_t width, uint32_t height) {
ALOGV("Dimensions changed: old=(%ux%u) new=(%ux%u)", mDisplayRect.getWidth(),
mDisplayRect.getHeight(), width, height);
......@@ -184,11 +186,8 @@ void AndroidDesktop::onBufferDimensionsChanged(uint32_t width, uint32_t height)
mInputDevice->reconfigure(mDisplayRect.getWidth(), mDisplayRect.getHeight());
mServer->setPixelBuffer(mPixels.get());
rfb::ScreenSet screens;
screens.add_screen(rfb::Screen(0, 0, 0, mPixels->width(), mPixels->height(), 0));
mServer->setScreenLayout(screens);
mServer->setPixelBuffer(mPixels.get(), computeScreenLayout());
mServer->setScreenLayout(computeScreenLayout());
}
void AndroidDesktop::queryConnection(network::Socket* sock, __unused_attr const char* userName) {
......
......@@ -14,7 +14,7 @@
#include <rfb/PixelBuffer.h>
#include <rfb/SDesktop.h>
#include <rfb/VNCServerST.h>
#include <rfb/ScreenSet.h>
#include "AndroidPixelBuffer.h"
#include "InputDevice.h"
......@@ -36,7 +36,6 @@ class AndroidDesktop : public rfb::SDesktop,
virtual void stop();
virtual void terminate();
virtual rfb::Point getFbSize();
virtual unsigned int setScreenLayout(int fb_width, int fb_height, const rfb::ScreenSet& layout);
virtual void keyEvent(rdr::U32 keysym, rdr::U32 keycode, bool down);
......@@ -59,6 +58,8 @@ class AndroidDesktop : public rfb::SDesktop,
virtual status_t updateDisplayInfo();
virtual rfb::ScreenSet computeScreenLayout();
Rect mDisplayRect;
Mutex mLock;
......@@ -68,7 +69,7 @@ class AndroidDesktop : public rfb::SDesktop,
int mEventFd;
// Server instance
rfb::VNCServerST* mServer;
rfb::VNCServer* mServer;
// Pixel buffer
sp<AndroidPixelBuffer> mPixels;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment