| 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( | |
| 276 const CreateInfo& cinfo) { | |
| 277 const SkImageInfo& info = cinfo.fInfo; | |
| 278 const bool do_clear = !info.isOpaque(); | |
| 279 SkASSERT(info.colorType() == kN32_SkColorType); | |
| 280 return Create(NULL, info.width(), info.height(), info.isOpaque(), do_clear); | |
| 281 } | |
| 282 | |
| 283 SkBaseDevice* BitmapPlatformDevice::onCreateDevice(const CreateInfo& cinfo, | 275 SkBaseDevice* BitmapPlatformDevice::onCreateDevice(const CreateInfo& cinfo, |
| 284 const SkPaint*) { | 276 const SkPaint*) { |
| 285 const SkImageInfo& info = cinfo.fInfo; | 277 const SkImageInfo& info = cinfo.fInfo; |
| 286 const bool do_clear = !info.isOpaque(); | 278 const bool do_clear = !info.isOpaque(); |
| 287 SkASSERT(info.colorType() == kN32_SkColorType); | 279 SkASSERT(info.colorType() == kN32_SkColorType); |
| 288 return Create(NULL, info.width(), info.height(), info.isOpaque(), do_clear); | 280 return Create(NULL, info.width(), info.height(), info.isOpaque(), do_clear); |
| 289 } | 281 } |
| 290 | 282 |
| 291 // PlatformCanvas impl | 283 // PlatformCanvas impl |
| 292 | 284 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 321 | 313 |
| 322 if (!is_opaque) | 314 if (!is_opaque) |
| 323 bitmap_.eraseColor(0); | 315 bitmap_.eraseColor(0); |
| 324 | 316 |
| 325 surface_ = CGContextForData(bitmap_.getPixels(), bitmap_.width(), | 317 surface_ = CGContextForData(bitmap_.getPixels(), bitmap_.width(), |
| 326 bitmap_.height()); | 318 bitmap_.height()); |
| 327 return true; | 319 return true; |
| 328 } | 320 } |
| 329 | 321 |
| 330 } // namespace skia | 322 } // namespace skia |
| OLD | NEW |