From a59df04b68f3195c23e79ffe731bc5be2a6049f8 Mon Sep 17 00:00:00 2001 From: "epoger@google.com" Date: Wed, 2 Jan 2013 18:32:53 +0000 Subject: [PATCH] Delete no-longer compiled SkRectShape.cpp (This should have been removed in https://code.google.com/p/skia/source/detail?r=5033 ) Review URL: https://codereview.appspot.com/7035052 git-svn-id: http://skia.googlecode.com/svn/trunk@6969 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/effects/SkRectShape.cpp | 87 ------------------------------------- 1 file changed, 87 deletions(-) delete mode 100644 src/effects/SkRectShape.cpp diff --git a/src/effects/SkRectShape.cpp b/src/effects/SkRectShape.cpp deleted file mode 100644 index 52c3b372cd..0000000000 --- a/src/effects/SkRectShape.cpp +++ /dev/null @@ -1,87 +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 "SkRectShape.h" -#include "SkCanvas.h" -#include "SkFlattenableBuffers.h" - -SkPaintShape::SkPaintShape() { - fPaint.setAntiAlias(true); -} - -SkRectShape::SkRectShape() { - fBounds.setEmpty(); - fRadii.set(0, 0); -} - -void SkRectShape::setRect(const SkRect& bounds) { - fBounds = bounds; - fRadii.set(0, 0); -} - -void SkRectShape::setOval(const SkRect& bounds) { - fBounds = bounds; - fRadii.set(-SK_Scalar1, -SK_Scalar1); -} - -void SkRectShape::setCircle(SkScalar cx, SkScalar cy, SkScalar radius) { - fBounds.set(cx - radius, cy - radius, cx + radius, cy + radius); - fRadii.set(-SK_Scalar1, -SK_Scalar1); -} - -void SkRectShape::setRRect(const SkRect& bounds, SkScalar rx, SkScalar ry) { - if (rx < 0) { - rx = 0; - } - if (ry < 0) { - ry = 0; - } - - fBounds = bounds; - fRadii.set(rx, ry); -} - -/////////////////////////////////////////////////////////////////////////////// - -void SkRectShape::onDraw(SkCanvas* canvas) { - const SkPaint& paint = this->paint(); - - if (fRadii.fWidth < 0) { - canvas->drawOval(fBounds, paint); - } else if (fRadii.isZero()) { - canvas->drawRect(fBounds, paint); - } else { - canvas->drawRoundRect(fBounds, fRadii.fWidth, fRadii.fHeight, paint); - } -} - -void SkRectShape::flatten(SkFlattenableWriteBuffer& buffer) const { - this->INHERITED::flatten(buffer); - - buffer.writeRect(fBounds); - buffer.writeScalar(fRadii.fWidth); - buffer.writeScalar(fRadii.fHeight); -} - -SkRectShape::SkRectShape(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) { - buffer.readRect(&fBounds); - fRadii.fWidth = buffer.readScalar(); - fRadii.fHeight = buffer.readScalar(); -} - -/////////////////////////////////////////////////////////////////////////////// - -void SkPaintShape::flatten(SkFlattenableWriteBuffer& buffer) const { - this->INHERITED::flatten(buffer); - buffer.writePaint(fPaint); -} - -SkPaintShape::SkPaintShape(SkFlattenableReadBuffer& buffer) : INHERITED(buffer) { - buffer.readPaint(&fPaint); -}