OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include <cairo/cairo.h> | 9 #include <cairo/cairo.h> |
10 | 10 |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, width)); | 113 cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, width)); |
114 | 114 |
115 return Create(width, height, is_opaque, surface); | 115 return Create(width, height, is_opaque, surface); |
116 } | 116 } |
117 | 117 |
118 // The device will own the bitmap, which corresponds to also owning the pixel | 118 // The device will own the bitmap, which corresponds to also owning the pixel |
119 // data. Therefore, we do not transfer ownership to the SkDevice's bitmap. | 119 // data. Therefore, we do not transfer ownership to the SkDevice's bitmap. |
120 BitmapPlatformDevice::BitmapPlatformDevice( | 120 BitmapPlatformDevice::BitmapPlatformDevice( |
121 const SkBitmap& bitmap, | 121 const SkBitmap& bitmap, |
122 BitmapPlatformDeviceData* data) | 122 BitmapPlatformDeviceData* data) |
123 : PlatformDevice(bitmap), | 123 : SkDevice(bitmap), |
124 data_(data) { | 124 data_(data) { |
| 125 SetPlatformDevice(this, this); |
125 } | 126 } |
126 | 127 |
127 BitmapPlatformDevice::~BitmapPlatformDevice() { | 128 BitmapPlatformDevice::~BitmapPlatformDevice() { |
128 } | 129 } |
129 | 130 |
130 SkDevice* BitmapPlatformDevice::onCreateCompatibleDevice( | 131 SkDevice* BitmapPlatformDevice::onCreateCompatibleDevice( |
131 SkBitmap::Config config, int width, int height, bool isOpaque, | 132 SkBitmap::Config config, int width, int height, bool isOpaque, |
132 Usage /*usage*/) { | 133 Usage /*usage*/) { |
133 SkASSERT(config == SkBitmap::kARGB_8888_Config); | 134 SkASSERT(config == SkBitmap::kARGB_8888_Config); |
134 return BitmapPlatformDevice::Create(width, height, isOpaque); | 135 return BitmapPlatformDevice::Create(width, height, isOpaque); |
(...skipping 11 matching lines...) Expand all Loading... |
146 return cairo; | 147 return cairo; |
147 } | 148 } |
148 | 149 |
149 void BitmapPlatformDevice::setMatrixClip(const SkMatrix& transform, | 150 void BitmapPlatformDevice::setMatrixClip(const SkMatrix& transform, |
150 const SkRegion& region, | 151 const SkRegion& region, |
151 const SkClipStack&) { | 152 const SkClipStack&) { |
152 data_->SetMatrixClip(transform, region); | 153 data_->SetMatrixClip(transform, region); |
153 } | 154 } |
154 | 155 |
155 } // namespace skia | 156 } // namespace skia |
OLD | NEW |