aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar reed <reed@chromium.org>2015-01-02 06:39:51 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-01-02 06:39:51 -0800
commitc4fda92f45b9649f233a5b8636618a6431aa59cb (patch)
tree18eab2beddd77308e51e6aba0fa152e883d7b1b0 /src
parent7c339ae1e362e9f02cdfb9b32007f143dec0bc0e (diff)
remove unused drawData
Diffstat (limited to 'src')
-rw-r--r--src/core/SkPicturePlayback.cpp3
-rw-r--r--src/core/SkPictureRecord.cpp9
-rw-r--r--src/core/SkPictureRecord.h1
-rw-r--r--src/core/SkRecordDraw.cpp2
-rw-r--r--src/core/SkRecorder.cpp3
-rw-r--r--src/core/SkRecorder.h1
-rw-r--r--src/core/SkRecords.h3
-rw-r--r--src/pipe/SkGPipePriv.h1
-rw-r--r--src/pipe/SkGPipeRead.cpp14
-rw-r--r--src/pipe/SkGPipeWrite.cpp18
-rw-r--r--src/utils/SkDumpCanvas.cpp6
-rw-r--r--src/utils/SkLuaCanvas.cpp4
-rw-r--r--src/utils/SkNWayCanvas.cpp7
-rw-r--r--src/utils/SkProxyCanvas.cpp4
-rw-r--r--src/utils/debugger/SkDebugCanvas.cpp4
-rw-r--r--src/utils/debugger/SkDebugCanvas.h2
-rw-r--r--src/utils/debugger/SkDrawCommand.cpp16
-rw-r--r--src/utils/debugger/SkDrawCommand.h12
18 files changed, 2 insertions, 108 deletions
diff --git a/src/core/SkPicturePlayback.cpp b/src/core/SkPicturePlayback.cpp
index 1c9b13e445..94d5190c5e 100644
--- a/src/core/SkPicturePlayback.cpp
+++ b/src/core/SkPicturePlayback.cpp
@@ -192,8 +192,9 @@ void SkPicturePlayback::handleOp(SkReader32* reader,
canvas->clear(reader->readInt());
break;
case DRAW_DATA: {
+ // This opcode is now dead, just need to skip it for backwards compatibility
size_t length = reader->readInt();
- canvas->drawData(reader->skip(length), length);
+ (void)reader->skip(length);
// skip handles padding the read out to a multiple of 4
} break;
case DRAW_DRRECT: {
diff --git a/src/core/SkPictureRecord.cpp b/src/core/SkPictureRecord.cpp
index 6448d1eb57..fcae49ad68 100644
--- a/src/core/SkPictureRecord.cpp
+++ b/src/core/SkPictureRecord.cpp
@@ -799,15 +799,6 @@ void SkPictureRecord::onDrawPatch(const SkPoint cubics[12], const SkColor colors
this->validate(initialOffset, size);
}
-void SkPictureRecord::drawData(const void* data, size_t length) {
- // op + length + 'length' worth of data
- size_t size = 2 * kUInt32Size + SkAlign4(length);
- size_t initialOffset = this->addDraw(DRAW_DATA, &size);
- this->addInt(SkToInt(length));
- fWriter.writePad(data, length);
- this->validate(initialOffset, size);
-}
-
void SkPictureRecord::beginCommentGroup(const char* description) {
// op/size + length of string + \0 terminated chars
size_t length = strlen(description);
diff --git a/src/core/SkPictureRecord.h b/src/core/SkPictureRecord.h
index d1a9e922e5..009506394e 100644
--- a/src/core/SkPictureRecord.h
+++ b/src/core/SkPictureRecord.h
@@ -50,7 +50,6 @@ public:
const SkColor colors[], SkXfermode*,
const uint16_t indices[], int indexCount,
const SkPaint&) SK_OVERRIDE;
- virtual void drawData(const void*, size_t) SK_OVERRIDE;
virtual void beginCommentGroup(const char* description) SK_OVERRIDE;
virtual void addComment(const char* kywd, const char* value) SK_OVERRIDE;
virtual void endCommentGroup() SK_OVERRIDE;
diff --git a/src/core/SkRecordDraw.cpp b/src/core/SkRecordDraw.cpp
index 3d6f3a0321..08c915491c 100644
--- a/src/core/SkRecordDraw.cpp
+++ b/src/core/SkRecordDraw.cpp
@@ -120,7 +120,6 @@ DRAW(DrawTextBlob, drawTextBlob(r.blob, r.x, r.y, r.paint));
DRAW(DrawTextOnPath, drawTextOnPath(r.text, r.byteLength, r.path, &r.matrix, r.paint));
DRAW(DrawVertices, drawVertices(r.vmode, r.vertexCount, r.vertices, r.texs, r.colors,
r.xmode.get(), r.indices, r.indexCount, r.paint));
-DRAW(DrawData, drawData(r.data, r.length));
#undef DRAW
template <> void Draw::draw(const DrawDrawable& r) {
@@ -290,7 +289,6 @@ private:
void trackBounds(const BeginCommentGroup&) { this->pushControl(); }
void trackBounds(const AddComment&) { this->pushControl(); }
void trackBounds(const EndCommentGroup&) { this->pushControl(); }
- void trackBounds(const DrawData&) { this->pushControl(); }
// For all other ops, we can calculate and store the bounds directly now.
template <typename T> void trackBounds(const T& op) {
diff --git a/src/core/SkRecorder.cpp b/src/core/SkRecorder.cpp
index 7d5d25205e..55b8a00588 100644
--- a/src/core/SkRecorder.cpp
+++ b/src/core/SkRecorder.cpp
@@ -333,6 +333,3 @@ void SkRecorder::endCommentGroup() {
APPEND(EndCommentGroup);
}
-void SkRecorder::drawData(const void* data, size_t length) {
- APPEND(DrawData, copy((const char*)data), length);
-}
diff --git a/src/core/SkRecorder.h b/src/core/SkRecorder.h
index 6f37ff3939..0e4252baac 100644
--- a/src/core/SkRecorder.h
+++ b/src/core/SkRecorder.h
@@ -133,7 +133,6 @@ public:
void beginCommentGroup(const char*) SK_OVERRIDE;
void addComment(const char*, const char*) SK_OVERRIDE;
void endCommentGroup() SK_OVERRIDE;
- void drawData(const void*, size_t) SK_OVERRIDE;
SkSurface* onNewSurface(const SkImageInfo&, const SkSurfaceProps&) SK_OVERRIDE { return NULL; }
diff --git a/src/core/SkRecords.h b/src/core/SkRecords.h
index ed5eaf3491..1cf29f26f1 100644
--- a/src/core/SkRecords.h
+++ b/src/core/SkRecords.h
@@ -61,7 +61,6 @@ namespace SkRecords {
M(DrawRect) \
M(DrawSprite) \
M(DrawTextBlob) \
- M(DrawData) \
M(DrawVertices)
// Defines SkRecords::Type, an enum of all record types.
@@ -305,8 +304,6 @@ RECORD5(DrawTextOnPath, SkPaint, paint,
BoundedPath, path,
TypedMatrix, matrix);
-RECORD2(DrawData, PODArray<char>, data, size_t, length);
-
RECORD5(DrawPatch, SkPaint, paint,
PODArray<SkPoint>, cubics,
PODArray<SkColor>, colors,
diff --git a/src/pipe/SkGPipePriv.h b/src/pipe/SkGPipePriv.h
index 2ea6ba5d55..447e7687c1 100644
--- a/src/pipe/SkGPipePriv.h
+++ b/src/pipe/SkGPipePriv.h
@@ -43,7 +43,6 @@ enum DrawOps {
kDrawBitmapNine_DrawOp,
kDrawBitmapRectToRect_DrawOp,
kDrawClear_DrawOp,
- kDrawData_DrawOp,
kDrawDRRect_DrawOp,
kDrawOval_DrawOp,
kDrawPaint_DrawOp,
diff --git a/src/pipe/SkGPipeRead.cpp b/src/pipe/SkGPipeRead.cpp
index bdd925e3c5..dab6178cfe 100644
--- a/src/pipe/SkGPipeRead.cpp
+++ b/src/pipe/SkGPipeRead.cpp
@@ -640,19 +640,6 @@ static void drawSprite_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32,
///////////////////////////////////////////////////////////////////////////////
-static void drawData_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32,
- SkGPipeState* state) {
- // since we don't have a paint, we can use data for our (small) sizes
- size_t size = DrawOp_unpackData(op32);
- if (0 == size) {
- size = reader->readU32();
- }
- const void* data = reader->skip(SkAlign4(size));
- if (state->shouldDraw()) {
- canvas->drawData(data, size);
- }
-}
-
static void drawPicture_rp(SkCanvas* canvas, SkReader32* reader, uint32_t op32,
SkGPipeState* state) {
UNIMPLEMENTED
@@ -815,7 +802,6 @@ static const ReadProc gReadTable[] = {
drawBitmapNine_rp,
drawBitmapRect_rp,
drawClear_rp,
- drawData_rp,
drawDRRect_rp,
drawOval_rp,
drawPaint_rp,
diff --git a/src/pipe/SkGPipeWrite.cpp b/src/pipe/SkGPipeWrite.cpp
index 9f56f6f549..45b26dbaf8 100644
--- a/src/pipe/SkGPipeWrite.cpp
+++ b/src/pipe/SkGPipeWrite.cpp
@@ -253,7 +253,6 @@ public:
const SkColor colors[], SkXfermode*,
const uint16_t indices[], int indexCount,
const SkPaint&) SK_OVERRIDE;
- virtual void drawData(const void*, size_t) SK_OVERRIDE;
virtual void beginCommentGroup(const char* description) SK_OVERRIDE;
virtual void addComment(const char* kywd, const char* value) SK_OVERRIDE;
virtual void endCommentGroup() SK_OVERRIDE;
@@ -1086,23 +1085,6 @@ void SkGPipeCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4
}
}
-void SkGPipeCanvas::drawData(const void* ptr, size_t size) {
- if (size && ptr) {
- NOTIFY_SETUP(this);
- unsigned data = 0;
- if (size < (1 << DRAWOPS_DATA_BITS)) {
- data = (unsigned)size;
- }
- if (this->needOpBytes(4 + SkAlign4(size))) {
- this->writeOp(kDrawData_DrawOp, 0, data);
- if (0 == data) {
- fWriter.write32(SkToU32(size));
- }
- fWriter.writePad(ptr, size);
- }
- }
-}
-
void SkGPipeCanvas::beginCommentGroup(const char* description) {
// ignore for now
}
diff --git a/src/utils/SkDumpCanvas.cpp b/src/utils/SkDumpCanvas.cpp
index d6192482f0..1bfb1ba806 100644
--- a/src/utils/SkDumpCanvas.cpp
+++ b/src/utils/SkDumpCanvas.cpp
@@ -457,12 +457,6 @@ void SkDumpCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4]
texCoords[2].x(), texCoords[2].y(), texCoords[3].x(), texCoords[3].y());
}
-void SkDumpCanvas::drawData(const void* data, size_t length) {
-// this->dump(kDrawData_Verb, NULL, "drawData(%d)", length);
- this->dump(kDrawData_Verb, NULL, "drawData(%d) %.*s", length,
- SkTMin<size_t>(length, 64), data);
-}
-
void SkDumpCanvas::beginCommentGroup(const char* description) {
this->dump(kBeginCommentGroup_Verb, NULL, "beginCommentGroup(%s)", description);
}
diff --git a/src/utils/SkLuaCanvas.cpp b/src/utils/SkLuaCanvas.cpp
index baa9a90ffd..ca04ba9d22 100644
--- a/src/utils/SkLuaCanvas.cpp
+++ b/src/utils/SkLuaCanvas.cpp
@@ -284,7 +284,3 @@ void SkLuaCanvas::drawVertices(VertexMode vmode, int vertexCount,
AUTO_LUA("drawVertices");
lua.pushPaint(paint, "paint");
}
-
-void SkLuaCanvas::drawData(const void* data, size_t length) {
- AUTO_LUA("drawData");
-}
diff --git a/src/utils/SkNWayCanvas.cpp b/src/utils/SkNWayCanvas.cpp
index c2a90a6331..f696de8e41 100644
--- a/src/utils/SkNWayCanvas.cpp
+++ b/src/utils/SkNWayCanvas.cpp
@@ -304,13 +304,6 @@ void SkNWayCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4]
}
}
-void SkNWayCanvas::drawData(const void* data, size_t length) {
- Iter iter(fList);
- while (iter.next()) {
- iter->drawData(data, length);
- }
-}
-
SkDrawFilter* SkNWayCanvas::setDrawFilter(SkDrawFilter* filter) {
Iter iter(fList);
while (iter.next()) {
diff --git a/src/utils/SkProxyCanvas.cpp b/src/utils/SkProxyCanvas.cpp
index 9adc81c722..161f3c0794 100644
--- a/src/utils/SkProxyCanvas.cpp
+++ b/src/utils/SkProxyCanvas.cpp
@@ -167,10 +167,6 @@ void SkProxyCanvas::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4
fProxy->drawPatch(cubics, colors, texCoords, xmode, paint);
}
-void SkProxyCanvas::drawData(const void* data, size_t length) {
- fProxy->drawData(data, length);
-}
-
void SkProxyCanvas::beginCommentGroup(const char* description) {
fProxy->beginCommentGroup(description);
}
diff --git a/src/utils/debugger/SkDebugCanvas.cpp b/src/utils/debugger/SkDebugCanvas.cpp
index 46c0b8b472..238d4688a8 100644
--- a/src/utils/debugger/SkDebugCanvas.cpp
+++ b/src/utils/debugger/SkDebugCanvas.cpp
@@ -448,10 +448,6 @@ void SkDebugCanvas::drawBitmapNine(const SkBitmap& bitmap,
this->addDrawCommand(new SkDrawBitmapNineCommand(bitmap, center, dst, paint));
}
-void SkDebugCanvas::drawData(const void* data, size_t length) {
- this->addDrawCommand(new SkDrawDataCommand(data, length));
-}
-
void SkDebugCanvas::beginCommentGroup(const char* description) {
this->addDrawCommand(new SkBeginCommentGroupCommand(description));
}
diff --git a/src/utils/debugger/SkDebugCanvas.h b/src/utils/debugger/SkDebugCanvas.h
index a526525f45..a74c41354f 100644
--- a/src/utils/debugger/SkDebugCanvas.h
+++ b/src/utils/debugger/SkDebugCanvas.h
@@ -158,8 +158,6 @@ public:
virtual void drawBitmapNine(const SkBitmap& bitmap, const SkIRect& center,
const SkRect& dst, const SkPaint*) SK_OVERRIDE;
- virtual void drawData(const void*, size_t) SK_OVERRIDE;
-
virtual void beginCommentGroup(const char* description) SK_OVERRIDE;
virtual void addComment(const char* kywd, const char* value) SK_OVERRIDE;
diff --git a/src/utils/debugger/SkDrawCommand.cpp b/src/utils/debugger/SkDrawCommand.cpp
index e7989cc001..be7fdfc716 100644
--- a/src/utils/debugger/SkDrawCommand.cpp
+++ b/src/utils/debugger/SkDrawCommand.cpp
@@ -368,22 +368,6 @@ bool SkDrawBitmapRectCommand::render(SkCanvas* canvas) const {
return true;
}
-SkDrawDataCommand::SkDrawDataCommand(const void* data, size_t length)
- : INHERITED(DRAW_DATA) {
- fData = new char[length];
- memcpy(fData, data, length);
- fLength = length;
-
- // TODO: add display of actual data?
- SkString* str = new SkString;
- str->appendf("length: %d", (int) length);
- fInfo.push(str);
-}
-
-void SkDrawDataCommand::execute(SkCanvas* canvas) const {
- canvas->drawData(fData, fLength);
-}
-
SkBeginCommentGroupCommand::SkBeginCommentGroupCommand(const char* description)
: INHERITED(BEGIN_COMMENT_GROUP)
, fDescription(description) {
diff --git a/src/utils/debugger/SkDrawCommand.h b/src/utils/debugger/SkDrawCommand.h
index 951d15e195..831dffcfa0 100644
--- a/src/utils/debugger/SkDrawCommand.h
+++ b/src/utils/debugger/SkDrawCommand.h
@@ -237,18 +237,6 @@ private:
typedef SkDrawCommand INHERITED;
};
-class SkDrawDataCommand : public SkDrawCommand {
-public:
- SkDrawDataCommand(const void* data, size_t length);
- virtual ~SkDrawDataCommand() { delete [] fData; }
- virtual void execute(SkCanvas* canvas) const SK_OVERRIDE;
-private:
- char* fData;
- size_t fLength;
-
- typedef SkDrawCommand INHERITED;
-};
-
class SkBeginCommentGroupCommand : public SkDrawCommand {
public:
SkBeginCommentGroupCommand(const char* description);