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

Unified Diff: tools/VisualBench/WrappedBenchmark.h

Issue 1421723004: Add visualbench option for device-independent fonts (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 | « tools/VisualBench/VisualStreamTimingModule.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/VisualBench/WrappedBenchmark.h
diff --git a/tools/VisualBench/WrappedBenchmark.h b/tools/VisualBench/WrappedBenchmark.h
index 6fac145d3aae70b20bb87c2c3a9c0e692a5cd05b..ffa0da342a8b314d496e41887e4079c0486f18b4 100644
--- a/tools/VisualBench/WrappedBenchmark.h
+++ b/tools/VisualBench/WrappedBenchmark.h
@@ -17,7 +17,11 @@
class WrappedBenchmark : public Benchmark {
public:
// Takes ownership of caller's ref on `bench`.
- explicit WrappedBenchmark(Benchmark* bench) : fBench(bench) {}
+ explicit WrappedBenchmark(const SkSurfaceProps& surfaceProps, Benchmark* bench)
+ : fSurfaceProps(surfaceProps)
+ , fBench(bench) {}
+
+ const SkSurfaceProps& surfaceProps() const { return fSurfaceProps; }
const char* onGetName() override { return fBench->getName(); }
const char* onGetUniqueName() override { return fBench->getUniqueName(); }
@@ -52,6 +56,7 @@ public:
private:
virtual SkSurface* setupOffScreen(SkCanvas*)=0;
+ SkSurfaceProps fSurfaceProps;
SkAutoTUnref<SkSurface> fOffScreen;
SkAutoTUnref<Benchmark> fBench;
};
@@ -59,11 +64,12 @@ private:
// Create a raster surface for off screen rendering
class CpuWrappedBenchmark : public WrappedBenchmark {
public:
- explicit CpuWrappedBenchmark(Benchmark* bench) : INHERITED(bench) {}
+ explicit CpuWrappedBenchmark(const SkSurfaceProps& surfaceProps, Benchmark* bench)
+ : INHERITED(surfaceProps, bench) {}
private:
SkSurface* setupOffScreen(SkCanvas* canvas) override {
- return SkSurface::NewRaster(canvas->imageInfo());
+ return SkSurface::NewRaster(canvas->imageInfo(), &this->surfaceProps());
}
typedef WrappedBenchmark INHERITED;
@@ -72,8 +78,9 @@ private:
// Create an MSAA & NVPR-enabled GPU backend
class NvprWrappedBenchmark : public WrappedBenchmark {
public:
- explicit NvprWrappedBenchmark(Benchmark* bench, int numSamples)
- : INHERITED(bench)
+ explicit NvprWrappedBenchmark(const SkSurfaceProps& surfaceProps, Benchmark* bench,
+ int numSamples)
+ : INHERITED(surfaceProps, bench)
, fNumSamples(numSamples) {}
private:
@@ -81,7 +88,8 @@ private:
return SkSurface::NewRenderTarget(canvas->getGrContext(),
SkSurface::kNo_Budgeted,
canvas->imageInfo(),
- fNumSamples);
+ fNumSamples,
+ &this->surfaceProps());
}
int fNumSamples;
« no previous file with comments | « tools/VisualBench/VisualStreamTimingModule.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698