| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 virtual SkBitmap::Config config() const = 0; | 117 virtual SkBitmap::Config config() const = 0; |
| 118 | 118 |
| 119 /** Return the bitmap associated with this device. Call this each time you n
eed | 119 /** Return the bitmap associated with this device. Call this each time you n
eed |
| 120 to access the bitmap, as it notifies the subclass to perform any flushin
g | 120 to access the bitmap, as it notifies the subclass to perform any flushin
g |
| 121 etc. before you examine the pixels. | 121 etc. before you examine the pixels. |
| 122 @param changePixels set to true if the caller plans to change the pixels | 122 @param changePixels set to true if the caller plans to change the pixels |
| 123 @return the device's bitmap | 123 @return the device's bitmap |
| 124 */ | 124 */ |
| 125 const SkBitmap& accessBitmap(bool changePixels); | 125 const SkBitmap& accessBitmap(bool changePixels); |
| 126 | 126 |
| 127 #ifdef SK_SUPPORT_LEGACY_WRITEPIXELSCONFIG | 127 bool writePixels(const SkImageInfo&, const void*, size_t rowBytes, int x, in
t y); |
| 128 /** | |
| 129 * DEPRECATED: This will be made protected once WebKit stops using it. | |
| 130 * Instead use Canvas' writePixels method. | |
| 131 * | |
| 132 * Similar to draw sprite, this method will copy the pixels in bitmap onto | |
| 133 * the device, with the top/left corner specified by (x, y). The pixel | |
| 134 * values in the device are completely replaced: there is no blending. | |
| 135 * | |
| 136 * Currently if bitmap is backed by a texture this is a no-op. This may be | |
| 137 * relaxed in the future. | |
| 138 * | |
| 139 * If the bitmap has config kARGB_8888_Config then the config8888 param | |
| 140 * will determines how the pixel valuess are intepreted. If the bitmap is | |
| 141 * not kARGB_8888_Config then this parameter is ignored. | |
| 142 */ | |
| 143 virtual void writePixels(const SkBitmap& bitmap, int x, int y, | |
| 144 SkCanvas::Config8888 config8888 = SkCanvas::kNative
_Premul_Config8888); | |
| 145 #endif | |
| 146 | |
| 147 bool writePixelsDirect(const SkImageInfo&, const void*, size_t rowBytes, int
x, int y); | |
| 148 | 128 |
| 149 void* accessPixels(SkImageInfo* info, size_t* rowBytes); | 129 void* accessPixels(SkImageInfo* info, size_t* rowBytes); |
| 150 | 130 |
| 151 /** | 131 /** |
| 152 * Return the device's associated gpu render target, or NULL. | 132 * Return the device's associated gpu render target, or NULL. |
| 153 */ | 133 */ |
| 154 virtual GrRenderTarget* accessRenderTarget() = 0; | 134 virtual GrRenderTarget* accessRenderTarget() = 0; |
| 155 | 135 |
| 156 | 136 |
| 157 /** | 137 /** |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 SkMetaData* fMetaData; | 467 SkMetaData* fMetaData; |
| 488 | 468 |
| 489 #ifdef SK_DEBUG | 469 #ifdef SK_DEBUG |
| 490 bool fAttachedToCanvas; | 470 bool fAttachedToCanvas; |
| 491 #endif | 471 #endif |
| 492 | 472 |
| 493 typedef SkRefCnt INHERITED; | 473 typedef SkRefCnt INHERITED; |
| 494 }; | 474 }; |
| 495 | 475 |
| 496 #endif | 476 #endif |
| OLD | NEW |