diff options
author | 2014-08-18 08:23:18 -0700 | |
---|---|---|
committer | 2014-08-18 08:23:19 -0700 | |
commit | 0ed4e863c0b8f8a9ca8182148bf9849e5b5bf2aa (patch) | |
tree | 23edcbcc1f3d2fe73f83ff73fdccd599e64178eb | |
parent | dc0fcbb925c3642dde6ac647666fc04142e713ae (diff) |
Stop sorting the results of SkBBH::search().
We only seem to need to sort with SkQuadTree, which is not actively used by
client code. So it's really just wasted work. SkQuadTree is interesting, but
I'd rather disable it than slow down the production code path.
BUG=skia:2834
R=robertphillips@google.com, mtklein@google.com
Author: mtklein@chromium.org
Review URL: https://codereview.chromium.org/471063004
-rw-r--r-- | dm/DMCpuGMTask.cpp | 8 | ||||
-rw-r--r-- | src/core/SkPictureData.cpp | 7 | ||||
-rw-r--r-- | src/core/SkRecordDraw.cpp | 6 |
3 files changed, 5 insertions, 16 deletions
diff --git a/dm/DMCpuGMTask.cpp b/dm/DMCpuGMTask.cpp index d39252adf6..0127095d06 100644 --- a/dm/DMCpuGMTask.cpp +++ b/dm/DMCpuGMTask.cpp @@ -40,14 +40,16 @@ void CpuGMTask::draw() { SPAWN(QuiltTask, fGMFactory(NULL), bm, QuiltTask::kNone_BBH, QuiltTask::kDefault_Backend); SPAWN(QuiltTask, fGMFactory(NULL), bm, QuiltTask::kRTree_BBH, QuiltTask::kDefault_Backend); - SPAWN(QuiltTask, fGMFactory(NULL), bm, QuiltTask::kQuadTree_BBH, QuiltTask::kDefault_Backend); SPAWN(QuiltTask, fGMFactory(NULL), bm, QuiltTask::kTileGrid_BBH, QuiltTask::kDefault_Backend); - SPAWN(QuiltTask, fGMFactory(NULL), bm, QuiltTask::kNone_BBH, QuiltTask::kSkRecord_Backend); SPAWN(QuiltTask, fGMFactory(NULL), bm, QuiltTask::kRTree_BBH, QuiltTask::kSkRecord_Backend); - SPAWN(QuiltTask, fGMFactory(NULL), bm, QuiltTask::kQuadTree_BBH, QuiltTask::kSkRecord_Backend); SPAWN(QuiltTask, fGMFactory(NULL), bm, QuiltTask::kTileGrid_BBH, QuiltTask::kSkRecord_Backend); + /* skia:2834 SkQuadTree does not return its data in the order it was inserted. + SPAWN(QuiltTask, fGMFactory(NULL), bm, QuiltTask::kQuadTree_BBH, QuiltTask::kDefault_Backend); + SPAWN(QuiltTask, fGMFactory(NULL), bm, QuiltTask::kQuadTree_BBH, QuiltTask::kSkRecord_Backend); + */ + SPAWN(SerializeTask, fGMFactory(NULL), bm, SerializeTask::kNormal_Mode); SPAWN(SerializeTask, fGMFactory(NULL), bm, SerializeTask::kSkRecord_Mode); diff --git a/src/core/SkPictureData.cpp b/src/core/SkPictureData.cpp index ea9da79aa3..2bcf7798cc 100644 --- a/src/core/SkPictureData.cpp +++ b/src/core/SkPictureData.cpp @@ -589,14 +589,7 @@ const SkPicture::OperationList* SkPictureData::getActiveOps(const SkIRect& query } SkPicture::OperationList* activeOps = SkNEW(SkPicture::OperationList); - fBoundingHierarchy->search(query, &(activeOps->fOps)); - if (0 != activeOps->fOps.count()) { - SkTQSort<SkPictureStateTree::Draw>( - reinterpret_cast<SkPictureStateTree::Draw**>(activeOps->fOps.begin()), - reinterpret_cast<SkPictureStateTree::Draw**>(activeOps->fOps.end()-1)); - } - return activeOps; } diff --git a/src/core/SkRecordDraw.cpp b/src/core/SkRecordDraw.cpp index 46241d72ac..17ac0d9cfd 100644 --- a/src/core/SkRecordDraw.cpp +++ b/src/core/SkRecordDraw.cpp @@ -27,12 +27,6 @@ void SkRecordDraw(const SkRecord& record, SkTDArray<void*> ops; bbh->search(query, &ops); - // FIXME: QuadTree doesn't send these back in the order we inserted them. :( - // Also remove the sort in SkPictureData::getActiveOps()? - if (ops.count() > 0) { - SkTQSort(ops.begin(), ops.end() - 1, SkTCompareLT<void*>()); - } - SkRecords::Draw draw(canvas); for (int i = 0; i < ops.count(); i++) { if (NULL != callback && callback->abortDrawing()) { |