Permalink
Browse files

Version 2.5.6

  • Loading branch information...
1 parent 01645e9 commit ba7286a087d8ca433a97a57750274c458c0bd484 @vfr vfr committed Apr 17, 2012
Showing with 41 additions and 8 deletions.
  1. +11 −1 README
  2. +2 −2 Reader-Info.plist
  3. BIN Resources/Reader.pdf
  4. +2 −1 Sources/ReaderConstants.h
  5. +15 −1 Sources/ReaderContentPage.m
  6. +11 −3 Sources/ReaderThumbFetch.m
View
12 README
@@ -51,7 +51,7 @@ NOTES
Version 2.x of the PDF reader/viewer code was originally developed
and tested under Xcode 3.2.6, LLVM 1.7, iOS 4.3.5, iOS 4.2.1 with
-current development and testing under Xcode 4.3, Clang 3.1, iOS 5.
+current development and testing under Xcode 4.3.2, LLVM 3.1, iOS 5.
The code uses manual memory management and will continue to do so.
The overall PDF reader/viewer functionality is encapsulated in the
@@ -145,6 +145,11 @@ READER_STANDALONE - If FALSE, a "Done" button is added to the toolbar
and the -dismissReaderViewController: delegate method is messaged when
it is tapped.
+READER_DISABLE_RETINA - If TRUE, sets the CATiledLayer contentScale
+to 1.0f. This effectively disables retina support and results in
+non-retina device rendering speeds on retina display devices at
+the loss of retina display quality.
+
ReaderDocument Archiving
------------------------
@@ -224,6 +229,11 @@ HISTORY
- Bug fix to PDF link handling with cropboxed PDF files.
- Some performance improvements on iPad 3rd generation.
+2012-04-16: Version 2.5.6
+
+ - Now loads and decodes thumbnail PNGs on a background thread.
+ - Added READER_DISABLE_RETINA #define performance option.
+
CONTACT INFO
============
View
@@ -26,9 +26,9 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>2.5.5</string>
+ <string>2.5.6</string>
<key>CFBundleShortVersionString</key>
- <string>2.5.5</string>
+ <string>2.5.6</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIPrerenderedIcon</key>
View
Binary file not shown.
@@ -1,6 +1,6 @@
//
// ReaderConstants.h
-// Reader v2.5.4
+// Reader v2.5.6
//
// Created by Julius Oklamcak on 2011-07-01.
// Copyright © 2011-2012 Julius Oklamcak. All rights reserved.
@@ -29,6 +29,7 @@
#define READER_ENABLE_MAIL TRUE
#define READER_ENABLE_PRINT TRUE
#define READER_ENABLE_THUMBS TRUE
+#define READER_DISABLE_RETINA FALSE
#define READER_DISABLE_IDLE FALSE
#define READER_SHOW_SHADOWS TRUE
#define READER_STANDALONE FALSE
@@ -1,6 +1,6 @@
//
// ReaderContentPage.m
-// Reader v2.5.5
+// Reader v2.5.6
//
// Created by Julius Oklamcak on 2011-07-01.
// Copyright © 2011-2012 Julius Oklamcak. All rights reserved.
@@ -23,6 +23,7 @@
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
+#import "ReaderConstants.h"
#import "ReaderContentPage.h"
#import "ReaderContentTile.h"
#import "CGPDFDocument.h"
@@ -552,6 +553,19 @@ - (void)dealloc
[super dealloc];
}
+#if (READER_DISABLE_RETINA == TRUE) // Option
+
+- (void)didMoveToWindow
+{
+#ifdef DEBUGX
+ NSLog(@"%s", __FUNCTION__);
+#endif
+
+ self.contentScaleFactor = 1.0f; // Override scale factor
+}
+
+#endif // end of READER_DISABLE_RETINA Option
+
/*
- (void)layoutSubviews
{
View
@@ -1,6 +1,6 @@
//
// ReaderThumbFetch.m
-// Reader v2.5.4
+// Reader v2.5.6
//
// Created by Julius Oklamcak on 2011-09-01.
// Copyright © 2011-2012 Julius Oklamcak. All rights reserved.
@@ -134,7 +134,15 @@ - (void)main
CGImageRelease(imageRef); // Release the CGImage reference from the above thumb load code
- [[ReaderThumbCache sharedInstance] setObject:image forKey:request.cacheKey]; // Update cache
+ UIGraphicsBeginImageContextWithOptions(image.size, YES, request.scale); // Graphics context
+
+ [image drawAtPoint:CGPointZero]; // Decode and draw the image on this background thread
+
+ UIImage *decoded = UIGraphicsGetImageFromCurrentImageContext(); // Newly decoded image
+
+ UIGraphicsEndImageContext(); // Cleanup after the bitmap-based graphics drawing context
+
+ [[ReaderThumbCache sharedInstance] setObject:decoded forKey:request.cacheKey]; // Update cache
if (self.isCancelled == NO) // Show the image in the target thumb view on the main thread
{
@@ -144,7 +152,7 @@ - (void)main
dispatch_async(dispatch_get_main_queue(), // Queue image show on main thread
^{
- if (thumbView.targetTag == targetTag) [thumbView showImage:image];
+ if (thumbView.targetTag == targetTag) [thumbView showImage:decoded];
});
}
}

0 comments on commit ba7286a

Please sign in to comment.