| 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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 * canvas. The root device will have its top-left at 0,0, but other devices | 83 * canvas. The root device will have its top-left at 0,0, but other devices |
| 84 * such as those associated with saveLayer may have a non-zero origin. | 84 * such as those associated with saveLayer may have a non-zero origin. |
| 85 */ | 85 */ |
| 86 virtual void getGlobalBounds(SkIRect* bounds) const = 0; | 86 virtual void getGlobalBounds(SkIRect* bounds) const = 0; |
| 87 | 87 |
| 88 /** Returns true if the device's bitmap's config treats every pixel as | 88 /** Returns true if the device's bitmap's config treats every pixel as |
| 89 implicitly opaque. | 89 implicitly opaque. |
| 90 */ | 90 */ |
| 91 virtual bool isOpaque() const = 0; | 91 virtual bool isOpaque() const = 0; |
| 92 | 92 |
| 93 /** DEPRECATED - Return the bitmap config of the device's pixels | 93 /** Return the bitmap config of the device's pixels |
| 94 */ | 94 */ |
| 95 SK_ATTR_DEPRECATED("want to hide configness of the device -- don't use") |
| 95 virtual SkBitmap::Config config() const = 0; | 96 virtual SkBitmap::Config config() const = 0; |
| 96 | 97 |
| 97 /** Return the bitmap associated with this device. Call this each time you n
eed | 98 /** Return the bitmap associated with this device. Call this each time you n
eed |
| 98 to access the bitmap, as it notifies the subclass to perform any flushin
g | 99 to access the bitmap, as it notifies the subclass to perform any flushin
g |
| 99 etc. before you examine the pixels. | 100 etc. before you examine the pixels. |
| 100 @param changePixels set to true if the caller plans to change the pixels | 101 @param changePixels set to true if the caller plans to change the pixels |
| 101 @return the device's bitmap | 102 @return the device's bitmap |
| 102 */ | 103 */ |
| 103 const SkBitmap& accessBitmap(bool changePixels); | 104 const SkBitmap& accessBitmap(bool changePixels); |
| 104 | 105 |
| 105 /** | 106 /** |
| 106 * DEPRECATED: This will be made protected once WebKit stops using it. | 107 * DEPRECATED: This will be made protected once WebKit stops using it. |
| 107 * Instead use Canvas' writePixels method. | 108 * Instead use Canvas' writePixels method. |
| 108 * | 109 * |
| 109 * Similar to draw sprite, this method will copy the pixels in bitmap onto | 110 * Similar to draw sprite, this method will copy the pixels in bitmap onto |
| 110 * the device, with the top/left corner specified by (x, y). The pixel | 111 * the device, with the top/left corner specified by (x, y). The pixel |
| 111 * values in the device are completely replaced: there is no blending. | 112 * values in the device are completely replaced: there is no blending. |
| 112 * | 113 * |
| 113 * Currently if bitmap is backed by a texture this is a no-op. This may be | 114 * Currently if bitmap is backed by a texture this is a no-op. This may be |
| 114 * relaxed in the future. | 115 * relaxed in the future. |
| 115 * | 116 * |
| 116 * If the bitmap has config kARGB_8888_Config then the config8888 param | 117 * If the bitmap has config kARGB_8888_Config then the config8888 param |
| 117 * will determines how the pixel valuess are intepreted. If the bitmap is | 118 * will determines how the pixel valuess are intepreted. If the bitmap is |
| 118 * not kARGB_8888_Config then this parameter is ignored. | 119 * not kARGB_8888_Config then this parameter is ignored. |
| 119 */ | 120 */ |
| 121 SK_ATTR_DEPRECATED("use SkCanvas version of same call") |
| 120 virtual void writePixels(const SkBitmap& bitmap, int x, int y, | 122 virtual void writePixels(const SkBitmap& bitmap, int x, int y, |
| 121 SkCanvas::Config8888 config8888 = SkCanvas::kNative
_Premul_Config8888) = 0; | 123 SkCanvas::Config8888 config8888 = SkCanvas::kNative
_Premul_Config8888) = 0; |
| 122 | 124 |
| 123 /** | 125 /** |
| 124 * Return the device's associated gpu render target, or NULL. | 126 * Return the device's associated gpu render target, or NULL. |
| 125 */ | 127 */ |
| 126 virtual GrRenderTarget* accessRenderTarget() = 0; | 128 virtual GrRenderTarget* accessRenderTarget() = 0; |
| 127 | 129 |
| 128 | 130 |
| 129 /** | 131 /** |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 SkDeviceProperties fLeakyProperties; | 416 SkDeviceProperties fLeakyProperties; |
| 415 | 417 |
| 416 #ifdef SK_DEBUG | 418 #ifdef SK_DEBUG |
| 417 bool fAttachedToCanvas; | 419 bool fAttachedToCanvas; |
| 418 #endif | 420 #endif |
| 419 | 421 |
| 420 typedef SkRefCnt INHERITED; | 422 typedef SkRefCnt INHERITED; |
| 421 }; | 423 }; |
| 422 | 424 |
| 423 #endif | 425 #endif |
| OLD | NEW |