summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-20 13:54:11 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-08-20 13:54:11 +0000
commitbd8988339acca1f7b42e7a29a94c6bfc9dc7e188 (patch)
treee3787c6d14da6e77cee22de9e77ece07b0ee365e /chrome/browser
parentc27608b5278ece25aa8684b6e420ce05fb16468d (diff)
downloadchromium_src-bd8988339acca1f7b42e7a29a94c6bfc9dc7e188.zip
chromium_src-bd8988339acca1f7b42e7a29a94c6bfc9dc7e188.tar.gz
chromium_src-bd8988339acca1f7b42e7a29a94c6bfc9dc7e188.tar.bz2
Essentially revert r16636. We get no speedup from using CIImage and we are susceptible to random leaks.
BUG=http://crbug.com/18661 TEST=throbbers should work just fine Review URL: http://codereview.chromium.org/171110 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23813 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/cocoa/throbber_view.mm17
1 files changed, 3 insertions, 14 deletions
diff --git a/chrome/browser/cocoa/throbber_view.mm b/chrome/browser/cocoa/throbber_view.mm
index 696ada7..72c9bb6 100644
--- a/chrome/browser/cocoa/throbber_view.mm
+++ b/chrome/browser/cocoa/throbber_view.mm
@@ -26,7 +26,7 @@ static const float kAnimationIntervalSeconds = 0.03; // 30ms, same as windows
@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 @@ static const float kAnimationIntervalSeconds = 0.03; // 30ms, same as windows
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 @@ static const float kAnimationIntervalSeconds = 0.03; // 30ms, same as windows
}
- (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);