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

Side by Side Diff: chrome/browser/ui/cocoa/tabpose_window.mm

Issue 6117006: Mac: Explicitly set the colorspace on SkBitmap -> CGImageRef conversions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: '' Created 9 years, 11 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
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/ui/cocoa/tabpose_window.h" 5 #import "chrome/browser/ui/cocoa/tabpose_window.h"
6 6
7 #import <QuartzCore/QuartzCore.h> 7 #import <QuartzCore/QuartzCore.h>
8 8
9 #include "app/resource_bundle.h" 9 #include "app/resource_bundle.h"
10 #include "base/mac/mac_util.h" 10 #include "base/mac/mac_util.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 } 170 }
171 return self; 171 return self;
172 } 172 }
173 173
174 - (void)setTabContents:(TabContents*)contents { 174 - (void)setTabContents:(TabContents*)contents {
175 contents_ = contents; 175 contents_ = contents;
176 } 176 }
177 177
178 - (void)setThumbnail:(const SkBitmap&)bitmap { 178 - (void)setThumbnail:(const SkBitmap&)bitmap {
179 // SkCreateCGImageRef() holds on to |bitmaps|'s memory, so this doesn't 179 // SkCreateCGImageRef() holds on to |bitmaps|'s memory, so this doesn't
180 // create a copy. 180 // create a copy. The renderer always draws data in the system colorspace.
181 thumbnail_.reset(SkCreateCGImageRef(bitmap)); 181 thumbnail_.reset(SkCreateCGImageRefWithColorspace(
182 bitmap, base::mac::GetSystemColorSpace()));
182 loader_ = NULL; 183 loader_ = NULL;
183 [self setNeedsDisplay]; 184 [self setNeedsDisplay];
184 } 185 }
185 186
186 - (int)topOffset { 187 - (int)topOffset {
187 int topOffset = 0; 188 int topOffset = 0;
188 189
189 // Medium term, we want to show thumbs of the actual info bar views, which 190 // Medium term, we want to show thumbs of the actual info bar views, which
190 // means I need to create InfoBarControllers here. At that point, we can get 191 // means I need to create InfoBarControllers here. At that point, we can get
191 // the height from that controller. Until then, hardcode. :-/ 192 // the height from that controller. Until then, hardcode. :-/
(...skipping 1353 matching lines...) Expand 10 before | Expand all | Expand 10 after
1545 tile.set_tab_contents(contents->tab_contents()); 1546 tile.set_tab_contents(contents->tab_contents());
1546 ThumbnailLayer* thumbLayer = [allThumbnailLayers_ objectAtIndex:index]; 1547 ThumbnailLayer* thumbLayer = [allThumbnailLayers_ objectAtIndex:index];
1547 [thumbLayer setTabContents:contents->tab_contents()]; 1548 [thumbLayer setTabContents:contents->tab_contents()];
1548 } 1549 }
1549 1550
1550 - (void)tabStripModelDeleted { 1551 - (void)tabStripModelDeleted {
1551 [self close]; 1552 [self close];
1552 } 1553 }
1553 1554
1554 @end 1555 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698