OLD | NEW |
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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 LoadConfig(); | 265 LoadConfig(); |
266 return bitmap_context_; | 266 return bitmap_context_; |
267 } | 267 } |
268 | 268 |
269 void BitmapPlatformDevice::setMatrixClip(const SkMatrix& transform, | 269 void BitmapPlatformDevice::setMatrixClip(const SkMatrix& transform, |
270 const SkRegion& region, | 270 const SkRegion& region, |
271 const SkClipStack&) { | 271 const SkClipStack&) { |
272 SetMatrixClip(transform, region); | 272 SetMatrixClip(transform, region); |
273 } | 273 } |
274 | 274 |
275 SkBaseDevice* BitmapPlatformDevice::onCreateCompatibleDevice( | 275 SkBaseDevice* BitmapPlatformDevice::onCreateDevice(const CreateInfo& cinfo, |
276 const CreateInfo& cinfo) { | 276 const SkPaint*) { |
277 const SkImageInfo& info = cinfo.fInfo; | 277 const SkImageInfo& info = cinfo.fInfo; |
278 const bool do_clear = !info.isOpaque(); | 278 const bool do_clear = !info.isOpaque(); |
279 SkASSERT(info.colorType() == kN32_SkColorType); | 279 SkASSERT(info.colorType() == kN32_SkColorType); |
280 return Create(NULL, info.width(), info.height(), info.isOpaque(), do_clear); | 280 return Create(NULL, info.width(), info.height(), info.isOpaque(), do_clear); |
281 } | 281 } |
282 | 282 |
283 // PlatformCanvas impl | 283 // PlatformCanvas impl |
284 | 284 |
285 SkCanvas* CreatePlatformCanvas(CGContextRef ctx, int width, int height, | 285 SkCanvas* CreatePlatformCanvas(CGContextRef ctx, int width, int height, |
286 bool is_opaque, OnFailureType failureType) { | 286 bool is_opaque, OnFailureType failureType) { |
(...skipping 26 matching lines...) Expand all Loading... |
313 | 313 |
314 if (!is_opaque) | 314 if (!is_opaque) |
315 bitmap_.eraseColor(0); | 315 bitmap_.eraseColor(0); |
316 | 316 |
317 surface_ = CGContextForData(bitmap_.getPixels(), bitmap_.width(), | 317 surface_ = CGContextForData(bitmap_.getPixels(), bitmap_.width(), |
318 bitmap_.height()); | 318 bitmap_.height()); |
319 return true; | 319 return true; |
320 } | 320 } |
321 | 321 |
322 } // namespace skia | 322 } // namespace skia |
OLD | NEW |