add getTopLayer(), so clients don't have to use a LayerIter just to get
the top. (very common for chrome) git-svn-id: http://skia.googlecode.com/svn/trunk@1016 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
parent
11f0b51976
commit
9266fed56a
@ -99,6 +99,15 @@ public:
|
||||
*/
|
||||
SkDevice* setDevice(SkDevice* device);
|
||||
|
||||
/**
|
||||
* saveLayer() can create another device (which is later drawn onto
|
||||
* the previous device). getTopDevice() returns the top-most device current
|
||||
* installed. Note that this can change on other calls like save/restore,
|
||||
* so do not access this device after subsequent canvas calls.
|
||||
* The reference count of the device is not changed.
|
||||
*/
|
||||
SkDevice* getTopDevice() const;
|
||||
|
||||
/** May be overridden by subclasses. This returns a compatible device
|
||||
for this canvas, with the specified config/width/height. If the device
|
||||
is raster, the pixels will be allocated automatically.
|
||||
|
@ -472,6 +472,10 @@ SkDevice* SkCanvas::getDevice() const {
|
||||
return rec->fLayer->fDevice;
|
||||
}
|
||||
|
||||
SkDevice* SkCanvas::getTopDevice() const {
|
||||
return fMCRec->fTopLayer->fDevice;
|
||||
}
|
||||
|
||||
SkDevice* SkCanvas::setDevice(SkDevice* device) {
|
||||
// return root device
|
||||
SkDeque::F2BIter iter(fMCStack);
|
||||
|
Loading…
Reference in New Issue
Block a user