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

Side by Side Diff: skia/ext/bitmap_platform_device_mac.cc

Issue 168833002: call clear() instead of using deprecated API accessBitmap() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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
« no previous file with comments | « no previous file | skia/ext/bitmap_platform_device_skia.cc » ('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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "skia/ext/bitmap_platform_device_mac.h" 5 #include "skia/ext/bitmap_platform_device_mac.h"
6 6
7 #import <ApplicationServices/ApplicationServices.h> 7 #import <ApplicationServices/ApplicationServices.h>
8 #include <time.h> 8 #include <time.h>
9 9
10 #include "base/mac/mac_util.h" 10 #include "base/mac/mac_util.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 CGContextRelease(context); 139 CGContextRelease(context);
140 140
141 return rv; 141 return rv;
142 } 142 }
143 143
144 BitmapPlatformDevice* BitmapPlatformDevice::CreateAndClear(int width, 144 BitmapPlatformDevice* BitmapPlatformDevice::CreateAndClear(int width,
145 int height, 145 int height,
146 bool is_opaque) { 146 bool is_opaque) {
147 BitmapPlatformDevice* device = Create(NULL, width, height, is_opaque); 147 BitmapPlatformDevice* device = Create(NULL, width, height, is_opaque);
148 if (!is_opaque) 148 if (!is_opaque)
149 device->accessBitmap(true).eraseARGB(0, 0, 0, 0); 149 device->clear(0);
150 return device; 150 return device;
151 } 151 }
152 152
153 BitmapPlatformDevice* BitmapPlatformDevice::CreateWithData(uint8_t* data, 153 BitmapPlatformDevice* BitmapPlatformDevice::CreateWithData(uint8_t* data,
154 int width, 154 int width,
155 int height, 155 int height,
156 bool is_opaque) { 156 bool is_opaque) {
157 CGContextRef context = NULL; 157 CGContextRef context = NULL;
158 if (data) 158 if (data)
159 context = CGContextForData(data, width, height); 159 context = CGContextForData(data, width, height);
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 282
283 if (!is_opaque) 283 if (!is_opaque)
284 bitmap_.eraseColor(0); 284 bitmap_.eraseColor(0);
285 285
286 surface_ = CGContextForData(bitmap_.getPixels(), bitmap_.width(), 286 surface_ = CGContextForData(bitmap_.getPixels(), bitmap_.width(),
287 bitmap_.height()); 287 bitmap_.height());
288 return true; 288 return true;
289 } 289 }
290 290
291 } // namespace skia 291 } // namespace skia
OLDNEW
« no previous file with comments | « no previous file | skia/ext/bitmap_platform_device_skia.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698