Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Unified Diff: chrome/browser/cocoa/throbber_view.mm

Issue 171110: Essentially revert r16636. We get no speedup from using CIImage and we are su... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/throbber_view.mm
===================================================================
--- chrome/browser/cocoa/throbber_view.mm (revision 23570)
+++ chrome/browser/cocoa/throbber_view.mm (working copy)
@@ -26,7 +26,7 @@
@interface ThrobberFilmstripDelegate : NSObject
<ThrobberDataDelegate> {
- scoped_nsobject<CIImage> image_;
+ scoped_nsobject<NSImage> image_;
unsigned int numFrames_; // Number of frames in this animation.
unsigned int animationFrame_; // Current frame of the animation,
// [0..numFrames_)
@@ -55,18 +55,7 @@
DCHECK((int)imageSize.width % (int)imageSize.height == 0);
numFrames_ = (int)imageSize.width / (int)imageSize.height;
DCHECK(numFrames_);
-
- // First check if we have a bitmap image rep and use it, otherwise fall
- // back to creating one.
- NSBitmapImageRep* rep = [[image representations] objectAtIndex:0];
- if (![rep isKindOfClass:[NSBitmapImageRep class]]) {
- [image lockFocus];
- NSRect imageRect = NSMakeRect(0, 0, imageSize.width, imageSize.height);
- rep = [[[NSBitmapImageRep alloc] initWithFocusedViewRect:imageRect]
- autorelease];
- [image unlockFocus];
- }
- image_.reset([[CIImage alloc] initWithBitmapImageRep:rep]);
+ image_.reset([image retain]);
}
return self;
}
@@ -76,7 +65,7 @@
}
- (void)drawFrameInRect:(NSRect)rect {
- float imageDimension = [image_ extent].size.height;
+ float imageDimension = [image_ size].height;
float xOffset = animationFrame_ * imageDimension;
NSRect sourceImageRect =
NSMakeRect(xOffset, 0, imageDimension, imageDimension);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698