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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 class GpuWrappedBenchmark : public WrappedBenchmark { | 98 class GpuWrappedBenchmark : public WrappedBenchmark { |
99 public: | 99 public: |
100 explicit GpuWrappedBenchmark(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 SkBudgeted::kNo, | 108 SkSurface::kNo_Budgeted, |
109 canvas->imageInfo(), | 109 canvas->imageInfo(), |
110 fNumSamples, | 110 fNumSamples, |
111 &this->surfaceProps())); | 111 &this->surfaceProps())); |
112 } | 112 } |
113 | 113 |
114 void onBlitToScreen(SkCanvas* canvas, int w, int h) override { | 114 void onBlitToScreen(SkCanvas* canvas, int w, int h) override { |
115 // We call copySurface directly on the underlying GPU surfaces for a mor
e efficient blit. | 115 // We call copySurface directly on the underlying GPU surfaces for a mor
e efficient blit. |
116 GrRenderTarget* dst, *src; | 116 GrRenderTarget* dst, *src; |
117 | 117 |
118 SkCanvas::LayerIter canvasIter(canvas, false); | 118 SkCanvas::LayerIter canvasIter(canvas, false); |
(...skipping 14 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 |