diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-01-09 12:55:23 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-01-09 12:55:23 +0000 |
commit | 25634e08bb490ad7e9de709c52dfdf1ef1b854e6 (patch) | |
tree | 9421446c8ab06ec56c44c938be63ec85094fa08d /src/core | |
parent | c52b1927c2461b4f3b26bd4d5aa830e5e92d61a3 (diff) |
remove obsolete file
git-svn-id: http://skia.googlecode.com/svn/trunk@2986 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkDrawing.cpp | 159 |
1 files changed, 0 insertions, 159 deletions
diff --git a/src/core/SkDrawing.cpp b/src/core/SkDrawing.cpp deleted file mode 100644 index cdbfcbece7..0000000000 --- a/src/core/SkDrawing.cpp +++ /dev/null @@ -1,159 +0,0 @@ - -/* - * Copyright 2011 Google Inc. - * - * Use of this source code is governed by a BSD-style license that can be - * found in the LICENSE file. - */ -#include "SkDrawing.h" -#include "SkCanvas.h" - -SkDrawing::SkDrawing() { - fMatrix.reset(); - fParent = fFirstChild = fNextSibling = fPrevSibling = NULL; -} - -SkDrawing::~SkDrawing() { - this->detachAllChildren(); -} - -/////////////////////////////////////////////////////////////////////////////// - -void SkDrawing::resetMatrix() { - fMatrix.reset(); -} - -void SkDrawing::getMatrix(SkMatrix* matrix) const { - if (matrix) { - *matrix = fMatrix; - } -} - -void SkDrawing::setMatrix(const SkMatrix& matrix) { - if (fMatrix != matrix) { - this->inval(); - fMatrix = matrix; - this->inval(); - } -} - -void SkDrawing::draw(SkCanvas* canvas) { - SkAutoCanvasRestore ar(canvas, false); - canvas->save(SkCanvas::kMatrix_SaveFlag); - canvas->concat(fMatrix); - - this->onDraw(canvas); - - B2FIter iter(this); - SkDrawing* child; - while ((child = iter.next()) != NULL) { - child->draw(canvas); - } -} - -/////////////////////////////////////////////////////////////////////////////// - -void SkDrawing::detachFromParent() { - SkDrawing* parent = fParent; - - if (NULL == parent) { - return; - } - - this->inval(); - - SkDrawing* next = NULL; - - if (fNextSibling != this) { // do we have any siblings - fNextSibling->fPrevSibling = fPrevSibling; - fPrevSibling->fNextSibling = fNextSibling; - next = fNextSibling; - } - - if (fParent->fFirstChild == this) { - fParent->fFirstChild = next; - } - - fParent = fNextSibling = fPrevSibling = NULL; - this->unref(); -} - -SkDrawing* SkDrawing::attachChildToBack(SkDrawing* child) { - SkASSERT(child != this); - - if (child == NULL || fFirstChild == child) { - return child; - } - - child->ref(); - child->detachFromParent(); - - if (fFirstChild == NULL) { - child->fNextSibling = child; - child->fPrevSibling = child; - } else { - child->fNextSibling = fFirstChild; - child->fPrevSibling = fFirstChild->fPrevSibling; - fFirstChild->fPrevSibling->fNextSibling = child; - fFirstChild->fPrevSibling = child; - } - - fFirstChild = child; - child->fParent = this; - child->inval(); - return child; -} - -SkDrawing* SkDrawing::attachChildToFront(SkDrawing* child) { - SkASSERT(child != this); - - if (child == NULL || fFirstChild && fFirstChild->fPrevSibling == child) { - return child; - } - - child->ref(); - child->detachFromParent(); - - if (fFirstChild == NULL) { - fFirstChild = child; - child->fNextSibling = child; - child->fPrevSibling = child; - } else { - child->fNextSibling = fFirstChild; - child->fPrevSibling = fFirstChild->fPrevSibling; - fFirstChild->fPrevSibling->fNextSibling = child; - fFirstChild->fPrevSibling = child; - } - - child->fParent = this; - child->inval(); - return child; -} - -void SkDrawing::detachAllChildren() { - while (fFirstChild) { - fFirstChild->detachFromParent(); - } -} - -/////////////////////////////////////////////////////////////////////////////// - -SkDrawing::B2FIter::B2FIter(const SkDrawing* parent) { - fFirstChild = parent ? parent->fFirstChild : NULL; - fChild = fFirstChild; -} - -SkDrawing* SkDrawing::B2FIter::next() { - SkDrawing* curr = fChild; - - if (fChild) { - SkDrawing* next = fChild->fNextSibling; - if (next == fFirstChild) { - next = NULL; - } - fChild = next; - } - return curr; -} - - |