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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 return pr; | 188 return pr; |
189 } | 189 } |
190 | 190 |
191 /** | 191 /** |
192 * Implements readPixels API. The caller will ensure that: | 192 * Implements readPixels API. The caller will ensure that: |
193 * 1. bitmap has pixel config kARGB_8888_Config. | 193 * 1. bitmap has pixel config kARGB_8888_Config. |
194 * 2. bitmap has pixels. | 194 * 2. bitmap has pixels. |
195 * 3. The rectangle (x, y, x + bitmap->width(), y + bitmap->height()) is | 195 * 3. The rectangle (x, y, x + bitmap->width(), y + bitmap->height()) is |
196 * contained in the device bounds. | 196 * contained in the device bounds. |
197 */ | 197 */ |
| 198 #ifdef SK_SUPPORT_LEGACY_READPIXELSCONFIG |
198 virtual bool onReadPixels(const SkBitmap&, int x, int y, SkCanvas::Config888
8) SK_OVERRIDE; | 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; |
199 virtual bool onWritePixels(const SkImageInfo&, const void*, size_t, int, int
) SK_OVERRIDE; | 202 virtual bool onWritePixels(const SkImageInfo&, const void*, size_t, int, int
) SK_OVERRIDE; |
200 virtual void* onAccessPixels(SkImageInfo* info, size_t* rowBytes) SK_OVERRID
E; | 203 virtual void* onAccessPixels(SkImageInfo* info, size_t* rowBytes) SK_OVERRID
E; |
201 | 204 |
202 /** Called when this device is installed into a Canvas. Balanced by a call | 205 /** Called when this device is installed into a Canvas. Balanced by a call |
203 to unlockPixels() when the device is removed from a Canvas. | 206 to unlockPixels() when the device is removed from a Canvas. |
204 */ | 207 */ |
205 virtual void lockPixels() SK_OVERRIDE; | 208 virtual void lockPixels() SK_OVERRIDE; |
206 virtual void unlockPixels() SK_OVERRIDE; | 209 virtual void unlockPixels() SK_OVERRIDE; |
207 | 210 |
208 /** | 211 /** |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 | 263 |
261 virtual SkSurface* newSurface(const SkImageInfo&) SK_OVERRIDE; | 264 virtual SkSurface* newSurface(const SkImageInfo&) SK_OVERRIDE; |
262 virtual const void* peekPixels(SkImageInfo*, size_t* rowBytes) SK_OVERRIDE; | 265 virtual const void* peekPixels(SkImageInfo*, size_t* rowBytes) SK_OVERRIDE; |
263 | 266 |
264 SkBitmap fBitmap; | 267 SkBitmap fBitmap; |
265 | 268 |
266 typedef SkBaseDevice INHERITED; | 269 typedef SkBaseDevice INHERITED; |
267 }; | 270 }; |
268 | 271 |
269 #endif // SkBitmapDevice_DEFINED | 272 #endif // SkBitmapDevice_DEFINED |
OLD | NEW |