diff options
author | mtklein <mtklein@chromium.org> | 2015-01-09 06:41:48 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-09 06:41:48 -0800 |
commit | 703dd2ed187b9788c5bb0f2d313f2d07695603d6 (patch) | |
tree | e2314099eb0729896a8c919556852413f209aaeb /tools | |
parent | 9250543c559bb756e7749a13bdea6c3be3861f2b (diff) |
Remove SkTileGrid (except for TileGridInfo).
TBR=reed@google.com
BUG=skia:3085
Review URL: https://codereview.chromium.org/845623002
Diffstat (limited to 'tools')
-rw-r--r-- | tools/PictureRenderer.cpp | 18 | ||||
-rw-r--r-- | tools/PictureRenderer.h | 25 | ||||
-rw-r--r-- | tools/PictureRenderingFlags.cpp | 21 | ||||
-rw-r--r-- | tools/bbh_shootout.cpp | 2 | ||||
-rw-r--r-- | tools/bench_pictures_cfg_helper.py | 5 |
5 files changed, 10 insertions, 61 deletions
diff --git a/tools/PictureRenderer.cpp b/tools/PictureRenderer.cpp index 5af0538a0d..b3fef3caf5 100644 --- a/tools/PictureRenderer.cpp +++ b/tools/PictureRenderer.cpp @@ -228,7 +228,7 @@ void PictureRenderer::buildBBoxHierarchy() { if (fUseMultiPictureDraw) { flags |= SkPictureRecorder::kComputeSaveLayerInfo_RecordFlag; } - SkCanvas* canvas = recorder.beginRecording(fPicture->cullRect().width(), + SkCanvas* canvas = recorder.beginRecording(fPicture->cullRect().width(), fPicture->cullRect().height(), factory.get(), flags); @@ -376,7 +376,7 @@ public: bool RecordPictureRenderer::render(SkBitmap** out) { SkAutoTDelete<SkBBHFactory> factory(this->getFactory()); SkPictureRecorder recorder; - SkCanvas* canvas = recorder.beginRecording(SkIntToScalar(this->getViewWidth()), + SkCanvas* canvas = recorder.beginRecording(SkIntToScalar(this->getViewWidth()), SkIntToScalar(this->getViewHeight()), factory.get(), this->recordFlags()); @@ -415,7 +415,7 @@ bool PipePictureRenderer::render(SkBitmap** out) { fCanvas->flush(); if (out) { *out = SkNEW(SkBitmap); - setup_bitmap(*out, SkScalarCeilToInt(fPicture->cullRect().width()), + setup_bitmap(*out, SkScalarCeilToInt(fPicture->cullRect().width()), SkScalarCeilToInt(fPicture->cullRect().height())); fCanvas->readPixels(*out, 0, 0); } @@ -436,7 +436,7 @@ SkString PipePictureRenderer::getConfigNameInternal() { void SimplePictureRenderer::init(const SkPicture* picture, const SkString* writePath, const SkString* mismatchPath, const SkString* inputFilename, bool useChecksumBasedFilenames, bool useMultiPictureDraw) { - INHERITED::init(picture, writePath, mismatchPath, inputFilename, + INHERITED::init(picture, writePath, mismatchPath, inputFilename, useChecksumBasedFilenames, useMultiPictureDraw); this->buildBBoxHierarchy(); } @@ -460,7 +460,7 @@ bool SimplePictureRenderer::render(SkBitmap** out) { fCanvas->flush(); if (out) { *out = SkNEW(SkBitmap); - setup_bitmap(*out, SkScalarCeilToInt(fPicture->cullRect().width()), + setup_bitmap(*out, SkScalarCeilToInt(fPicture->cullRect().width()), SkScalarCeilToInt(fPicture->cullRect().height())); fCanvas->readPixels(*out, 0, 0); } @@ -671,7 +671,7 @@ void TiledPictureRenderer::drawCurrentTile() { draw_tile_to_canvas(fCanvas, fTileRects[fCurrentTileOffset], fPicture); } -bool TiledPictureRenderer::postRender(SkCanvas* canvas, const SkIRect& tileRect, +bool TiledPictureRenderer::postRender(SkCanvas* canvas, const SkIRect& tileRect, SkBitmap* tempBM, SkBitmap** out, int tileNumber) { bool success = true; @@ -701,7 +701,7 @@ bool TiledPictureRenderer::render(SkBitmap** out) { SkBitmap bitmap; if (out) { *out = SkNEW(SkBitmap); - setup_bitmap(*out, SkScalarCeilToInt(fPicture->cullRect().width()), + setup_bitmap(*out, SkScalarCeilToInt(fPicture->cullRect().width()), SkScalarCeilToInt(fPicture->cullRect().height())); setup_bitmap(&bitmap, fTileWidth, fTileHeight); } @@ -801,7 +801,7 @@ SkString TiledPictureRenderer::getConfigNameInternal() { void PlaybackCreationRenderer::setup() { SkAutoTDelete<SkBBHFactory> factory(this->getFactory()); fRecorder.reset(SkNEW(SkPictureRecorder)); - SkCanvas* canvas = fRecorder->beginRecording(SkIntToScalar(this->getViewWidth()), + SkCanvas* canvas = fRecorder->beginRecording(SkIntToScalar(this->getViewWidth()), SkIntToScalar(this->getViewHeight()), factory.get(), this->recordFlags()); @@ -828,8 +828,6 @@ SkBBHFactory* PictureRenderer::getFactory() { return NULL; case kRTree_BBoxHierarchyType: return SkNEW(SkRTreeFactory); - case kTileGrid_BBoxHierarchyType: - return SkNEW_ARGS(SkTileGridFactory, (fGridInfo)); } SkASSERT(0); // invalid bbhType return NULL; diff --git a/tools/PictureRenderer.h b/tools/PictureRenderer.h index c8462d9f03..bfa09e397d 100644 --- a/tools/PictureRenderer.h +++ b/tools/PictureRenderer.h @@ -57,9 +57,8 @@ public: enum BBoxHierarchyType { kNone_BBoxHierarchyType = 0, kRTree_BBoxHierarchyType, - kTileGrid_BBoxHierarchyType, - kLast_BBoxHierarchyType = kTileGrid_BBoxHierarchyType, + kLast_BBoxHierarchyType = kRTree_BBoxHierarchyType, }; // this uses SkPaint::Flags as a base and adds additional flags @@ -237,10 +236,6 @@ public: BBoxHierarchyType getBBoxHierarchyType() { return fBBoxHierarchyType; } - void setGridSize(int width, int height) { - fGridInfo.fTileInterval.set(width, height); - } - void setJsonSummaryPtr(ImageResultsAndExpectations* jsonSummaryPtr) { fJsonSummaryPtr = jsonSummaryPtr; } @@ -266,12 +261,6 @@ public: } if (kRTree_BBoxHierarchyType == fBBoxHierarchyType) { config.append("_rtree"); - } else if (kTileGrid_BBoxHierarchyType == fBBoxHierarchyType) { - config.append("_grid"); - config.append("_"); - config.appendS32(fGridInfo.fTileInterval.width()); - config.append("x"); - config.appendS32(fGridInfo.fTileInterval.height()); } #if SK_SUPPORT_GPU switch (fDeviceType) { @@ -316,12 +305,6 @@ public: } if (kRTree_BBoxHierarchyType == fBBoxHierarchyType) { result["bbh"] = "rtree"; - } else if (kTileGrid_BBoxHierarchyType == fBBoxHierarchyType) { - SkString tmp("grid_"); - tmp.appendS32(fGridInfo.fTileInterval.width()); - tmp.append("x"); - tmp.appendS32(fGridInfo.fTileInterval.height()); - result["bbh"] = tmp.c_str(); } #if SK_SUPPORT_GPU SkString tmp; @@ -439,9 +422,6 @@ public: , fUseDFText(false) #endif { - fGridInfo.fMargin.setEmpty(); - fGridInfo.fOffset.setZero(); - fGridInfo.fTileInterval.set(1, 1); sk_bzero(fDrawFilters, sizeof(fDrawFilters)); fViewport.set(0, 0); } @@ -466,7 +446,6 @@ protected: SkString fWritePath; SkString fMismatchPath; SkString fInputFilename; - SkTileGridFactory::TileGridInfo fGridInfo; // used when fBBoxHierarchyType is TileGrid void buildBBoxHierarchy(); @@ -696,7 +675,7 @@ private: void setupTiles(); void setupPowerOf2Tiles(); - bool postRender(SkCanvas*, const SkIRect& tileRect, + bool postRender(SkCanvas*, const SkIRect& tileRect, SkBitmap* tempBM, SkBitmap** out, int tileNumber); diff --git a/tools/PictureRenderingFlags.cpp b/tools/PictureRenderingFlags.cpp index ac72cad4c2..7424d50786 100644 --- a/tools/PictureRenderingFlags.cpp +++ b/tools/PictureRenderingFlags.cpp @@ -92,7 +92,6 @@ sk_tools::PictureRenderer* parseRenderer(SkString& error, PictureTool tool) { bool isPowerOf2Mode = false; bool isCopyMode = false; const char* mode = NULL; - bool gridSupported = false; #if SK_SUPPORT_GPU GrContext::Options grContextOpts; @@ -107,7 +106,6 @@ sk_tools::PictureRenderer* parseRenderer(SkString& error, PictureTool tool) { mode = FLAGS_mode[0]; if (0 == strcmp(mode, "record")) { renderer.reset(SkNEW_ARGS(sk_tools::RecordPictureRenderer, RENDERER_ARGS)); - gridSupported = true; } else if (0 == strcmp(mode, "tile") || 0 == strcmp(mode, "pow2tile") || 0 == strcmp(mode, "copyTile")) { useTiles = true; @@ -116,8 +114,6 @@ sk_tools::PictureRenderer* parseRenderer(SkString& error, PictureTool tool) { isPowerOf2Mode = true; } else if (0 == strcmp(mode, "copyTile")) { isCopyMode = true; - } else { - gridSupported = true; } if (FLAGS_mode.count() < 2) { @@ -134,7 +130,6 @@ sk_tools::PictureRenderer* parseRenderer(SkString& error, PictureTool tool) { heightString = FLAGS_mode[2]; } else if (0 == strcmp(mode, "playbackCreation") && kBench_PictureTool == tool) { renderer.reset(SkNEW_ARGS(sk_tools::PlaybackCreationRenderer, RENDERER_ARGS)); - gridSupported = true; // undocumented } else if (0 == strcmp(mode, "gatherPixelRefs") && kBench_PictureTool == tool) { #if SK_SUPPORT_GPU @@ -147,8 +142,6 @@ sk_tools::PictureRenderer* parseRenderer(SkString& error, PictureTool tool) { // Allow 'mode' to be set to 'simple', but do not create a renderer, so we can // ensure that pipe does not override a mode besides simple. The renderer will // be created below. - } else if (0 == strcmp(mode, "simple")) { - gridSupported = true; } else { error.printf("%s is not a valid mode for --mode\n", mode); return NULL; @@ -354,20 +347,6 @@ sk_tools::PictureRenderer* parseRenderer(SkString& error, PictureTool tool) { bbhType = sk_tools::PictureRenderer::kNone_BBoxHierarchyType; } else if (0 == strcmp(type, "rtree")) { bbhType = sk_tools::PictureRenderer::kRTree_BBoxHierarchyType; - } else if (0 == strcmp(type, "grid")) { - if (!gridSupported) { - error.printf("'--bbh grid' is not compatible with --mode=%s.\n", mode); - return NULL; - } - bbhType = sk_tools::PictureRenderer::kTileGrid_BBoxHierarchyType; - if (FLAGS_bbh.count() != 3) { - error.printf("--bbh grid requires a width and a height.\n"); - return NULL; - } - int gridWidth = atoi(FLAGS_bbh[1]); - int gridHeight = atoi(FLAGS_bbh[2]); - renderer->setGridSize(gridWidth, gridHeight); - } else { error.printf("%s is not a valid value for --bbhType\n", type); return NULL; diff --git a/tools/bbh_shootout.cpp b/tools/bbh_shootout.cpp index d4b290d06b..0c2e2e3a37 100644 --- a/tools/bbh_shootout.cpp +++ b/tools/bbh_shootout.cpp @@ -37,7 +37,6 @@ struct Measurement { const char* kBBoxHierarchyTypeNames[kBBoxTypeCount] = { "none", // kNone_BBoxHierarchyType "rtree", // kRTree_BBoxHierarchyType - "tilegrid", // kTileGrid_BBoxHierarchyType }; static SkPicture* pic_from_path(const char path[]) { @@ -65,7 +64,6 @@ static void do_benchmark_work(sk_tools::PictureRenderer* renderer, const int numRepeats, Timer* timer) { renderer->setBBoxHierarchyType(bBoxType); - renderer->setGridSize(FLAGS_tilesize, FLAGS_tilesize); renderer->init(pic, NULL, NULL, NULL, false, false); SkDebugf("%s %d times...\n", renderer->getConfigName().c_str(), numRepeats); diff --git a/tools/bench_pictures_cfg_helper.py b/tools/bench_pictures_cfg_helper.py index 2670d77548..c010f3b3aa 100644 --- a/tools/bench_pictures_cfg_helper.py +++ b/tools/bench_pictures_cfg_helper.py @@ -105,8 +105,3 @@ def RecordGridConfig(tile_x, tile_y, **kwargs): def PlaybackCreationGridConfig(tile_x, tile_y, **kwargs): return GridConfig(tile_x, tile_y, mode='playbackCreation') - - -def TileGridConfig(tile_x, tile_y, **kwargs): - return GridConfig(tile_x, tile_y, - **dict(TileArgs(tile_x, tile_y).items() + kwargs.items())) |