| 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_linux.h" | 5 #include "skia/ext/bitmap_platform_device_linux.h" |
| 6 | 6 |
| 7 #include "skia/ext/bitmap_platform_device_data.h" | 7 #include "skia/ext/bitmap_platform_device_data.h" |
| 8 | 8 |
| 9 #if defined(OS_OPENBSD) | 9 #if defined(OS_OPENBSD) |
| 10 #include <cairo.h> | 10 #include <cairo.h> |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 BitmapPlatformDevice* device = Create(width, height, is_opaque, surface); | 103 BitmapPlatformDevice* device = Create(width, height, is_opaque, surface); |
| 104 | 104 |
| 105 #ifndef NDEBUG | 105 #ifndef NDEBUG |
| 106 if (is_opaque) // Fill with bright bluish green | 106 if (is_opaque) // Fill with bright bluish green |
| 107 device->eraseColor(SkColorSetARGB(255, 0, 255, 128)); | 107 device->eraseColor(SkColorSetARGB(255, 0, 255, 128)); |
| 108 #endif | 108 #endif |
| 109 | 109 |
| 110 return device; | 110 return device; |
| 111 } | 111 } |
| 112 | 112 |
| 113 BitmapPlatformDevice* BitmapPlatformDevice::CreateAndClear(int width, |
| 114 int height, |
| 115 bool is_opaque) { |
| 116 // The Linux port always constructs initialized bitmaps, so there is no extra |
| 117 // work to perform here. |
| 118 return Create(width, height, is_opaque); |
| 119 } |
| 120 |
| 113 BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height, | 121 BitmapPlatformDevice* BitmapPlatformDevice::Create(int width, int height, |
| 114 bool is_opaque, | 122 bool is_opaque, |
| 115 uint8_t* data) { | 123 uint8_t* data) { |
| 116 cairo_surface_t* surface = cairo_image_surface_create_for_data( | 124 cairo_surface_t* surface = cairo_image_surface_create_for_data( |
| 117 data, CAIRO_FORMAT_ARGB32, width, height, | 125 data, CAIRO_FORMAT_ARGB32, width, height, |
| 118 cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, width)); | 126 cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, width)); |
| 119 | 127 |
| 120 return Create(width, height, is_opaque, surface); | 128 return Create(width, height, is_opaque, surface); |
| 121 } | 129 } |
| 122 | 130 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 SkASSERT(false); | 166 SkASSERT(false); |
| 159 } | 167 } |
| 160 | 168 |
| 161 void BitmapPlatformDevice::setMatrixClip(const SkMatrix& transform, | 169 void BitmapPlatformDevice::setMatrixClip(const SkMatrix& transform, |
| 162 const SkRegion& region, | 170 const SkRegion& region, |
| 163 const SkClipStack&) { | 171 const SkClipStack&) { |
| 164 data_->SetMatrixClip(transform, region); | 172 data_->SetMatrixClip(transform, region); |
| 165 } | 173 } |
| 166 | 174 |
| 167 } // namespace skia | 175 } // namespace skia |
| OLD | NEW |