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

Side by Side Diff: chrome/browser/media/webrtc/window_icon_util_mac.mm

Issue 2823003002: SkBitmap and SkPixelRef no longer need lock/unlock (Closed)
Patch Set: win fix after rebase Created 3 years, 8 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include "chrome/browser/media/webrtc/window_icon_util.h" 5 #include "chrome/browser/media/webrtc/window_icon_util.h"
6 6
7 #include <ApplicationServices/ApplicationServices.h> 7 #include <ApplicationServices/ApplicationServices.h>
8 #include <Cocoa/Cocoa.h> 8 #include <Cocoa/Cocoa.h>
9 #include <CoreFoundation/CoreFoundation.h> 9 #include <CoreFoundation/CoreFoundation.h>
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 } 46 }
47 47
48 CGDataProviderRef provider = CGImageGetDataProvider(cg_icon_image); 48 CGDataProviderRef provider = CGImageGetDataProvider(cg_icon_image);
49 CFDataRef cf_data = CGDataProviderCopyData(provider); 49 CFDataRef cf_data = CGDataProviderCopyData(provider);
50 50
51 int src_stride = CGImageGetBytesPerRow(cg_icon_image); 51 int src_stride = CGImageGetBytesPerRow(cg_icon_image);
52 const uint8_t* src_data = CFDataGetBytePtr(cf_data); 52 const uint8_t* src_data = CFDataGetBytePtr(cf_data);
53 53
54 SkBitmap result; 54 SkBitmap result;
55 result.allocN32Pixels(width, height, false); 55 result.allocN32Pixels(width, height, false);
56 result.lockPixels();
57 56
58 uint8_t* pixels_data = reinterpret_cast<uint8_t*>(result.getPixels()); 57 uint8_t* pixels_data = reinterpret_cast<uint8_t*>(result.getPixels());
59 58
60 libyuv::ABGRToARGB(src_data, src_stride, pixels_data, result.rowBytes(), 59 libyuv::ABGRToARGB(src_data, src_stride, pixels_data, result.rowBytes(),
61 width, height); 60 width, height);
62 61
63 CFRelease(cf_data); 62 CFRelease(cf_data);
64 63
65 return gfx::ImageSkia::CreateFrom1xBitmap(result); 64 return gfx::ImageSkia::CreateFrom1xBitmap(result);
66 } 65 }
OLDNEW
« no previous file with comments | « chrome/browser/media/webrtc/tab_desktop_media_list_unittest.cc ('k') | chrome/browser/media/webrtc/window_icon_util_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698