summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-20 01:09:46 +0000
committerrsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-20 01:09:46 +0000
commit30811dcf747f188a196567ea209a6a3124ee5dc0 (patch)
treee6a499e7cf0a2872b1ee7075df1206eb4821209a /chrome/browser
parentdd6ab128e8f9928a978d60d66ae8a46b2f8ff3d8 (diff)
downloadchromium_src-30811dcf747f188a196567ea209a6a3124ee5dc0.zip
chromium_src-30811dcf747f188a196567ea209a6a3124ee5dc0.tar.gz
chromium_src-30811dcf747f188a196567ea209a6a3124ee5dc0.tar.bz2
Load the download animation image as an NSImage rather than a CGImageRef.
BUG=none TEST=ui_tests don't crash Review URL: http://codereview.chromium.org/3005018 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52982 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/cocoa/animatable_image.mm2
-rw-r--r--chrome/browser/cocoa/download_started_animation_mac.mm9
2 files changed, 5 insertions, 6 deletions
diff --git a/chrome/browser/cocoa/animatable_image.mm b/chrome/browser/cocoa/animatable_image.mm
index 9094341..db08224 100644
--- a/chrome/browser/cocoa/animatable_image.mm
+++ b/chrome/browser/cocoa/animatable_image.mm
@@ -148,7 +148,7 @@
[image_ drawInRect:NSMakeRect(0,0, size.width, size.height)
fromRect:NSZeroRect
operation:NSCompositeCopy
- fraction:1.0];
+ fraction:1.0];
[NSGraphicsContext restoreGraphicsState];
scoped_cftyperef<CGImageRef> cgImage(CGBitmapContextCreateImage(context));
diff --git a/chrome/browser/cocoa/download_started_animation_mac.mm b/chrome/browser/cocoa/download_started_animation_mac.mm
index f004469..f756bb0 100644
--- a/chrome/browser/cocoa/download_started_animation_mac.mm
+++ b/chrome/browser/cocoa/download_started_animation_mac.mm
@@ -84,8 +84,7 @@ class DownloadAnimationTabObserver : public NotificationObserver {
if ((self = [super init])) {
// Load the image of the download arrow.
ResourceBundle& bundle = ResourceBundle::GetSharedInstance();
- SkBitmap* imageBitmap = bundle.GetBitmapNamed(IDR_DOWNLOAD_ANIMATION_BEGIN);
- scoped_cftyperef<CGImageRef> image(SkCreateCGImageRef(*imageBitmap));
+ NSImage* image = bundle.GetNSImageNamed(IDR_DOWNLOAD_ANIMATION_BEGIN);
// Figure out the positioning in the current tab. Try to position the layer
// against the left edge, and three times the download image's height from
@@ -93,8 +92,8 @@ class DownloadAnimationTabObserver : public NotificationObserver {
// enough, don't show the animation and let the shelf speak for itself.
gfx::Rect bounds;
tabContents->GetContainerBounds(&bounds);
- imageWidth_ = CGImageGetWidth(image);
- CGFloat imageHeight = CGImageGetHeight(image);
+ imageWidth_ = [image size].width;
+ CGFloat imageHeight = [image size].height;
// Sanity check the size in case there's no room to display the animation.
if (bounds.height() < imageHeight) {
@@ -117,7 +116,7 @@ class DownloadAnimationTabObserver : public NotificationObserver {
// Create the animation object to assist in animating and fading.
CGFloat animationHeight = MIN(bounds.height(), 4 * imageHeight);
NSRect frame = NSMakeRect(origin.x, origin.y, imageWidth_, animationHeight);
- animation_ = [[AnimatableImage alloc] initWithImage:(id)image.get()
+ animation_ = [[AnimatableImage alloc] initWithImage:image
animationFrame:frame];
[parentWindow addChildWindow:animation_ ordered:NSWindowAbove];