aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@google.com>2018-07-25 13:28:44 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-25 18:17:26 +0000
commit48b649060c8d3ae104274703553d7c03a58f3ddd (patch)
tree6f29689578387a2c1234a6aeb89803d3f6924c59 /tools
parent1c94a8fabed7196e985a0ed81ce8325c8f606940 (diff)
remove SkThreadedBMPDevice and friends
It is unused, is becoming a maintainence burden and source of bugs, and takes up a lot of time on the *SAN bots. Change-Id: If383eb6e4838ca23140f9e16d518b1bfc655fa12 Reviewed-on: https://skia-review.googlesource.com/143307 Auto-Submit: Mike Klein <mtklein@google.com> Commit-Queue: Herb Derby <herb@google.com> Reviewed-by: Herb Derby <herb@google.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/viewer/Viewer.cpp56
-rw-r--r--tools/viewer/Viewer.h8
2 files changed, 1 insertions, 63 deletions
diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp
index ae77233c9f..8f1d7bbbc8 100644
--- a/tools/viewer/Viewer.cpp
+++ b/tools/viewer/Viewer.cpp
@@ -34,7 +34,6 @@
#include "SkSurface.h"
#include "SkTaskGroup.h"
#include "SkTestFontMgr.h"
-#include "SkThreadedBMPDevice.h"
#include "SkTo.h"
#include "SvgSlide.h"
#include "Viewer.h"
@@ -194,8 +193,6 @@ Viewer::Viewer(int argc, char** argv, void* platformData)
, fOffset{0.0f, 0.0f}
, fGestureDevice(GestureDevice::kNone)
, fPerspectiveMode(kPerspective_Off)
- , fTileCnt(0)
- , fThreadCnt(0)
{
SkGraphics::Init();
@@ -326,40 +323,6 @@ Viewer::Viewer(int argc, char** argv, void* platformData)
#endif
this->setBackend(newBackend);
});
- fCommands.addCommand('+', "Threaded Backend", "Increase tile count", [this]() {
- fTileCnt++;
- if (fThreadCnt == 0) {
- this->resetExecutor();
- }
- this->updateTitle();
- fWindow->inval();
- });
- fCommands.addCommand('-', "Threaded Backend", "Decrease tile count", [this]() {
- fTileCnt = SkTMax(0, fTileCnt - 1);
- if (fThreadCnt == 0) {
- this->resetExecutor();
- }
- this->updateTitle();
- fWindow->inval();
- });
- fCommands.addCommand('>', "Threaded Backend", "Increase thread count", [this]() {
- if (fTileCnt == 0) {
- return;
- }
- fThreadCnt = (fThreadCnt + 1) % fTileCnt;
- this->resetExecutor();
- this->updateTitle();
- fWindow->inval();
- });
- fCommands.addCommand('<', "Threaded Backend", "Decrease thread count", [this]() {
- if (fTileCnt == 0) {
- return;
- }
- fThreadCnt = (fThreadCnt + fTileCnt - 1) % fTileCnt;
- this->resetExecutor();
- this->updateTitle();
- fWindow->inval();
- });
fCommands.addCommand('K', "IO", "Save slide to SKP", [this]() {
fSaveToSKP = true;
fWindow->inval();
@@ -768,13 +731,6 @@ void Viewer::updateTitle() {
}
paintTitle.done();
- if (fTileCnt > 0) {
- title.appendf(" T%d", fTileCnt);
- if (fThreadCnt > 0) {
- title.appendf("/%d", fThreadCnt);
- }
- }
-
switch (fColorMode) {
case ColorMode::kLegacy:
title.append(" Legacy 8888");
@@ -1140,17 +1096,7 @@ void Viewer::drawSlide(SkCanvas* canvas) {
? SkSurface::MakeRaster(info, &props)
: canvas->makeSurface(info);
SkPixmap offscreenPixmap;
- if (fTileCnt > 0 && offscreenSurface->peekPixels(&offscreenPixmap)) {
- SkBitmap offscreenBitmap;
- offscreenBitmap.installPixels(offscreenPixmap);
- threadedCanvas =
- skstd::make_unique<SkCanvas>(
- sk_make_sp<SkThreadedBMPDevice>(
- offscreenBitmap, fTileCnt, fThreadCnt, fExecutor.get()));
- slideCanvas = threadedCanvas.get();
- } else {
- slideCanvas = offscreenSurface->getCanvas();
- }
+ slideCanvas = offscreenSurface->getCanvas();
}
std::unique_ptr<SkCanvas> xformCanvas = nullptr;
diff --git a/tools/viewer/Viewer.h b/tools/viewer/Viewer.h
index 6fdcd36675..f1ecaf4445 100644
--- a/tools/viewer/Viewer.h
+++ b/tools/viewer/Viewer.h
@@ -106,10 +106,6 @@ private:
SkMatrix computeMatrix();
SkPoint mapEvent(float x, float y);
- void resetExecutor() {
- fExecutor = SkExecutor::MakeFIFOThreadPool(fThreadCnt == 0 ? fTileCnt : fThreadCnt);
- }
-
sk_app::Window* fWindow;
StatsLayer fStatsLayer;
@@ -172,10 +168,6 @@ private:
SkTArray<std::function<void(void)>> fDeferredActions;
- int fTileCnt;
- int fThreadCnt;
- std::unique_ptr<SkExecutor> fExecutor;
-
SkPaint fPaint;
SkPaintFields fPaintOverrides;
bool fPixelGeometryOverrides = false;