| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/platform_canvas.h" | 5 #include "skia/ext/platform_canvas.h" |
| 6 | 6 |
| 7 #include <cairo/cairo.h> | 7 #include <cairo/cairo.h> |
| 8 | 8 |
| 9 #include "skia/ext/platform_device_linux.h" | 9 #include "skia/ext/platform_device_linux.h" |
| 10 #include "skia/ext/bitmap_platform_device_linux.h" | 10 #include "skia/ext/bitmap_platform_device_linux.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 SkDevice* device = | 35 SkDevice* device = |
| 36 BitmapPlatformDevice::Create(width, height, is_opaque, data); | 36 BitmapPlatformDevice::Create(width, height, is_opaque, data); |
| 37 if (!device) | 37 if (!device) |
| 38 return false; | 38 return false; |
| 39 | 39 |
| 40 setDevice(device); | 40 setDevice(device); |
| 41 device->unref(); // was created with refcount 1, and setDevice also refs | 41 device->unref(); // was created with refcount 1, and setDevice also refs |
| 42 return true; | 42 return true; |
| 43 } | 43 } |
| 44 | 44 |
| 45 cairo_surface_t* PlatformCanvas::beginPlatformPaint() { | 45 cairo_t* PlatformCanvas::beginPlatformPaint() { |
| 46 return getTopPlatformDevice().beginPlatformPaint(); | 46 return getTopPlatformDevice().beginPlatformPaint(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 void PlatformCanvas::endPlatformPaint() { | 49 void PlatformCanvas::endPlatformPaint() { |
| 50 // We don't need to do anything on Linux here. | 50 // We don't need to do anything on Linux here. |
| 51 } | 51 } |
| 52 | 52 |
| 53 SkDevice* PlatformCanvas::createDevice(SkBitmap::Config config, | 53 SkDevice* PlatformCanvas::createDevice(SkBitmap::Config config, |
| 54 int width, | 54 int width, |
| 55 int height, | 55 int height, |
| 56 bool is_opaque, | 56 bool is_opaque, |
| 57 bool isForLayer) { | 57 bool isForLayer) { |
| 58 SkASSERT(config == SkBitmap::kARGB_8888_Config); | 58 SkASSERT(config == SkBitmap::kARGB_8888_Config); |
| 59 return BitmapPlatformDevice::Create(width, height, is_opaque); | 59 return BitmapPlatformDevice::Create(width, height, is_opaque); |
| 60 } | 60 } |
| 61 | 61 |
| 62 } // namespace skia | 62 } // namespace skia |
| OLD | NEW |