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

Side by Side Diff: chrome/browser/cocoa/animatable_image.mm

Issue 3855001: Move scoped_cftyperef from base to base/mac, use the new namespace, and name ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 10 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/app/breakpad_mac.mm ('k') | chrome/browser/cocoa/certificate_viewer.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/cocoa/animatable_image.h" 5 #import "chrome/browser/cocoa/animatable_image.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #import "base/mac_util.h" 8 #import "base/mac_util.h"
9 #include "base/scoped_cftyperef.h" 9 #include "base/mac/scoped_cftyperef.h"
10 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" 10 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h"
11 11
12 @interface AnimatableImage (Private) 12 @interface AnimatableImage (Private)
13 - (void)setLayerContents:(CALayer*)layer; 13 - (void)setLayerContents:(CALayer*)layer;
14 @end 14 @end
15 15
16 @implementation AnimatableImage 16 @implementation AnimatableImage
17 17
18 @synthesize startFrame = startFrame_; 18 @synthesize startFrame = startFrame_;
19 @synthesize endFrame = endFrame_; 19 @synthesize endFrame = endFrame_;
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 [layer addAnimation:boundsAnimation forKey:@"bounds"]; 123 [layer addAnimation:boundsAnimation forKey:@"bounds"];
124 } 124 }
125 [layer addAnimation:positionAnimation forKey:@"position"]; 125 [layer addAnimation:positionAnimation forKey:@"position"];
126 [layer addAnimation:opacityAnimation forKey:@"opacity"]; 126 [layer addAnimation:opacityAnimation forKey:@"opacity"];
127 [CATransaction commit]; 127 [CATransaction commit];
128 } 128 }
129 129
130 // Sets the layer contents by converting the NSImage to a CGImageRef. This will 130 // Sets the layer contents by converting the NSImage to a CGImageRef. This will
131 // rasterize PDF resources. 131 // rasterize PDF resources.
132 - (void)setLayerContents:(CALayer*)layer { 132 - (void)setLayerContents:(CALayer*)layer {
133 scoped_cftyperef<CGImageRef> image( 133 base::mac::ScopedCFTypeRef<CGImageRef> image(
134 mac_util::CopyNSImageToCGImage(image_.get())); 134 mac_util::CopyNSImageToCGImage(image_.get()));
135 // Create the layer that will be animated. 135 // Create the layer that will be animated.
136 [layer setContents:(id)image.get()]; 136 [layer setContents:(id)image.get()];
137 } 137 }
138 138
139 // CAAnimation delegate method called when the animation is complete. 139 // CAAnimation delegate method called when the animation is complete.
140 - (void)animationDidStop:(CAAnimation*)animation finished:(BOOL)flag { 140 - (void)animationDidStop:(CAAnimation*)animation finished:(BOOL)flag {
141 // Close the window, releasing self. 141 // Close the window, releasing self.
142 [self close]; 142 [self close];
143 } 143 }
144 144
145 @end 145 @end
OLDNEW
« no previous file with comments | « chrome/app/breakpad_mac.mm ('k') | chrome/browser/cocoa/certificate_viewer.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698