projects
/
veency.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
57ad730
)
Port to 2.0.
author
Jay Freeman (saurik)
<saurik@saurik.com>
Thu, 21 Aug 2008 06:16:10 +0000
(06:16 +0000)
committer
Jay Freeman (saurik)
<saurik@saurik.com>
Thu, 21 Aug 2008 06:16:10 +0000
(06:16 +0000)
iphonevnc/iPhoneVNC.mm
patch
|
blob
|
blame
|
history
diff --git
a/iphonevnc/iPhoneVNC.mm
b/iphonevnc/iPhoneVNC.mm
index 94ae09c0e2bcad9d5e12ecca02efcbff00f94d58..eac7e0f36ec550956b62b4854cd1657dfa23c980 100644
(file)
--- a/
iphonevnc/iPhoneVNC.mm
+++ b/
iphonevnc/iPhoneVNC.mm
@@
-1,4
+1,3
@@
-#import <LayerKit/LKPurpleServer.h>
#import <CoreFoundation/CFData.h>
#import <CoreGraphics/CGBitmapContext.h>
#import <CoreFoundation/CFData.h>
#import <CoreGraphics/CGBitmapContext.h>
@@
-6,6
+5,8
@@
#include <stdlib.h>
#include <rfb/rfb.h>
#include <stdlib.h>
#include <rfb/rfb.h>
+extern "C" UIImage *UIGetScreenImage();
+
static const size_t Width = 320;
static const size_t Height = 480;
static const size_t BytesPerPixel = 4;
static const size_t Width = 320;
static const size_t Height = 480;
static const size_t BytesPerPixel = 4;
@@
-52,9
+53,13
@@
int main(int argc, char *argv[]) {
uint8_t *buffer1 = (uint8_t *) CGBitmapContextGetData(context1);
screen->frameBuffer = (char *) buffer0;
uint8_t *buffer1 = (uint8_t *) CGBitmapContextGetData(context1);
screen->frameBuffer = (char *) buffer0;
- CGImageRef image = LKPurpleServerGetScreenImage(NULL);
- CGContextDrawImage(context0, rect, image);
- CFRelease(image);
+ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
+
+ UIImageRef *image = UIGetScreenImage();
+ CGImageRef ref = [image CGImage];
+ CGContextDrawImage(context0, rect, ref);
+
+ [pool release];
if (memcmp(buffer0, buffer1, Size8) != 0)
rfbMarkRectAsModified(screen, 0, 0, Width, Height);
if (memcmp(buffer0, buffer1, Size8) != 0)
rfbMarkRectAsModified(screen, 0, 0, Width, Height);