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 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 | 494 |
495 fMCRec = (MCRec*)fMCStack.push_back(); | 495 fMCRec = (MCRec*)fMCStack.push_back(); |
496 new (fMCRec) MCRec(NULL, 0); | 496 new (fMCRec) MCRec(NULL, 0); |
497 | 497 |
498 fMCRec->fLayer = SkNEW_ARGS(DeviceCM, (NULL, 0, 0, NULL, NULL)); | 498 fMCRec->fLayer = SkNEW_ARGS(DeviceCM, (NULL, 0, 0, NULL, NULL)); |
499 fMCRec->fTopLayer = fMCRec->fLayer; | 499 fMCRec->fTopLayer = fMCRec->fLayer; |
500 fMCRec->fNext = NULL; | 500 fMCRec->fNext = NULL; |
501 | 501 |
502 fSurfaceBase = NULL; | 502 fSurfaceBase = NULL; |
503 | 503 |
504 return this->setDevice(device); | 504 return this->setRootDevice(device); |
505 } | 505 } |
506 | 506 |
507 SkCanvas::SkCanvas() | 507 SkCanvas::SkCanvas() |
508 : fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage)) | 508 : fMCStack(sizeof(MCRec), fMCRecStorage, sizeof(fMCRecStorage)) |
509 { | 509 { |
510 inc_canvas(); | 510 inc_canvas(); |
511 | 511 |
512 this->init(NULL); | 512 this->init(NULL); |
513 } | 513 } |
514 | 514 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 return rec->fLayer->fDevice; | 595 return rec->fLayer->fDevice; |
596 } | 596 } |
597 | 597 |
598 SkBaseDevice* SkCanvas::getTopDevice(bool updateMatrixClip) const { | 598 SkBaseDevice* SkCanvas::getTopDevice(bool updateMatrixClip) const { |
599 if (updateMatrixClip) { | 599 if (updateMatrixClip) { |
600 const_cast<SkCanvas*>(this)->updateDeviceCMCache(); | 600 const_cast<SkCanvas*>(this)->updateDeviceCMCache(); |
601 } | 601 } |
602 return fMCRec->fTopLayer->fDevice; | 602 return fMCRec->fTopLayer->fDevice; |
603 } | 603 } |
604 | 604 |
605 SkBaseDevice* SkCanvas::setDevice(SkBaseDevice* device) { | 605 SkBaseDevice* SkCanvas::setRootDevice(SkBaseDevice* device) { |
606 // return root device | 606 // return root device |
607 SkDeque::F2BIter iter(fMCStack); | 607 SkDeque::F2BIter iter(fMCStack); |
608 MCRec* rec = (MCRec*)iter.next(); | 608 MCRec* rec = (MCRec*)iter.next(); |
609 SkASSERT(rec && rec->fLayer); | 609 SkASSERT(rec && rec->fLayer); |
610 SkBaseDevice* rootDevice = rec->fLayer->fDevice; | 610 SkBaseDevice* rootDevice = rec->fLayer->fDevice; |
611 | 611 |
612 if (rootDevice == device) { | 612 if (rootDevice == device) { |
613 return device; | 613 return device; |
614 } | 614 } |
615 | 615 |
(...skipping 1611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2227 return *paint; | 2227 return *paint; |
2228 } | 2228 } |
2229 | 2229 |
2230 const SkRegion& SkCanvas::LayerIter::clip() const { return fImpl->getClip(); } | 2230 const SkRegion& SkCanvas::LayerIter::clip() const { return fImpl->getClip(); } |
2231 int SkCanvas::LayerIter::x() const { return fImpl->getX(); } | 2231 int SkCanvas::LayerIter::x() const { return fImpl->getX(); } |
2232 int SkCanvas::LayerIter::y() const { return fImpl->getY(); } | 2232 int SkCanvas::LayerIter::y() const { return fImpl->getY(); } |
2233 | 2233 |
2234 /////////////////////////////////////////////////////////////////////////////// | 2234 /////////////////////////////////////////////////////////////////////////////// |
2235 | 2235 |
2236 SkCanvas::ClipVisitor::~ClipVisitor() { } | 2236 SkCanvas::ClipVisitor::~ClipVisitor() { } |
OLD | NEW |