diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkCanvas.cpp | 8 | ||||
-rw-r--r-- | src/core/SkDeque.cpp | 42 |
2 files changed, 25 insertions, 25 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index b05d424cf9..046c69298a 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -477,16 +477,16 @@ SkDrawFilter* SkCanvas::setDrawFilter(SkDrawFilter* filter) { SkDevice* SkCanvas::getDevice() const { // return root device - SkDeque::Iter iter(fMCStack); - MCRec* rec = (MCRec*)iter.next(); + SkDeque::F2BIter iter(fMCStack); + MCRec* rec = (MCRec*)iter.next(); SkASSERT(rec && rec->fLayer); return rec->fLayer->fDevice; } SkDevice* SkCanvas::setDevice(SkDevice* device) { // return root device - SkDeque::Iter iter(fMCStack); - MCRec* rec = (MCRec*)iter.next(); + SkDeque::F2BIter iter(fMCStack); + MCRec* rec = (MCRec*)iter.next(); SkASSERT(rec && rec->fLayer); SkDevice* rootDevice = rec->fLayer->fDevice; diff --git a/src/core/SkDeque.cpp b/src/core/SkDeque.cpp index 4f15051012..2c6ce64fae 100644 --- a/src/core/SkDeque.cpp +++ b/src/core/SkDeque.cpp @@ -2,16 +2,16 @@ ** ** Copyright 2006, The Android Open Source Project ** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at ** -** http://www.apache.org/licenses/LICENSE-2.0 +** http://www.apache.org/licenses/LICENSE-2.0 ** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and ** limitations under the License. */ @@ -25,10 +25,10 @@ struct SkDeque::Head { char* fBegin; // start of used section in this chunk char* fEnd; // end of used section in this chunk char* fStop; // end of the allocated chunk - + char* start() { return (char*)(this + 1); } const char* start() const { return (const char*)(this + 1); } - + void init(size_t size) { fNext = fPrev = NULL; fBegin = fEnd = NULL; @@ -44,7 +44,7 @@ SkDeque::SkDeque(size_t elemSize) SkDeque::SkDeque(size_t elemSize, void* storage, size_t storageSize) : fElemSize(elemSize), fInitialStorage(storage), fCount(0) { SkASSERT(storageSize == 0 || storage != NULL); - + if (storageSize >= sizeof(Head) + elemSize) { fFront = (Head*)storage; fFront->init(storageSize); @@ -69,7 +69,7 @@ SkDeque::~SkDeque() { const void* SkDeque::front() const { Head* front = fFront; - + if (NULL == front) { return NULL; } @@ -108,7 +108,7 @@ void* SkDeque::push_front() { fFront->init(sizeof(Head) + INIT_ELEM_COUNT * fElemSize); fBack = fFront; // update our linklist } - + Head* first = fFront; char* begin; @@ -144,7 +144,7 @@ void* SkDeque::push_back() { fBack->init(sizeof(Head) + INIT_ELEM_COUNT * fElemSize); fFront = fBack; // update our linklist } - + Head* last = fBack; char* end; @@ -178,7 +178,7 @@ void SkDeque::pop_front() { Head* first = fFront; SkASSERT(first != NULL); - + if (first->fBegin == NULL) { // we were marked empty from before first = first->fNext; first->fPrev = NULL; @@ -202,9 +202,9 @@ void SkDeque::pop_back() { fCount -= 1; Head* last = fBack; - + SkASSERT(last != NULL); - + if (last->fEnd == NULL) { // we were marked empty from before last = last->fPrev; last->fNext = NULL; @@ -212,7 +212,7 @@ void SkDeque::pop_back() { fBack = last; SkASSERT(last != NULL); // else we popped too far } - + char* end = last->fEnd - fElemSize; SkASSERT(end >= last->fBegin); @@ -225,7 +225,7 @@ void SkDeque::pop_back() { /////////////////////////////////////////////////////////////////////////////// -SkDeque::Iter::Iter(const SkDeque& d) : fElemSize(d.fElemSize) { +SkDeque::F2BIter::F2BIter(const SkDeque& d) : fElemSize(d.fElemSize) { fHead = d.fFront; while (fHead != NULL && fHead->fBegin == NULL) { fHead = fHead->fNext; @@ -233,9 +233,9 @@ SkDeque::Iter::Iter(const SkDeque& d) : fElemSize(d.fElemSize) { fPos = fHead ? fHead->fBegin : NULL; } -void* SkDeque::Iter::next() { +void* SkDeque::F2BIter::next() { char* pos = fPos; - + if (pos) { // if we were valid, try to move to the next setting char* next = pos + fElemSize; SkASSERT(next <= fHead->fEnd); |