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

Unified Diff: tools/skpbench/skpbench.cpp

Issue 2383383002: Move GPU fences into sk_gpu_test (Closed)
Patch Set: fix for windowsx Created 4 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/gpu/vk/VkTestContext.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/skpbench/skpbench.cpp
diff --git a/tools/skpbench/skpbench.cpp b/tools/skpbench/skpbench.cpp
index 734a1b79b2ad0fd09cd234041136794f9a6ee470..adb6af0b146669f6a1c44fa253f2ad7a5e7614a6 100644
--- a/tools/skpbench/skpbench.cpp
+++ b/tools/skpbench/skpbench.cpp
@@ -33,6 +33,10 @@
* Currently, only GPU configs are supported.
*/
+using sk_gpu_test::PlatformFence;
+using sk_gpu_test::kInvalidPlatformFence;
+using sk_gpu_test::FenceSync;
+
DEFINE_int32(duration, 5000, "number of milliseconds to run the benchmark");
DEFINE_int32(sampleMs, 50, "minimum duration of a sample");
DEFINE_bool(fps, false, "use fps instead of ms");
@@ -62,7 +66,7 @@ struct Sample {
class GpuSync {
public:
- GpuSync(const SkGpuFenceSync* fenceSync);
+ GpuSync(const FenceSync* fenceSync);
~GpuSync();
void syncToPreviousFrame();
@@ -70,8 +74,8 @@ public:
private:
void updateFence();
- const SkGpuFenceSync* const fFenceSync;
- SkPlatformGpuFence fFence;
+ const FenceSync* const fFenceSync;
+ PlatformFence fFence;
};
enum class ExitErr {
@@ -88,7 +92,7 @@ static bool mkdir_p(const SkString& name);
static SkString join(const SkCommandLineFlags::StringArray&);
static void exitf(ExitErr, const char* format, ...);
-static void run_benchmark(const SkGpuFenceSync* fenceSync, SkCanvas* canvas, const SkPicture* skp,
+static void run_benchmark(const FenceSync* fenceSync, SkCanvas* canvas, const SkPicture* skp,
std::vector<Sample>* samples) {
using clock = Sample::clock;
const clock::duration sampleDuration = std::chrono::milliseconds(FLAGS_sampleMs);
@@ -296,7 +300,7 @@ static void exitf(ExitErr err, const char* format, ...) {
exit((int)err);
}
-GpuSync::GpuSync(const SkGpuFenceSync* fenceSync)
+GpuSync::GpuSync(const FenceSync* fenceSync)
: fFenceSync(fenceSync) {
this->updateFence();
}
@@ -306,7 +310,7 @@ GpuSync::~GpuSync() {
}
void GpuSync::syncToPreviousFrame() {
- if (kInvalidPlatformGpuFence == fFence) {
+ if (kInvalidPlatformFence == fFence) {
exitf(ExitErr::kSoftware, "attempted to sync with invalid fence");
}
if (!fFenceSync->waitFence(fFence)) {
@@ -318,7 +322,7 @@ void GpuSync::syncToPreviousFrame() {
void GpuSync::updateFence() {
fFence = fFenceSync->insertFence();
- if (kInvalidPlatformGpuFence == fFence) {
+ if (kInvalidPlatformFence == fFence) {
exitf(ExitErr::kUnavailable, "failed to insert fence");
}
}
« no previous file with comments | « tools/gpu/vk/VkTestContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698