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

Unified Diff: samplecode/SamplePictFile.cpp

Issue 131343011: Initial QuadTree implementation (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fixed SkScalar conversion issue Created 6 years, 11 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 | « gyp/tests.gyp ('k') | src/core/SkBBoxHierarchy.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SamplePictFile.cpp
diff --git a/samplecode/SamplePictFile.cpp b/samplecode/SamplePictFile.cpp
index c6518d9e7a065b7bbe865d37b21c8348bda7e0ac..5cd16bddc1bdd6d3e9c16cf3e33749ea3a356825 100644
--- a/samplecode/SamplePictFile.cpp
+++ b/samplecode/SamplePictFile.cpp
@@ -15,6 +15,7 @@
#include "SkOSFile.h"
#include "SkPath.h"
#include "SkPicture.h"
+#include "SkQuadTreePicture.h"
#include "SkRandom.h"
#include "SkRegion.h"
#include "SkShader.h"
@@ -61,8 +62,22 @@ protected:
SkString name("P:");
const char* basename = strrchr(fFilename.c_str(), SkPATH_SEPARATOR);
name.append(basename ? basename+1: fFilename.c_str());
- if (fBBox != kNo_BBoxType) {
- name.append(fBBox == kRTree_BBoxType ? " <bbox: R>" : " <bbox: T>");
+ switch (fBBox) {
+ case kNo_BBoxType:
+ // No name appended
+ break;
+ case kRTree_BBoxType:
+ name.append(" <bbox: R>");
+ break;
+ case kQuadTree_BBoxType:
+ name.append(" <bbox: Q>");
+ break;
+ case kTileGrid_BBoxType:
+ name.append(" <bbox: T>");
+ break;
+ default:
+ SkASSERT(false);
+ break;
}
SampleCode::TitleR(evt, name.c_str());
return true;
@@ -93,6 +108,7 @@ protected:
private:
enum BBoxType {
kNo_BBoxType,
+ kQuadTree_BBoxType,
kRTree_BBoxType,
kTileGrid_BBoxType,
@@ -152,6 +168,10 @@ private:
case kRTree_BBoxType:
bboxPicture = SkNEW(SkPicture);
break;
+ case kQuadTree_BBoxType:
+ bboxPicture = SkNEW_ARGS(SkQuadTreePicture,
+ (SkIRect::MakeWH(pic->width(), pic->height())));
+ break;
case kTileGrid_BBoxType: {
SkASSERT(!fTileSize.isEmpty());
SkTileGridPicture::TileGridInfo gridInfo;
« no previous file with comments | « gyp/tests.gyp ('k') | src/core/SkBBoxHierarchy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698