| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 Google Inc. |
| 4 * | 4 * |
| 5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
| 6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 #ifndef SkBitmapDevice_DEFINED | 9 #ifndef SkBitmapDevice_DEFINED |
| 10 #define SkBitmapDevice_DEFINED | 10 #define SkBitmapDevice_DEFINED |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 */ | 181 */ |
| 182 virtual const SkBitmap& onAccessBitmap() SK_OVERRIDE; | 182 virtual const SkBitmap& onAccessBitmap() SK_OVERRIDE; |
| 183 | 183 |
| 184 SkPixelRef* getPixelRef() const { return fBitmap.pixelRef(); } | 184 SkPixelRef* getPixelRef() const { return fBitmap.pixelRef(); } |
| 185 // just for subclasses, to assign a custom pixelref | 185 // just for subclasses, to assign a custom pixelref |
| 186 SkPixelRef* setPixelRef(SkPixelRef* pr) { | 186 SkPixelRef* setPixelRef(SkPixelRef* pr) { |
| 187 fBitmap.setPixelRef(pr); | 187 fBitmap.setPixelRef(pr); |
| 188 return pr; | 188 return pr; |
| 189 } | 189 } |
| 190 | 190 |
| 191 /** | |
| 192 * Implements readPixels API. The caller will ensure that: | |
| 193 * 1. bitmap has pixel config kARGB_8888_Config. | |
| 194 * 2. bitmap has pixels. | |
| 195 * 3. The rectangle (x, y, x + bitmap->width(), y + bitmap->height()) is | |
| 196 * contained in the device bounds. | |
| 197 */ | |
| 198 #ifdef SK_SUPPORT_LEGACY_READPIXELSCONFIG | |
| 199 virtual bool onReadPixels(const SkBitmap&, int x, int y, SkCanvas::Config888
8) SK_OVERRIDE; | |
| 200 #endif | |
| 201 virtual bool onReadPixels(const SkImageInfo&, void*, size_t, int x, int y) S
K_OVERRIDE; | 191 virtual bool onReadPixels(const SkImageInfo&, void*, size_t, int x, int y) S
K_OVERRIDE; |
| 202 virtual bool onWritePixels(const SkImageInfo&, const void*, size_t, int, int
) SK_OVERRIDE; | 192 virtual bool onWritePixels(const SkImageInfo&, const void*, size_t, int, int
) SK_OVERRIDE; |
| 203 virtual void* onAccessPixels(SkImageInfo* info, size_t* rowBytes) SK_OVERRID
E; | 193 virtual void* onAccessPixels(SkImageInfo* info, size_t* rowBytes) SK_OVERRID
E; |
| 204 | 194 |
| 205 /** Called when this device is installed into a Canvas. Balanced by a call | 195 /** Called when this device is installed into a Canvas. Balanced by a call |
| 206 to unlockPixels() when the device is removed from a Canvas. | 196 to unlockPixels() when the device is removed from a Canvas. |
| 207 */ | 197 */ |
| 208 virtual void lockPixels() SK_OVERRIDE; | 198 virtual void lockPixels() SK_OVERRIDE; |
| 209 virtual void unlockPixels() SK_OVERRIDE; | 199 virtual void unlockPixels() SK_OVERRIDE; |
| 210 | 200 |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 | 253 |
| 264 virtual SkSurface* newSurface(const SkImageInfo&) SK_OVERRIDE; | 254 virtual SkSurface* newSurface(const SkImageInfo&) SK_OVERRIDE; |
| 265 virtual const void* peekPixels(SkImageInfo*, size_t* rowBytes) SK_OVERRIDE; | 255 virtual const void* peekPixels(SkImageInfo*, size_t* rowBytes) SK_OVERRIDE; |
| 266 | 256 |
| 267 SkBitmap fBitmap; | 257 SkBitmap fBitmap; |
| 268 | 258 |
| 269 typedef SkBaseDevice INHERITED; | 259 typedef SkBaseDevice INHERITED; |
| 270 }; | 260 }; |
| 271 | 261 |
| 272 #endif // SkBitmapDevice_DEFINED | 262 #endif // SkBitmapDevice_DEFINED |
| OLD | NEW |