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

Issue 2635005: [Mac] Simplify generating composited browser-action image. (Closed)

Created:
10 years, 6 months ago by Scott Hess - ex-Googler
Modified:
9 years, 6 months ago
Reviewers:
Bons
CC:
chromium-reviews, John Grabowski, Erik does not do reviews, ben+cc_chromium.org, pam+watch_chromium.org, Aaron Boodman
Base URL:
git://codf21.jail/chromium.git
Visibility:
Public.

Description

[Mac] Simplify generating composited browser-action image. Convert from using NSBitmapImageRep plus context manipulation to -[NSImage lockFocus]. BUG=none TEST=Browser actions look the same as before. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=49287

Patch Set 1 #

Total comments: 1

Patch Set 2 : scoped_nsobject -> earlier -autorelease #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -20 lines) Patch
M chrome/browser/cocoa/extensions/browser_action_button.mm View 1 2 chunks +4 lines, -20 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
Scott Hess - ex-Googler
Andy, While doing the other CL, I found myself wondering why the NSBitmapImageRep with all ...
10 years, 6 months ago (2010-06-04 20:19:39 UTC) #1
Bons
10 years, 6 months ago (2010-06-04 20:50:03 UTC) #2
LGTM

http://codereview.chromium.org/2635005/diff/1/2
File chrome/browser/cocoa/extensions/browser_action_button.mm (right):

http://codereview.chromium.org/2635005/diff/1/2#newcode285
chrome/browser/cocoa/extensions/browser_action_button.mm:285:
scoped_nsobject<NSImage> image([[NSImage alloc] initWithSize:bounds.size]);
You don't need the scoped_nsobject here. You can just do
NSImage* image = [[[NSImage alloc] initWithSize:bounds.size] autorelease];

then return image at the bottom. No need for retain and autorelease down there.

Powered by Google App Engine
This is Rietveld 408576698