OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2008 The Android Open Source Project | 3 * Copyright 2008 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 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 | 576 |
577 /////////////////////////////////////////////////////////////////////////////// | 577 /////////////////////////////////////////////////////////////////////////////// |
578 | 578 |
579 void SkCanvas::flush() { | 579 void SkCanvas::flush() { |
580 SkBaseDevice* device = this->getDevice(); | 580 SkBaseDevice* device = this->getDevice(); |
581 if (device) { | 581 if (device) { |
582 device->flush(); | 582 device->flush(); |
583 } | 583 } |
584 } | 584 } |
585 | 585 |
586 SkISize SkCanvas::getTopLayerSize() const { | 586 SkISize SkCanvas::getDeviceSize() const { |
587 SkBaseDevice* d = this->getTopDevice(); | |
588 return d ? SkISize::Make(d->width(), d->height()) : SkISize::Make(0, 0); | |
589 } | |
590 | |
591 SkIPoint SkCanvas::getTopLayerOrigin() const { | |
592 SkBaseDevice* d = this->getTopDevice(); | |
593 return d ? d->getOrigin() : SkIPoint::Make(0, 0); | |
594 } | |
595 | |
596 SkISize SkCanvas::getBaseLayerSize() const { | |
597 SkBaseDevice* d = this->getDevice(); | 587 SkBaseDevice* d = this->getDevice(); |
598 return d ? SkISize::Make(d->width(), d->height()) : SkISize::Make(0, 0); | 588 return d ? SkISize::Make(d->width(), d->height()) : SkISize::Make(0, 0); |
599 } | 589 } |
600 | 590 |
601 SkBaseDevice* SkCanvas::getDevice() const { | 591 SkBaseDevice* SkCanvas::getDevice() const { |
602 // return root device | 592 // return root device |
603 MCRec* rec = (MCRec*) fMCStack.front(); | 593 MCRec* rec = (MCRec*) fMCStack.front(); |
604 SkASSERT(rec && rec->fLayer); | 594 SkASSERT(rec && rec->fLayer); |
605 return rec->fLayer->fDevice; | 595 return rec->fLayer->fDevice; |
606 } | 596 } |
(...skipping 1691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2298 return *paint; | 2288 return *paint; |
2299 } | 2289 } |
2300 | 2290 |
2301 const SkRegion& SkCanvas::LayerIter::clip() const { return fImpl->getClip(); } | 2291 const SkRegion& SkCanvas::LayerIter::clip() const { return fImpl->getClip(); } |
2302 int SkCanvas::LayerIter::x() const { return fImpl->getX(); } | 2292 int SkCanvas::LayerIter::x() const { return fImpl->getX(); } |
2303 int SkCanvas::LayerIter::y() const { return fImpl->getY(); } | 2293 int SkCanvas::LayerIter::y() const { return fImpl->getY(); } |
2304 | 2294 |
2305 /////////////////////////////////////////////////////////////////////////////// | 2295 /////////////////////////////////////////////////////////////////////////////// |
2306 | 2296 |
2307 SkCanvas::ClipVisitor::~ClipVisitor() { } | 2297 SkCanvas::ClipVisitor::~ClipVisitor() { } |
OLD | NEW |