Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: dm/DMSerializeTask.cpp

Issue 551873003: Update DM JSON format. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « dm/DMSKPTask.cpp ('k') | dm/DMWriteTask.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "DMSerializeTask.h" 1 #include "DMSerializeTask.h"
2 #include "DMUtil.h" 2 #include "DMUtil.h"
3 #include "DMWriteTask.h" 3 #include "DMWriteTask.h"
4 4
5 #include "SkCommandLineFlags.h" 5 #include "SkCommandLineFlags.h"
6 #include "SkPicture.h" 6 #include "SkPicture.h"
7 #include "SkPixelRef.h" 7 #include "SkPixelRef.h"
8 8
9 DEFINE_bool(serialize, true, "If true, run picture serialization tests via S kPictureData."); 9 DEFINE_bool(serialize, true, "If true, run picture serialization tests via S kPictureData.");
10 DEFINE_bool(serialize_skr, true, "If true, run picture serialization tests via S kRecord."); 10 DEFINE_bool(serialize_skr, true, "If true, run picture serialization tests via S kRecord.");
(...skipping 21 matching lines...) Expand all
32 SkDynamicMemoryWStream wStream; 32 SkDynamicMemoryWStream wStream;
33 recorded->serialize(&wStream, NULL); 33 recorded->serialize(&wStream, NULL);
34 SkAutoTUnref<SkStream> rStream(wStream.detachAsStream()); 34 SkAutoTUnref<SkStream> rStream(wStream.detachAsStream());
35 SkAutoTUnref<SkPicture> reconstructed(SkPicture::CreateFromStream(rStream)); 35 SkAutoTUnref<SkPicture> reconstructed(SkPicture::CreateFromStream(rStream));
36 36
37 SkBitmap bitmap; 37 SkBitmap bitmap;
38 AllocatePixels(fReference, &bitmap); 38 AllocatePixels(fReference, &bitmap);
39 DrawPicture(*reconstructed, &bitmap); 39 DrawPicture(*reconstructed, &bitmap);
40 if (!BitmapsEqual(bitmap, fReference)) { 40 if (!BitmapsEqual(bitmap, fReference)) {
41 this->fail(); 41 this->fail();
42 this->spawnChild(SkNEW_ARGS(WriteTask, (*this, bitmap))); 42 this->spawnChild(SkNEW_ARGS(WriteTask, (*this, "GM", bitmap)));
43 } 43 }
44 } 44 }
45 45
46 bool SerializeTask::shouldSkip() const { 46 bool SerializeTask::shouldSkip() const {
47 if (fGM->getFlags() & skiagm::GM::kSkipPicture_Flag) { 47 if (fGM->getFlags() & skiagm::GM::kSkipPicture_Flag) {
48 return true; 48 return true;
49 } 49 }
50 return !*kEnabled[fMode]; 50 return !*kEnabled[fMode];
51 } 51 }
52 52
53 } // namespace DM 53 } // namespace DM
OLDNEW
« no previous file with comments | « dm/DMSKPTask.cpp ('k') | dm/DMWriteTask.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698