diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkShape.cpp | 59 |
1 files changed, 1 insertions, 58 deletions
diff --git a/src/core/SkShape.cpp b/src/core/SkShape.cpp index a6d19af96b..e5fa8ff487 100644 --- a/src/core/SkShape.cpp +++ b/src/core/SkShape.cpp @@ -2,46 +2,8 @@ #include "SkShape.h" #include "SkMatrix.h" -SkShape::~SkShape() { - if (fMatrix) { - SkDELETE(fMatrix); - } -} - -void SkShape::getMatrix(SkMatrix* matrix) const { - if (matrix) { - if (fMatrix) { - *matrix = *fMatrix; - } else { - matrix->reset(); - } - } -} - -void SkShape::setMatrix(const SkMatrix& matrix) { - if (matrix.isIdentity()) { - this->resetMatrix(); - } else { - if (NULL == fMatrix) { - fMatrix = SkNEW(SkMatrix); - } - *fMatrix = matrix; - } -} - -void SkShape::resetMatrix() { - if (fMatrix) { - SkDELETE(fMatrix); - fMatrix = NULL; - } -} - void SkShape::draw(SkCanvas* canvas) { int saveCount = canvas->getSaveCount(); - if (fMatrix) { - canvas->save(SkCanvas::kMatrix_SaveFlag); - canvas->concat(*fMatrix); - } this->onDraw(canvas); canvas->restoreToCount(saveCount); } @@ -49,9 +11,6 @@ void SkShape::draw(SkCanvas* canvas) { void SkShape::drawXY(SkCanvas* canvas, SkScalar dx, SkScalar dy) { int saveCount = canvas->save(SkCanvas::kMatrix_SaveFlag); canvas->translate(dx, dy); - if (fMatrix) { - canvas->concat(*fMatrix); - } this->onDraw(canvas); canvas->restoreToCount(saveCount); } @@ -59,27 +18,11 @@ void SkShape::drawXY(SkCanvas* canvas, SkScalar dx, SkScalar dy) { void SkShape::drawMatrix(SkCanvas* canvas, const SkMatrix& matrix) { int saveCount = canvas->save(SkCanvas::kMatrix_SaveFlag); canvas->concat(matrix); - if (fMatrix) { - canvas->concat(*fMatrix); - } this->onDraw(canvas); canvas->restoreToCount(saveCount); } /////////////////////////////////////////////////////////////////////////////// -void SkShape::flatten(SkFlattenableWriteBuffer& buffer) { - buffer.writeBool(fMatrix != NULL); - if (fMatrix) { - *(SkMatrix*)buffer.reserve(sizeof(SkMatrix)) = *fMatrix; - } -} - -SkShape::SkShape(SkFlattenableReadBuffer& buffer) { - fMatrix = NULL; - if (buffer.readBool()) { - fMatrix = SkNEW(SkMatrix); - buffer.read(fMatrix, sizeof(*fMatrix)); - } -} +void SkShape::flatten(SkFlattenableWriteBuffer& buffer) {} |