OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 The Android Open Source Project | 2 * Copyright 2010 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #ifndef SkDevice_DEFINED | 8 #ifndef SkDevice_DEFINED |
9 #define SkDevice_DEFINED | 9 #define SkDevice_DEFINED |
10 | 10 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 * Return the bounds of the device in the coordinate space of the root | 46 * Return the bounds of the device in the coordinate space of the root |
47 * canvas. The root device will have its top-left at 0,0, but other devices | 47 * canvas. The root device will have its top-left at 0,0, but other devices |
48 * such as those associated with saveLayer may have a non-zero origin. | 48 * such as those associated with saveLayer may have a non-zero origin. |
49 */ | 49 */ |
50 void getGlobalBounds(SkIRect* bounds) const { | 50 void getGlobalBounds(SkIRect* bounds) const { |
51 SkASSERT(bounds); | 51 SkASSERT(bounds); |
52 const SkIPoint& origin = this->getOrigin(); | 52 const SkIPoint& origin = this->getOrigin(); |
53 bounds->setXYWH(origin.x(), origin.y(), this->width(), this->height()); | 53 bounds->setXYWH(origin.x(), origin.y(), this->width(), this->height()); |
54 } | 54 } |
55 | 55 |
56 SkIRect getGlobalBounds() const { | |
57 SkIRect bounds; | |
58 this->getGlobalBounds(&bounds); | |
59 return bounds; | |
60 } | |
61 | |
62 int width() const { | 56 int width() const { |
63 return this->imageInfo().width(); | 57 return this->imageInfo().width(); |
64 } | 58 } |
65 | 59 |
66 int height() const { | 60 int height() const { |
67 return this->imageInfo().height(); | 61 return this->imageInfo().height(); |
68 } | 62 } |
69 | 63 |
70 bool isOpaque() const { | 64 bool isOpaque() const { |
71 return this->imageInfo().isOpaque(); | 65 return this->imageInfo().isOpaque(); |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 virtual void initForRootLayer(SkPixelGeometry geo); | 359 virtual void initForRootLayer(SkPixelGeometry geo); |
366 | 360 |
367 private: | 361 private: |
368 friend class SkCanvas; | 362 friend class SkCanvas; |
369 friend struct DeviceCM; //for setMatrixClip | 363 friend struct DeviceCM; //for setMatrixClip |
370 friend class SkDraw; | 364 friend class SkDraw; |
371 friend class SkDrawIter; | 365 friend class SkDrawIter; |
372 friend class SkDeviceFilteredPaint; | 366 friend class SkDeviceFilteredPaint; |
373 friend class SkDeviceImageFilterProxy; | 367 friend class SkDeviceImageFilterProxy; |
374 friend class SkDeferredDevice; // for newSurface | 368 friend class SkDeferredDevice; // for newSurface |
375 friend class SkNoPixelsBitmapDevice; | |
376 | 369 |
377 friend class SkSurface_Raster; | 370 friend class SkSurface_Raster; |
378 | 371 |
379 // used to change the backend's pixels (and possibly config/rowbytes) | 372 // used to change the backend's pixels (and possibly config/rowbytes) |
380 // but cannot change the width/height, so there should be no change to | 373 // but cannot change the width/height, so there should be no change to |
381 // any clip information. | 374 // any clip information. |
382 // TODO: move to SkBitmapDevice | 375 // TODO: move to SkBitmapDevice |
383 virtual void replaceBitmapBackendForRasterSurface(const SkBitmap&) {} | 376 virtual void replaceBitmapBackendForRasterSurface(const SkBitmap&) {} |
384 | 377 |
385 virtual bool forceConservativeRasterClip() const { return false; } | 378 virtual bool forceConservativeRasterClip() const { return false; } |
(...skipping 12 matching lines...) Expand all Loading... |
398 SkDeviceProperties* fLeakyProperties; // will always exist. | 391 SkDeviceProperties* fLeakyProperties; // will always exist. |
399 | 392 |
400 #ifdef SK_DEBUG | 393 #ifdef SK_DEBUG |
401 bool fAttachedToCanvas; | 394 bool fAttachedToCanvas; |
402 #endif | 395 #endif |
403 | 396 |
404 typedef SkRefCnt INHERITED; | 397 typedef SkRefCnt INHERITED; |
405 }; | 398 }; |
406 | 399 |
407 #endif | 400 #endif |
OLD | NEW |