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

Unified Diff: dm/DMReplayTask.cpp

Issue 51243003: DM: add --rtree. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: epoger Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « dm/DMReplayTask.h ('k') | dm/DMUtil.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMReplayTask.cpp
diff --git a/dm/DMReplayTask.cpp b/dm/DMReplayTask.cpp
index a0ecf5fadf7812e282b1a8a7b745a698204fda77..0ec9e250d9dad5353489184527a8478a527a71b9 100644
--- a/dm/DMReplayTask.cpp
+++ b/dm/DMReplayTask.cpp
@@ -6,21 +6,25 @@
#include "SkPicture.h"
DEFINE_bool(replay, false, "If true, run picture replay tests.");
+DEFINE_bool(rtree, false, "If true, run picture replay tests with an rtree.");
namespace DM {
ReplayTask::ReplayTask(const Task& parent,
skiagm::GM* gm,
- SkBitmap reference)
+ SkBitmap reference,
+ bool useRTree)
: Task(parent)
- , fName(UnderJoin(parent.name().c_str(), "replay"))
+ , fName(UnderJoin(parent.name().c_str(), useRTree ? "rtree" : "replay"))
, fGM(gm)
, fReference(reference)
+ , fUseRTree(useRTree)
{}
void ReplayTask::draw() {
SkPicture recorded;
- RecordPicture(fGM.get(), &recorded);
+ const uint32_t flags = fUseRTree ? SkPicture::kOptimizeForClippedPlayback_RecordingFlag : 0;
+ RecordPicture(fGM.get(), &recorded, flags);
SkBitmap bitmap;
SetupBitmap(fReference.config(), fGM.get(), &bitmap);
@@ -32,7 +36,17 @@ void ReplayTask::draw() {
}
bool ReplayTask::shouldSkip() const {
- return !FLAGS_replay || fGM->getFlags() & skiagm::GM::kSkipPicture_Flag;
+ if (fGM->getFlags() & skiagm::GM::kSkipPicture_Flag) {
+ return true;
+ }
+
+ if (FLAGS_rtree && fUseRTree) {
+ return false;
+ }
+ if (FLAGS_replay && !fUseRTree) {
+ return false;
+ }
+ return true;
}
} // namespace DM
« no previous file with comments | « dm/DMReplayTask.h ('k') | dm/DMUtil.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698