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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 implicitly opaque. | 77 implicitly opaque. |
78 */ | 78 */ |
79 virtual bool isOpaque() const SK_OVERRIDE { return fBitmap.isOpaque(); } | 79 virtual bool isOpaque() const SK_OVERRIDE { return fBitmap.isOpaque(); } |
80 | 80 |
81 /** Return the bitmap config of the device's pixels | 81 /** Return the bitmap config of the device's pixels |
82 */ | 82 */ |
83 virtual SkBitmap::Config config() const SK_OVERRIDE { return fBitmap.config(
); } | 83 virtual SkBitmap::Config config() const SK_OVERRIDE { return fBitmap.config(
); } |
84 | 84 |
85 virtual SkImageInfo imageInfo() const SK_OVERRIDE; | 85 virtual SkImageInfo imageInfo() const SK_OVERRIDE; |
86 | 86 |
87 #ifdef SK_SUPPORT_LEGACY_WRITEPIXELSCONFIG | |
88 /** | |
89 * DEPRECATED: This will be made protected once WebKit stops using it. | |
90 * Instead use Canvas' writePixels method. | |
91 * | |
92 * Similar to draw sprite, this method will copy the pixels in bitmap onto | |
93 * the device, with the top/left corner specified by (x, y). The pixel | |
94 * values in the device are completely replaced: there is no blending. | |
95 * | |
96 * Currently if bitmap is backed by a texture this is a no-op. This may be | |
97 * relaxed in the future. | |
98 * | |
99 * If the bitmap has config kARGB_8888_Config then the config8888 param | |
100 * will determines how the pixel valuess are intepreted. If the bitmap is | |
101 * not kARGB_8888_Config then this parameter is ignored. | |
102 */ | |
103 virtual void writePixels(const SkBitmap& bitmap, int x, int y, | |
104 SkCanvas::Config8888 config8888) SK_OVERRIDE; | |
105 #endif | |
106 /** | 87 /** |
107 * Return the device's associated gpu render target, or NULL. | 88 * Return the device's associated gpu render target, or NULL. |
108 */ | 89 */ |
109 virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE { return NULL; } | 90 virtual GrRenderTarget* accessRenderTarget() SK_OVERRIDE { return NULL; } |
110 | 91 |
111 protected: | 92 protected: |
112 /** | 93 /** |
113 * Device may filter the text flags for drawing text here. If it wants to | 94 * Device may filter the text flags for drawing text here. If it wants to |
114 * make a change to the specified values, it should write them into the | 95 * make a change to the specified values, it should write them into the |
115 * textflags parameter (output) and return true. If the paint is fine as | 96 * textflags parameter (output) and return true. If the paint is fine as |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 | 260 |
280 virtual SkSurface* newSurface(const SkImageInfo&) SK_OVERRIDE; | 261 virtual SkSurface* newSurface(const SkImageInfo&) SK_OVERRIDE; |
281 virtual const void* peekPixels(SkImageInfo*, size_t* rowBytes) SK_OVERRIDE; | 262 virtual const void* peekPixels(SkImageInfo*, size_t* rowBytes) SK_OVERRIDE; |
282 | 263 |
283 SkBitmap fBitmap; | 264 SkBitmap fBitmap; |
284 | 265 |
285 typedef SkBaseDevice INHERITED; | 266 typedef SkBaseDevice INHERITED; |
286 }; | 267 }; |
287 | 268 |
288 #endif // SkBitmapDevice_DEFINED | 269 #endif // SkBitmapDevice_DEFINED |
OLD | NEW |