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

Side by Side Diff: tools/VisualBench/WrappedBenchmark.h

Issue 1473253002: Add offscreen mode to visualbench (Closed) Base URL: https://skia.googlesource.com/skia.git@visualbench_blit2
Patch Set: rebase Created 5 years 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 unified diff | Download patch
« no previous file with comments | « tools/VisualBench/VisualLightweightBenchModule.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef WrappedBenchmark_DEFINED 8 #ifndef WrappedBenchmark_DEFINED
9 #define WrappedBenchmark_DEFINED 9 #define WrappedBenchmark_DEFINED
10 10
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 SkPaint blitPaint; 88 SkPaint blitPaint;
89 blitPaint.setXfermodeMode(SkXfermode::kSrc_Mode); 89 blitPaint.setXfermodeMode(SkXfermode::kSrc_Mode);
90 canvas->drawImageRect(image, SkIRect::MakeWH(w, h), 90 canvas->drawImageRect(image, SkIRect::MakeWH(w, h),
91 SkRect::MakeWH(SkIntToScalar(w), SkIntToScalar(h)) , &blitPaint); 91 SkRect::MakeWH(SkIntToScalar(w), SkIntToScalar(h)) , &blitPaint);
92 } 92 }
93 93
94 typedef WrappedBenchmark INHERITED; 94 typedef WrappedBenchmark INHERITED;
95 }; 95 };
96 96
97 // Create an MSAA & NVPR-enabled GPU backend 97 // Create an MSAA & NVPR-enabled GPU backend
98 class NvprWrappedBenchmark : public WrappedBenchmark { 98 class GpuWrappedBenchmark : public WrappedBenchmark {
99 public: 99 public:
100 explicit NvprWrappedBenchmark(const SkSurfaceProps& surfaceProps, Benchmark* bench, 100 explicit GpuWrappedBenchmark(const SkSurfaceProps& surfaceProps, Benchmark* bench,
101 int numSamples) 101 int numSamples)
102 : INHERITED(surfaceProps, bench) 102 : INHERITED(surfaceProps, bench)
103 , fNumSamples(numSamples) {} 103 , fNumSamples(numSamples) {}
104 104
105 private: 105 private:
106 void setupOffScreen(SkCanvas* canvas) override { 106 void setupOffScreen(SkCanvas* canvas) override {
107 fOffScreen.reset(SkSurface::NewRenderTarget(canvas->getGrContext(), 107 fOffScreen.reset(SkSurface::NewRenderTarget(canvas->getGrContext(),
108 SkSurface::kNo_Budgeted, 108 SkSurface::kNo_Budgeted,
109 canvas->imageInfo(), 109 canvas->imageInfo(),
110 fNumSamples, 110 fNumSamples,
111 &this->surfaceProps())); 111 &this->surfaceProps()));
(...skipping 21 matching lines...) Expand all
133 offscreenIter.next(); 133 offscreenIter.next();
134 SkASSERT(offscreenIter.done()); 134 SkASSERT(offscreenIter.done());
135 #endif 135 #endif
136 } 136 }
137 137
138 int fNumSamples; 138 int fNumSamples;
139 typedef WrappedBenchmark INHERITED; 139 typedef WrappedBenchmark INHERITED;
140 }; 140 };
141 141
142 #endif //WrappedBenchmark_DEFINED 142 #endif //WrappedBenchmark_DEFINED
OLDNEW
« no previous file with comments | « tools/VisualBench/VisualLightweightBenchModule.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698