Index: dm/DMSerializeTask.cpp |
diff --git a/dm/DMSerializeTask.cpp b/dm/DMSerializeTask.cpp |
deleted file mode 100644 |
index a3e2503c6d52e407d66758588800dd0fbe87b803..0000000000000000000000000000000000000000 |
--- a/dm/DMSerializeTask.cpp |
+++ /dev/null |
@@ -1,44 +0,0 @@ |
-#include "DMSerializeTask.h" |
-#include "DMUtil.h" |
-#include "DMWriteTask.h" |
- |
-#include "SkCommandLineFlags.h" |
-#include "SkPicture.h" |
-#include "SkPixelRef.h" |
- |
-DEFINE_bool(serialize, true, "If true, run picture serialization tests via SkPictureData."); |
- |
-namespace DM { |
- |
-SerializeTask::SerializeTask(const Task& parent, skiagm::GM* gm, SkBitmap reference) |
- : CpuTask(parent) |
- , fName(UnderJoin(parent.name().c_str(), "serialize")) |
- , fGM(gm) |
- , fReference(reference) |
- {} |
- |
-void SerializeTask::draw() { |
- SkAutoTUnref<SkPicture> recorded(RecordPicture(fGM.get(), NULL/*no BBH*/)); |
- |
- SkDynamicMemoryWStream wStream; |
- recorded->serialize(&wStream); |
- SkAutoTUnref<SkStream> rStream(wStream.detachAsStream()); |
- SkAutoTUnref<SkPicture> reconstructed(SkPicture::CreateFromStream(rStream)); |
- |
- SkBitmap bitmap; |
- AllocatePixels(fReference, &bitmap); |
- DrawPicture(*reconstructed, &bitmap); |
- if (!BitmapsEqual(bitmap, fReference)) { |
- this->fail(); |
- this->spawnChild(SkNEW_ARGS(WriteTask, (*this, "GM", bitmap))); |
- } |
-} |
- |
-bool SerializeTask::shouldSkip() const { |
- if (fGM->getFlags() & skiagm::GM::kSkipPicture_Flag) { |
- return true; |
- } |
- return !FLAGS_serialize; |
-} |
- |
-} // namespace DM |