aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/SkCanvas.cpp6
-rw-r--r--src/core/SkPictureFlat.h1
-rw-r--r--src/core/SkPicturePlayback.cpp45
-rw-r--r--src/core/SkPicturePlayback.h9
-rw-r--r--src/core/SkPictureRecord.cpp16
-rw-r--r--src/core/SkPictureRecord.h5
6 files changed, 1 insertions, 81 deletions
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index f8dd0288f1..7325c025ec 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -22,7 +22,6 @@
#include "SkDrawLooper.h"
#include "SkPicture.h"
#include "SkScalarCompare.h"
-#include "SkShape.h"
#include "SkTemplates.h"
#include "SkTLazy.h"
#include "SkUtils.h"
@@ -1646,11 +1645,6 @@ void SkCanvas::drawPicture(SkPicture& picture) {
restoreToCount(saveCount);
}
-void SkCanvas::drawShape(SkShape* shape) {
- // shape baseclass takes care of save/restore
- shape->draw(this);
-}
-
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
diff --git a/src/core/SkPictureFlat.h b/src/core/SkPictureFlat.h
index 697b399a6a..a11f5565d8 100644
--- a/src/core/SkPictureFlat.h
+++ b/src/core/SkPictureFlat.h
@@ -28,7 +28,6 @@ enum DrawType {
DRAW_POS_TEXT_H,
DRAW_POS_TEXT_H_TOP_BOTTOM, // fast variant of DRAW_POS_TEXT_H
DRAW_RECT,
- DRAW_SHAPE,
DRAW_SPRITE,
DRAW_TEXT,
DRAW_TEXT_ON_PATH,
diff --git a/src/core/SkPicturePlayback.cpp b/src/core/SkPicturePlayback.cpp
index 67b68655a8..05663e5fd7 100644
--- a/src/core/SkPicturePlayback.cpp
+++ b/src/core/SkPicturePlayback.cpp
@@ -120,17 +120,6 @@ SkPicturePlayback::SkPicturePlayback(const SkPictureRecord& record) {
}
}
- const SkTDArray<SkShape* >& shapes = record.getShapes();
- fShapeCount = shapes.count();
- if (fShapeCount > 0) {
- fShapes = SkNEW_ARRAY(SkShape*, fShapeCount);
- for (int i = 0; i < fShapeCount; i++) {
- SkShape* s = shapes[i];
- SkSafeRef(s);
- fShapes[i] = s;
- }
- }
-
const SkTDArray<const SkFlatRegion* >& regions = record.getRegions();
fRegionCount = regions.count();
if (fRegionCount > 0) {
@@ -203,14 +192,6 @@ SkPicturePlayback::SkPicturePlayback(const SkPicturePlayback& src) {
fPictureRefs[i]->ref();
}
- fShapeCount = src.fShapeCount;
- fShapes = SkNEW_ARRAY(SkShape*, fShapeCount);
- for (int i = 0; i < fShapeCount; i++) {
- SkShape* s = src.fShapes[i];
- SkSafeRef(s);
- fShapes[i] = s;
- }
-
fRegionCount = src.fRegionCount;
fRegions = SkNEW_ARRAY(SkRegion, fRegionCount);
for (i = 0; i < fRegionCount; i++) {
@@ -224,10 +205,9 @@ void SkPicturePlayback::init() {
fPaints = NULL;
fPathHeap = NULL;
fPictureRefs = NULL;
- fShapes = NULL;
fRegions = NULL;
fBitmapCount = fMatrixCount = fPaintCount = fPictureCount =
- fRegionCount = fShapeCount = 0;
+ fRegionCount = 0;
fFactoryPlayback = NULL;
}
@@ -247,11 +227,6 @@ SkPicturePlayback::~SkPicturePlayback() {
}
SkDELETE_ARRAY(fPictureRefs);
- for (int i = 0; i < fShapeCount; i++) {
- SkSafeUnref(fShapes[i]);
- }
- SkDELETE_ARRAY(fShapes);
-
SkDELETE(fFactoryPlayback);
}
@@ -281,7 +256,6 @@ void SkPicturePlayback::dumpSize() const {
#define PICT_PAINT_TAG SkSetFourByteTag('p', 'n', 't', ' ')
#define PICT_PATH_TAG SkSetFourByteTag('p', 't', 'h', ' ')
#define PICT_REGION_TAG SkSetFourByteTag('r', 'g', 'n', ' ')
-#define PICT_SHAPE_TAG SkSetFourByteTag('s', 'h', 'p', ' ')
#include "SkStream.h"
@@ -378,11 +352,6 @@ void SkPicturePlayback::serialize(SkWStream* stream) const {
buffer.writePad(storage.get(), size);
}
- writeTagSize(buffer, PICT_SHAPE_TAG, fShapeCount);
- for (i = 0; i < fShapeCount; i++) {
- buffer.writeFlattenable(fShapes[i]);
- }
-
// now we can write to the stream again
writeFactories(stream, factSet);
@@ -491,12 +460,6 @@ SkPicturePlayback::SkPicturePlayback(SkStream* stream) {
SkDEBUGCODE(uint32_t bytes =) fRegions[i].unflatten(buffer.skip(size));
SkASSERT(size == bytes);
}
-
- fShapeCount = readTagSize(buffer, PICT_SHAPE_TAG);
- fShapes = SkNEW_ARRAY(SkShape*, fShapeCount);
- for (i = 0; i < fShapeCount; i++) {
- fShapes[i] = reinterpret_cast<SkShape*>(buffer.readFlattenable());
- }
}
///////////////////////////////////////////////////////////////////////////////
@@ -651,12 +614,6 @@ void SkPicturePlayback::draw(SkCanvas& canvas) {
const SkPaint& paint = *getPaint();
canvas.drawRect(*fReader.skipRect(), paint);
} break;
- case DRAW_SHAPE: {
- SkShape* shape = getShape();
- if (shape) {
- canvas.drawShape(shape);
- }
- } break;
case DRAW_SPRITE: {
const SkPaint* paint = getPaint();
const SkBitmap& bitmap = getBitmap();
diff --git a/src/core/SkPicturePlayback.h b/src/core/SkPicturePlayback.h
index 350df78363..7eda16750a 100644
--- a/src/core/SkPicturePlayback.h
+++ b/src/core/SkPicturePlayback.h
@@ -11,7 +11,6 @@
#include "SkPathHeap.h"
#include "SkRegion.h"
#include "SkPictureFlat.h"
-#include "SkShape.h"
#ifdef ANDROID
#include "SkThread.h"
@@ -78,12 +77,6 @@ private:
return *fPictureRefs[index - 1];
}
- SkShape* getShape() {
- int index = getInt();
- SkASSERT(index > 0 && index <= fShapeCount);
- return fShapes[index - 1];
- }
-
const SkPaint* getPaint() {
int index = getInt();
if (index == 0) {
@@ -170,8 +163,6 @@ private:
SkPicture** fPictureRefs;
int fPictureCount;
- SkShape** fShapes;
- int fShapeCount;
SkRefCntPlayback fRCPlayback;
SkTypefacePlayback fTFPlayback;
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp
index 6b2b330c55..9339efca38 100644
--- a/src/core/SkPictureRecord.cpp
+++ b/src/core/SkPictureRecord.cpp
@@ -1,5 +1,4 @@
#include "SkPictureRecord.h"
-#include "SkShape.h"
#include "SkTSearch.h"
#define MIN_WRITER_SIZE 16384
@@ -368,20 +367,6 @@ void SkPictureRecord::drawPicture(SkPicture& picture) {
validate();
}
-void SkPictureRecord::drawShape(SkShape* shape) {
- addDraw(DRAW_SHAPE);
-
- int index = fShapes.find(shape);
- if (index < 0) { // not found
- index = fShapes.count();
- *fShapes.append() = shape;
- shape->ref();
- }
- // follow the convention of recording a 1-based index
- addInt(index + 1);
- validate();
-}
-
void SkPictureRecord::drawVertices(VertexMode vmode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode*,
@@ -433,7 +418,6 @@ void SkPictureRecord::reset() {
fPaints.reset();
fPictureRefs.unrefAll();
fRegions.reset();
- fShapes.safeUnrefAll();
fWriter.reset();
fHeap.reset();
diff --git a/src/core/SkPictureRecord.h b/src/core/SkPictureRecord.h
index e0d6a508ae..9c86cf90d9 100644
--- a/src/core/SkPictureRecord.h
+++ b/src/core/SkPictureRecord.h
@@ -51,7 +51,6 @@ public:
const SkPath& path, const SkMatrix* matrix,
const SkPaint&);
virtual void drawPicture(SkPicture& picture);
- virtual void drawShape(SkShape*);
virtual void drawVertices(VertexMode, int vertexCount,
const SkPoint vertices[], const SkPoint texs[],
const SkColor colors[], SkXfermode*,
@@ -73,9 +72,6 @@ public:
const SkTDArray<SkPicture* >& getPictureRefs() const {
return fPictureRefs;
}
- const SkTDArray<SkShape* >& getShapes() const {
- return fShapes;
- }
const SkTDArray<const SkFlatRegion* >& getRegions() const {
return fRegions;
}
@@ -173,7 +169,6 @@ private:
// we ref each item in these arrays
SkTDArray<SkPicture*> fPictureRefs;
- SkTDArray<SkShape*> fShapes;
SkRefCntSet fRCSet;
SkRefCntSet fTFSet;