This repository has been archived by the owner on Jan 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
performance-2.0.1.patch
187 lines (175 loc) · 7.07 KB
/
performance-2.0.1.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
diff -Nur build.orig/iphone/Classes/TiUILabel.m build/iphone/Classes/TiUILabel.m
--- build.orig/iphone/Classes/TiUILabel.m 2012-04-26 17:37:30.000000000 +0900
+++ build/iphone/Classes/TiUILabel.m 2012-04-26 17:39:58.000000000 +0900
@@ -265,6 +265,20 @@
[[self label] setShadowOffset:size];
}
+// override
+-(void)setBackgroundColor_:(id)color
+{
+ if ([color isKindOfClass:[UIColor class]])
+ {
+ label.backgroundColor = color;
+ }
+ else
+ {
+ TiColor *ticolor = [TiUtils colorValue:color];
+ label.backgroundColor = [ticolor _color];
+ }
+}
+
@end
-#endif
\ No newline at end of file
+#endif
diff -Nur build.orig/iphone/Classes/TiUIWebView.m build/iphone/Classes/TiUIWebView.m
--- build.orig/iphone/Classes/TiUIWebView.m 2012-04-26 17:37:31.000000000 +0900
+++ build/iphone/Classes/TiUIWebView.m 2012-04-26 17:40:33.000000000 +0900
@@ -110,32 +110,33 @@
webview = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 10, 1)];
webview.delegate = self;
- webview.opaque = NO;
+ webview.opaque = YES;
webview.backgroundColor = [UIColor whiteColor];
webview.contentMode = UIViewContentModeRedraw;
[self addSubview:webview];
-
- // only show the loading indicator if it's a remote URL
- if ([self isURLRemote])
- {
- TiColor *bgcolor = [TiUtils colorValue:[self.proxy valueForKey:@"backgroundColor"]];
- UIActivityIndicatorViewStyle style = UIActivityIndicatorViewStyleGray;
- if (bgcolor!=nil)
- {
- // check to see if the background is a dark color and if so, we want to
- // show the white indicator instead
- if ([Webcolor isDarkColor:[bgcolor _color]])
- {
- style = UIActivityIndicatorViewStyleWhite;
- }
- }
- spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:style];
- [spinner setHidesWhenStopped:YES];
- spinner.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
- [self addSubview:spinner];
- [spinner sizeToFit];
- [spinner startAnimating];
- }
+
+ // To remove indicator because it does not work correctly in 2.0.1
+ // // only show the loading indicator if it's a remote URL
+ // if ([self isURLRemote])
+ // {
+ // TiColor *bgcolor = [TiUtils colorValue:[self.proxy valueForKey:@"backgroundColor"]];
+ // UIActivityIndicatorViewStyle style = UIActivityIndicatorViewStyleGray;
+ // if (bgcolor!=nil)
+ // {
+ // // check to see if the background is a dark color and if so, we want to
+ // // show the white indicator instead
+ // if ([Webcolor isDarkColor:[bgcolor _color]])
+ // {
+ // style = UIActivityIndicatorViewStyleWhite;
+ // }
+ // }
+ // spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:style];
+ // [spinner setHidesWhenStopped:YES];
+ // spinner.autoresizingMask = UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin | UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin;
+ // [self addSubview:spinner];
+ // [spinner sizeToFit];
+ // [spinner startAnimating];
+ // }
}
return webview;
}
@@ -753,4 +754,5 @@
@end
-#endif
\ No newline at end of file
+#endif
+
diff -Nur build.orig/iphone/Classes/UIImage+Resize.m build/iphone/Classes/UIImage+Resize.m
--- build.orig/iphone/Classes/UIImage+Resize.m 2012-04-26 17:37:31.000000000 +0900
+++ build/iphone/Classes/UIImage+Resize.m 2012-04-26 17:40:14.000000000 +0900
@@ -21,49 +21,52 @@
image:(UIImage*)image
hires:(BOOL)hires
{
- CGImageRef imageRef = image.CGImage;
- CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
+ // patched: Do Nothing
+ return image;
+
+ // CGImageRef imageRef = image.CGImage;
+ // CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB();
- CGFloat scale = 1.0;
+ // CGFloat scale = 1.0;
- scale = [image scale];
- // Force scaling to 2.0
- if ([TiUtils isRetinaDisplay] && hires) {
- scale = 2.0;
- }
+ // scale = [image scale];
+ // // Force scaling to 2.0
+ // if ([TiUtils isRetinaDisplay] && hires) {
+ // scale = 2.0;
+ // }
- CGRect newRect = CGRectIntegral(CGRectMake(0, 0, newSize.width*scale, newSize.height*scale));
- CGRect transposedRect = CGRectMake(0, 0, newRect.size.height, newRect.size.width);
+ // CGRect newRect = CGRectIntegral(CGRectMake(0, 0, newSize.width*scale, newSize.height*scale));
+ // CGRect transposedRect = CGRectMake(0, 0, newRect.size.height, newRect.size.width);
- // Build a context that's the same dimensions as the new size
- CGContextRef bitmap = CGBitmapContextCreate(NULL,
- newRect.size.width,
- newRect.size.height,
- 8,
- 0,
- colorSpace,
- kCGImageAlphaPremultipliedLast);
-
- // Rotate and/or flip the image if required by its orientation
- CGContextConcatCTM(bitmap, transform);
-
- // Set the quality level to use when rescaling
- CGContextSetInterpolationQuality(bitmap, quality);
-
- // Draw into the context; this scales the image
- CGContextDrawImage(bitmap, transpose ? transposedRect : newRect, imageRef);
-
- // Get the resized image from the context and a UIImage
- CGImageRef newImageRef = CGBitmapContextCreateImage(bitmap);
- UIImage* newImage = [UIImage imageWithCGImage:newImageRef scale:scale orientation:UIImageOrientationUp];
-
- // Clean up
- CGContextRelease(bitmap);
- CGImageRelease(newImageRef);
- CGColorSpaceRelease(colorSpace);
+ // // Build a context that's the same dimensions as the new size
+ // CGContextRef bitmap = CGBitmapContextCreate(NULL,
+ // newRect.size.width,
+ // newRect.size.height,
+ // 8,
+ // 0,
+ // colorSpace,
+ // kCGImageAlphaPremultipliedLast);
+
+ // // Rotate and/or flip the image if required by its orientation
+ // CGContextConcatCTM(bitmap, transform);
+
+ // // Set the quality level to use when rescaling
+ // CGContextSetInterpolationQuality(bitmap, quality);
+
+ // // Draw into the context; this scales the image
+ // CGContextDrawImage(bitmap, transpose ? transposedRect : newRect, imageRef);
+
+ // // Get the resized image from the context and a UIImage
+ // CGImageRef newImageRef = CGBitmapContextCreateImage(bitmap);
+ // UIImage* newImage = [UIImage imageWithCGImage:newImageRef scale:scale orientation:UIImageOrientationUp];
+
+ // // Clean up
+ // CGContextRelease(bitmap);
+ // CGImageRelease(newImageRef);
+ // CGColorSpaceRelease(colorSpace);
- return newImage;
+ // return newImage;
}
// Returns an affine transform that takes into account the image orientation when drawing a scaled image