| 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/platform_canvas.h" | 5 #include "skia/ext/platform_canvas.h" |
| 6 | 6 |
| 7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "skia/ext/bitmap_platform_device.h" | 8 #include "skia/ext/bitmap_platform_device.h" |
| 9 | 9 |
| 10 // TODO(reveman): a lot of unnecessary duplication of code from | 10 // TODO(reveman): a lot of unnecessary duplication of code from |
| 11 // platform_canvas_[win|linux|mac].cc in here. Need to refactor | 11 // platform_canvas_[win|linux|mac].cc in here. Need to refactor |
| 12 // PlatformCanvas to avoid this: | 12 // PlatformCanvas to avoid this: |
| 13 // http://code.google.com/p/chromium/issues/detail?id=119555 | 13 // http://code.google.com/p/chromium/issues/detail?id=119555 |
| 14 | 14 |
| 15 namespace skia { | 15 namespace skia { |
| 16 | 16 #if 0 |
| 17 PlatformCanvas::PlatformCanvas(int width, int height, bool is_opaque) { | 17 PlatformCanvas::PlatformCanvas(int width, int height, bool is_opaque) { |
| 18 TRACE_EVENT2("skia", "PlatformCanvas::PlatformCanvas", | 18 TRACE_EVENT2("skia", "PlatformCanvas::PlatformCanvas", |
| 19 "width", width, "height", height); | 19 "width", width, "height", height); |
| 20 if (!initialize(width, height, is_opaque)) | 20 if (!initialize(width, height, is_opaque)) |
| 21 SK_CRASH(); | 21 SK_CRASH(); |
| 22 } | 22 } |
| 23 | 23 |
| 24 #if defined(WIN32) | 24 #if defined(WIN32) |
| 25 PlatformCanvas::PlatformCanvas(int width, | 25 PlatformCanvas::PlatformCanvas(int width, |
| 26 int height, | 26 int height, |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 uint8_t* data) { | 102 uint8_t* data) { |
| 103 // Use platform specific device for data. | 103 // Use platform specific device for data. |
| 104 if (data) | 104 if (data) |
| 105 return initializeWithDevice(BitmapPlatformDevice::Create( | 105 return initializeWithDevice(BitmapPlatformDevice::Create( |
| 106 width, height, is_opaque, data)); | 106 width, height, is_opaque, data)); |
| 107 | 107 |
| 108 return initializeWithDevice(new SkDevice( | 108 return initializeWithDevice(new SkDevice( |
| 109 SkBitmap::kARGB_8888_Config, width, height, is_opaque)); | 109 SkBitmap::kARGB_8888_Config, width, height, is_opaque)); |
| 110 } | 110 } |
| 111 #endif | 111 #endif |
| 112 | 112 #endif |
| 113 } // namespace skia | 113 } // namespace skia |
| OLD | NEW |