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

Side by Side Diff: dm/DMQuiltTask.cpp

Issue 500373005: Remove SkQuadTree. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/DMQuiltTask.h ('k') | gm/gmmain.cpp » ('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 "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 "SkThreadPool.h" 8 #include "SkThreadPool.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.");
11 DEFINE_int32(quiltTile, 256, "Dimension of (square) quilt tile."); 11 DEFINE_int32(quiltTile, 256, "Dimension of (square) quilt tile.");
12 12
13 namespace DM { 13 namespace DM {
14 14
15 static SkString suffix(QuiltTask::Backend backend, QuiltTask::BBH bbh) { 15 static SkString suffix(QuiltTask::Backend backend, QuiltTask::BBH bbh) {
16 static const char* kBackends[] = { "default", "skrecord" }; 16 static const char* kBackends[] = { "default", "skrecord" };
17 static const char* kBBHs[] = { "nobbh", "rtree", "quadtree", "tilegrid" }; 17 static const char* kBBHs[] = { "nobbh", "rtree", "tilegrid" };
18 return SkStringPrintf("%s-%s", kBackends[backend], kBBHs[bbh]); 18 return SkStringPrintf("%s-%s", kBackends[backend], kBBHs[bbh]);
19 } 19 }
20 20
21 QuiltTask::QuiltTask(const Task& parent, skiagm::GM* gm, SkBitmap reference, 21 QuiltTask::QuiltTask(const Task& parent, skiagm::GM* gm, SkBitmap reference,
22 QuiltTask::BBH bbh, QuiltTask::Backend backend) 22 QuiltTask::BBH bbh, QuiltTask::Backend backend)
23 : CpuTask(parent) 23 : CpuTask(parent)
24 , fBBH(bbh) 24 , fBBH(bbh)
25 , fBackend(backend) 25 , fBackend(backend)
26 , fName(UnderJoin(parent.name().c_str(), suffix(backend, bbh).c_str())) 26 , fName(UnderJoin(parent.name().c_str(), suffix(backend, bbh).c_str()))
27 , fGM(gm) 27 , fGM(gm)
(...skipping 30 matching lines...) Expand all
58 SkBitmap* fQuilt; 58 SkBitmap* fQuilt;
59 }; 59 };
60 60
61 void QuiltTask::draw() { 61 void QuiltTask::draw() {
62 SkAutoTDelete<SkBBHFactory> factory; 62 SkAutoTDelete<SkBBHFactory> factory;
63 switch (fBBH) { 63 switch (fBBH) {
64 case kNone_BBH: break; 64 case kNone_BBH: break;
65 case kRTree_BBH: 65 case kRTree_BBH:
66 factory.reset(SkNEW(SkRTreeFactory)); 66 factory.reset(SkNEW(SkRTreeFactory));
67 break; 67 break;
68 case kQuadTree_BBH:
69 factory.reset(SkNEW(SkQuadTreeFactory));
70 break;
71 case kTileGrid_BBH: { 68 case kTileGrid_BBH: {
72 const SkTileGridFactory::TileGridInfo tiles = { 69 const SkTileGridFactory::TileGridInfo tiles = {
73 { FLAGS_quiltTile, FLAGS_quiltTile }, 70 { FLAGS_quiltTile, FLAGS_quiltTile },
74 /*overlap: */{0, 0}, 71 /*overlap: */{0, 0},
75 /*offset: */{0, 0}, 72 /*offset: */{0, 0},
76 }; 73 };
77 factory.reset(SkNEW_ARGS(SkTileGridFactory, (tiles))); 74 factory.reset(SkNEW_ARGS(SkTileGridFactory, (tiles)));
78 break; 75 break;
79 } 76 }
80 } 77 }
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 } 112 }
116 113
117 bool QuiltTask::shouldSkip() const { 114 bool QuiltTask::shouldSkip() const {
118 if (fGM->getFlags() & skiagm::GM::kSkipPicture_Flag) { 115 if (fGM->getFlags() & skiagm::GM::kSkipPicture_Flag) {
119 return true; 116 return true;
120 } 117 }
121 return !FLAGS_quilt; 118 return !FLAGS_quilt;
122 } 119 }
123 120
124 } // namespace DM 121 } // namespace DM
OLDNEW
« no previous file with comments | « dm/DMQuiltTask.h ('k') | gm/gmmain.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698