| OLD | NEW |
| 1 #include "DMQuiltTask.h" | 1 #include "DMQuiltTask.h" |
| 2 #include "DMUtil.h" | 2 #include "DMUtil.h" |
| 3 #include "DMWriteTask.h" | 3 #include "DMWriteTask.h" |
| 4 | 4 |
| 5 #include "SkBBHFactory.h" | 5 #include "SkBBHFactory.h" |
| 6 #include "SkCommandLineFlags.h" | 6 #include "SkCommandLineFlags.h" |
| 7 #include "SkPicture.h" | 7 #include "SkPicture.h" |
| 8 #include "SkTaskGroup.h" | 8 #include "SkTaskGroup.h" |
| 9 | 9 |
| 10 DEFINE_bool(quilt, true, "If true, draw GM via a picture into a quilt of small t
iles and compare."); | 10 DEFINE_bool(quilt, true, "If true, draw GM via a picture into a quilt of small t
iles and compare."); |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 tileCanvas.flush(); | 41 tileCanvas.flush(); |
| 42 } | 42 } |
| 43 | 43 |
| 44 void QuiltTask::draw() { | 44 void QuiltTask::draw() { |
| 45 SkAutoTDelete<SkBBHFactory> factory; | 45 SkAutoTDelete<SkBBHFactory> factory; |
| 46 switch (fBBH) { | 46 switch (fBBH) { |
| 47 case kNone_BBH: break; | 47 case kNone_BBH: break; |
| 48 case kRTree_BBH: | 48 case kRTree_BBH: |
| 49 factory.reset(SkNEW(SkRTreeFactory)); | 49 factory.reset(SkNEW(SkRTreeFactory)); |
| 50 break; | 50 break; |
| 51 case kTileGrid_BBH: { | |
| 52 const SkTileGridFactory::TileGridInfo tiles = { | |
| 53 { FLAGS_quiltTile, FLAGS_quiltTile }, | |
| 54 /*overlap: */{0, 0}, | |
| 55 /*offset: */{0, 0}, | |
| 56 }; | |
| 57 factory.reset(SkNEW_ARGS(SkTileGridFactory, (tiles))); | |
| 58 break; | |
| 59 } | |
| 60 } | 51 } |
| 61 | 52 |
| 62 // A couple GMs draw wrong when using a bounding box hierarchy. | 53 // A couple GMs draw wrong when using a bounding box hierarchy. |
| 63 // This almost certainly means we have a bug to fix, but for now | 54 // This almost certainly means we have a bug to fix, but for now |
| 64 // just draw without a bounding box hierarchy. | 55 // just draw without a bounding box hierarchy. |
| 65 if (fGM->getFlags() & skiagm::GM::kNoBBH_Flag) { | 56 if (fGM->getFlags() & skiagm::GM::kNoBBH_Flag) { |
| 66 factory.reset(NULL); | 57 factory.reset(NULL); |
| 67 } | 58 } |
| 68 | 59 |
| 69 SkAutoTUnref<const SkPicture> recorded(RecordPicture(fGM.get(), factory.get(
))); | 60 SkAutoTUnref<const SkPicture> recorded(RecordPicture(fGM.get(), factory.get(
))); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 98 } | 89 } |
| 99 | 90 |
| 100 bool QuiltTask::shouldSkip() const { | 91 bool QuiltTask::shouldSkip() const { |
| 101 if (fGM->getFlags() & skiagm::GM::kSkipPicture_Flag) { | 92 if (fGM->getFlags() & skiagm::GM::kSkipPicture_Flag) { |
| 102 return true; | 93 return true; |
| 103 } | 94 } |
| 104 return !FLAGS_quilt; | 95 return !FLAGS_quilt; |
| 105 } | 96 } |
| 106 | 97 |
| 107 } // namespace DM | 98 } // namespace DM |
| OLD | NEW |