Chromium Code Reviews| 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 const SkIPoint& origin = this->getOrigin(); | |
| 88 bounds->setXYWH(origin.x(), origin.y(), this->width(), this->height()); | |
|
scroggo
2013/11/12 18:22:00
Check for NULL or assert?
reed1
2013/11/12 18:33:00
Done.
| |
| 89 } | |
| 90 | |
| 87 | 91 |
| 88 /** Returns true if the device's bitmap's config treats every pixel as | 92 /** Returns true if the device's bitmap's config treats every pixel as |
| 89 implicitly opaque. | 93 implicitly opaque. |
| 90 */ | 94 */ |
| 91 virtual bool isOpaque() const = 0; | 95 virtual bool isOpaque() const = 0; |
| 92 | 96 |
| 93 /** Return the bitmap config of the device's pixels | 97 /** Return the bitmap config of the device's pixels |
| 94 */ | 98 */ |
| 95 SK_ATTR_DEPRECATED("want to hide configness of the device -- don't use") | 99 SK_ATTR_DEPRECATED("want to hide configness of the device -- don't use") |
| 96 virtual SkBitmap::Config config() const = 0; | 100 virtual SkBitmap::Config config() const = 0; |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 415 SkDeviceProperties fLeakyProperties; | 419 SkDeviceProperties fLeakyProperties; |
| 416 | 420 |
| 417 #ifdef SK_DEBUG | 421 #ifdef SK_DEBUG |
| 418 bool fAttachedToCanvas; | 422 bool fAttachedToCanvas; |
| 419 #endif | 423 #endif |
| 420 | 424 |
| 421 typedef SkRefCnt INHERITED; | 425 typedef SkRefCnt INHERITED; |
| 422 }; | 426 }; |
| 423 | 427 |
| 424 #endif | 428 #endif |
| OLD | NEW |