| 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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 | 192 |
| 193 /** Update as needed the pixel value in the bitmap, so that the caller can | 193 /** Update as needed the pixel value in the bitmap, so that the caller can |
| 194 access the pixels directly. Note: only the pixels field should be | 194 access the pixels directly. Note: only the pixels field should be |
| 195 altered. The config/width/height/rowbytes must remain unchanged. | 195 altered. The config/width/height/rowbytes must remain unchanged. |
| 196 @return the device contents as a bitmap | 196 @return the device contents as a bitmap |
| 197 */ | 197 */ |
| 198 virtual const SkBitmap& onAccessBitmap() SK_OVERRIDE; | 198 virtual const SkBitmap& onAccessBitmap() SK_OVERRIDE; |
| 199 | 199 |
| 200 SkPixelRef* getPixelRef() const { return fBitmap.pixelRef(); } | 200 SkPixelRef* getPixelRef() const { return fBitmap.pixelRef(); } |
| 201 // just for subclasses, to assign a custom pixelref | 201 // just for subclasses, to assign a custom pixelref |
| 202 SkPixelRef* setPixelRef(SkPixelRef* pr, size_t offset) { | 202 SkPixelRef* setPixelRef(SkPixelRef* pr) { |
| 203 fBitmap.setPixelRef(pr, offset); | 203 fBitmap.setPixelRef(pr); |
| 204 return pr; | 204 return pr; |
| 205 } | 205 } |
| 206 | 206 |
| 207 /** | 207 /** |
| 208 * Implements readPixels API. The caller will ensure that: | 208 * Implements readPixels API. The caller will ensure that: |
| 209 * 1. bitmap has pixel config kARGB_8888_Config. | 209 * 1. bitmap has pixel config kARGB_8888_Config. |
| 210 * 2. bitmap has pixels. | 210 * 2. bitmap has pixels. |
| 211 * 3. The rectangle (x, y, x + bitmap->width(), y + bitmap->height()) is | 211 * 3. The rectangle (x, y, x + bitmap->width(), y + bitmap->height()) is |
| 212 * contained in the device bounds. | 212 * contained in the device bounds. |
| 213 */ | 213 */ |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 /** Causes any deferred drawing to the device to be completed. | 276 /** Causes any deferred drawing to the device to be completed. |
| 277 */ | 277 */ |
| 278 virtual void flush() SK_OVERRIDE {} | 278 virtual void flush() SK_OVERRIDE {} |
| 279 | 279 |
| 280 SkBitmap fBitmap; | 280 SkBitmap fBitmap; |
| 281 | 281 |
| 282 typedef SkBaseDevice INHERITED; | 282 typedef SkBaseDevice INHERITED; |
| 283 }; | 283 }; |
| 284 | 284 |
| 285 #endif // SkBitmapDevice_DEFINED | 285 #endif // SkBitmapDevice_DEFINED |
| OLD | NEW |