OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |