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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 virtual const SkDeviceProperties& getDeviceProperties() const { | 76 virtual const SkDeviceProperties& getDeviceProperties() const { |
77 //Currently, all the properties are leaky. | 77 //Currently, all the properties are leaky. |
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 void getGlobalBounds(SkIRect* bounds) const { |
| 87 SkASSERT(bounds); |
| 88 const SkIPoint& origin = this->getOrigin(); |
| 89 bounds->setXYWH(origin.x(), origin.y(), this->width(), this->height()); |
| 90 } |
| 91 |
87 | 92 |
88 /** Returns true if the device's bitmap's config treats every pixel as | 93 /** Returns true if the device's bitmap's config treats every pixel as |
89 implicitly opaque. | 94 implicitly opaque. |
90 */ | 95 */ |
91 virtual bool isOpaque() const = 0; | 96 virtual bool isOpaque() const = 0; |
92 | 97 |
93 /** Return the bitmap config of the device's pixels | 98 /** Return the bitmap config of the device's pixels |
94 */ | 99 */ |
95 SK_ATTR_DEPRECATED("want to hide configness of the device -- don't use") | 100 SK_ATTR_DEPRECATED("want to hide configness of the device -- don't use") |
96 virtual SkBitmap::Config config() const = 0; | 101 virtual SkBitmap::Config config() const = 0; |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 SkDeviceProperties fLeakyProperties; | 420 SkDeviceProperties fLeakyProperties; |
416 | 421 |
417 #ifdef SK_DEBUG | 422 #ifdef SK_DEBUG |
418 bool fAttachedToCanvas; | 423 bool fAttachedToCanvas; |
419 #endif | 424 #endif |
420 | 425 |
421 typedef SkRefCnt INHERITED; | 426 typedef SkRefCnt INHERITED; |
422 }; | 427 }; |
423 | 428 |
424 #endif | 429 #endif |
OLD | NEW |