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

Unified Diff: dm/DMBenchTask.cpp

Issue 399463003: Remove benches from DM. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 5 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/DMBenchTask.h ('k') | dm/DMUtil.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dm/DMBenchTask.cpp
diff --git a/dm/DMBenchTask.cpp b/dm/DMBenchTask.cpp
deleted file mode 100644
index 9bdbbf29744c0f1d08943ebd75b9d6f7ff47008d..0000000000000000000000000000000000000000
--- a/dm/DMBenchTask.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-#include "DMBenchTask.h"
-#include "DMUtil.h"
-#include "SkSurface.h"
-
-namespace DM {
-
-static SkString bench_name(const char* name, const char* config) {
- SkString result("bench ");
- result.appendf("%s_%s", name, config);
- return result;
-}
-
-NonRenderingBenchTask::NonRenderingBenchTask(const char* config,
- Reporter* reporter,
- TaskRunner* tasks,
- BenchRegistry::Factory factory)
- : CpuTask(reporter, tasks)
- , fBench(factory(NULL))
- , fName(bench_name(fBench->getName(), config)) {}
-
-CpuBenchTask::CpuBenchTask(const char* config,
- Reporter* reporter,
- TaskRunner* tasks,
- BenchRegistry::Factory factory,
- SkColorType colorType)
- : CpuTask(reporter, tasks)
- , fBench(factory(NULL))
- , fName(bench_name(fBench->getName(), config))
- , fColorType(colorType) {}
-
-GpuBenchTask::GpuBenchTask(const char* config,
- Reporter* reporter,
- TaskRunner* tasks,
- BenchRegistry::Factory factory,
- GrContextFactory::GLContextType contextType,
- GrGLStandard gpuAPI,
- int sampleCount)
- : GpuTask(reporter, tasks)
- , fBench(factory(NULL))
- , fName(bench_name(fBench->getName(), config))
- , fContextType(contextType)
- , fGpuAPI(gpuAPI)
- , fSampleCount(sampleCount) {}
-
-bool NonRenderingBenchTask::shouldSkip() const {
- return !fBench->isSuitableFor(Benchmark::kNonRendering_Backend);
-}
-
-bool CpuBenchTask::shouldSkip() const {
- return !fBench->isSuitableFor(Benchmark::kRaster_Backend);
-}
-
-bool GpuBenchTask::shouldSkip() const {
- return kGPUDisabled || !fBench->isSuitableFor(Benchmark::kGPU_Backend);
-}
-
-static void draw_raster(Benchmark* bench, SkColorType colorType) {
- SkBitmap bitmap;
- AllocatePixels(colorType, bench->getSize().x(), bench->getSize().y(), &bitmap);
- SkCanvas canvas(bitmap);
-
- bench->preDraw();
- bench->draw(1, &canvas);
-}
-
-void NonRenderingBenchTask::draw() {
- draw_raster(fBench.get(), kN32_SkColorType);
-}
-
-void CpuBenchTask::draw() {
- draw_raster(fBench.get(), fColorType);
-}
-
-void GpuBenchTask::draw(GrContextFactory* grFactory) {
- SkImageInfo info = SkImageInfo::Make(fBench->getSize().x(),
- fBench->getSize().y(),
- kN32_SkColorType,
- kPremul_SkAlphaType);
- SkAutoTUnref<SkSurface> surface(NewGpuSurface(grFactory, fContextType, fGpuAPI, info,
- fSampleCount));
- if (!surface) {
- this->fail("Could not create context for the config and the api.");
- return;
- }
- fBench->preDraw();
- fBench->draw(1, surface->getCanvas());
-}
-
-} // namespace DM
« no previous file with comments | « dm/DMBenchTask.h ('k') | dm/DMUtil.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698