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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 return fLeakyProperties; | 78 return fLeakyProperties; |
79 } | 79 } |
80 | 80 |
81 /** | 81 /** |
82 * Return the bounds of the device in the coordinate space of the root | 82 * Return the bounds of the device in the coordinate space of the root |
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 pixels 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 /** DEPRECATED - Return the bitmap config of the device's pixels |
94 */ | 94 */ |
95 virtual SkBitmap::Config config() const = 0; | 95 virtual SkBitmap::Config config() const = 0; |
96 | 96 |
97 /** Return the bitmap associated with this device. Call this each time you n
eed | 97 /** 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 | 98 to access the bitmap, as it notifies the subclass to perform any flushin
g |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
325 * Implements readPixels API. The caller will ensure that: | 325 * Implements readPixels API. The caller will ensure that: |
326 * 1. bitmap has pixel config kARGB_8888_Config. | 326 * 1. bitmap has pixel config kARGB_8888_Config. |
327 * 2. bitmap has pixels. | 327 * 2. bitmap has pixels. |
328 * 3. The rectangle (x, y, x + bitmap->width(), y + bitmap->height()) is | 328 * 3. The rectangle (x, y, x + bitmap->width(), y + bitmap->height()) is |
329 * contained in the device bounds. | 329 * contained in the device bounds. |
330 */ | 330 */ |
331 virtual bool onReadPixels(const SkBitmap& bitmap, | 331 virtual bool onReadPixels(const SkBitmap& bitmap, |
332 int x, int y, | 332 int x, int y, |
333 SkCanvas::Config8888 config8888) = 0; | 333 SkCanvas::Config8888 config8888) = 0; |
334 | 334 |
335 /** Called when this device is installed into a Canvas. Balanaced by a call | 335 /** Called when this device is installed into a Canvas. Balanced by a call |
336 to unlockPixels() when the device is removed from a Canvas. | 336 to unlockPixels() when the device is removed from a Canvas. |
337 */ | 337 */ |
338 virtual void lockPixels() = 0; | 338 virtual void lockPixels() = 0; |
339 virtual void unlockPixels() = 0; | 339 virtual void unlockPixels() = 0; |
340 | 340 |
341 /** | 341 /** |
342 * Returns true if the device allows processing of this imagefilter. If | 342 * Returns true if the device allows processing of this imagefilter. If |
343 * false is returned, then the filter is ignored. This may happen for | 343 * false is returned, then the filter is ignored. This may happen for |
344 * some subclasses that do not support pixel manipulations after drawing | 344 * some subclasses that do not support pixel manipulations after drawing |
345 * has occurred (e.g. printing). The default implementation returns true. | 345 * has occurred (e.g. printing). The default implementation returns true. |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 SkDeviceProperties fLeakyProperties; | 414 SkDeviceProperties fLeakyProperties; |
415 | 415 |
416 #ifdef SK_DEBUG | 416 #ifdef SK_DEBUG |
417 bool fAttachedToCanvas; | 417 bool fAttachedToCanvas; |
418 #endif | 418 #endif |
419 | 419 |
420 typedef SkRefCnt INHERITED; | 420 typedef SkRefCnt INHERITED; |
421 }; | 421 }; |
422 | 422 |
423 #endif | 423 #endif |
OLD | NEW |