| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2010 The Android Open Source Project | 3 * Copyright 2010 The Android Open Source Project |
| 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 | 9 |
| 10 #ifndef SkDevice_DEFINED | 10 #ifndef SkDevice_DEFINED |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 * Currently if bitmap is backed by a texture this is a no-op. This may be | 127 * Currently if bitmap is backed by a texture this is a no-op. This may be |
| 128 * relaxed in the future. | 128 * relaxed in the future. |
| 129 * | 129 * |
| 130 * If the bitmap has config kARGB_8888_Config then the config8888 param | 130 * If the bitmap has config kARGB_8888_Config then the config8888 param |
| 131 * will determines how the pixel valuess are intepreted. If the bitmap is | 131 * will determines how the pixel valuess are intepreted. If the bitmap is |
| 132 * not kARGB_8888_Config then this parameter is ignored. | 132 * not kARGB_8888_Config then this parameter is ignored. |
| 133 */ | 133 */ |
| 134 virtual void writePixels(const SkBitmap& bitmap, int x, int y, | 134 virtual void writePixels(const SkBitmap& bitmap, int x, int y, |
| 135 SkCanvas::Config8888 config8888 = SkCanvas::kNative
_Premul_Config8888) = 0; | 135 SkCanvas::Config8888 config8888 = SkCanvas::kNative
_Premul_Config8888) = 0; |
| 136 | 136 |
| 137 bool writePixelsDirect(const SkImageInfo&, const void*, size_t rowBytes, int
x, int y); |
| 138 |
| 137 /** | 139 /** |
| 138 * Return the device's associated gpu render target, or NULL. | 140 * Return the device's associated gpu render target, or NULL. |
| 139 */ | 141 */ |
| 140 virtual GrRenderTarget* accessRenderTarget() = 0; | 142 virtual GrRenderTarget* accessRenderTarget() = 0; |
| 141 | 143 |
| 142 | 144 |
| 143 /** | 145 /** |
| 144 * Return the device's origin: its offset in device coordinates from | 146 * Return the device's origin: its offset in device coordinates from |
| 145 * the default origin in its canvas' matrix/clip | 147 * the default origin in its canvas' matrix/clip |
| 146 */ | 148 */ |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 // either is identical to kNative_Premul_Config8888. Otherwise, -1. | 382 // either is identical to kNative_Premul_Config8888. Otherwise, -1. |
| 381 static const SkCanvas::Config8888 kPMColorAlias; | 383 static const SkCanvas::Config8888 kPMColorAlias; |
| 382 | 384 |
| 383 protected: | 385 protected: |
| 384 // default impl returns NULL | 386 // default impl returns NULL |
| 385 virtual SkSurface* newSurface(const SkImageInfo&); | 387 virtual SkSurface* newSurface(const SkImageInfo&); |
| 386 | 388 |
| 387 // default impl returns NULL | 389 // default impl returns NULL |
| 388 virtual const void* peekPixels(SkImageInfo*, size_t* rowBytes); | 390 virtual const void* peekPixels(SkImageInfo*, size_t* rowBytes); |
| 389 | 391 |
| 392 virtual bool onWritePixelsDirect(const SkImageInfo&, const void*, size_t, in
t x, int y); |
| 393 |
| 390 /** | 394 /** |
| 391 * Leaky properties are those which the device should be applying but it is
n't. | 395 * Leaky properties are those which the device should be applying but it is
n't. |
| 392 * These properties will be applied by the draw, when and as it can. | 396 * These properties will be applied by the draw, when and as it can. |
| 393 * If the device does handle a property, that property should be set to the
identity value | 397 * If the device does handle a property, that property should be set to the
identity value |
| 394 * for that property, effectively making it non-leaky. | 398 * for that property, effectively making it non-leaky. |
| 395 */ | 399 */ |
| 396 SkDeviceProperties fLeakyProperties; | 400 SkDeviceProperties fLeakyProperties; |
| 397 | 401 |
| 398 private: | 402 private: |
| 399 friend class SkCanvas; | 403 friend class SkCanvas; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 SkMetaData* fMetaData; | 445 SkMetaData* fMetaData; |
| 442 | 446 |
| 443 #ifdef SK_DEBUG | 447 #ifdef SK_DEBUG |
| 444 bool fAttachedToCanvas; | 448 bool fAttachedToCanvas; |
| 445 #endif | 449 #endif |
| 446 | 450 |
| 447 typedef SkRefCnt INHERITED; | 451 typedef SkRefCnt INHERITED; |
| 448 }; | 452 }; |
| 449 | 453 |
| 450 #endif | 454 #endif |
| OLD | NEW |