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

Unified Diff: tools/gpu/vk/VkTestContext.h

Issue 1964243003: Add base class for GLTestContext and add new subclass VkTestContext. (Closed) Base URL: https://chromium.googlesource.com/skia.git@ContextInfo
Patch Set: undef more macros Created 4 years, 7 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
Index: tools/gpu/vk/VkTestContext.h
diff --git a/tools/gpu/vk/VkTestContext.h b/tools/gpu/vk/VkTestContext.h
new file mode 100644
index 0000000000000000000000000000000000000000..4e4f6aa493dccf1cdbb785d92b5c27a50337ee5a
--- /dev/null
+++ b/tools/gpu/vk/VkTestContext.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright 2016 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef VkTestContext_DEFINED
+#define VkTestContext_DEFINED
+
+#include "TestContext.h"
+#include "vk/GrVkBackendContext.h"
+
+#ifdef SK_VULKAN
+
+namespace sk_gpu_test {
+class VkTestContext : public TestContext {
+public:
+ bool isValid() const override { return NULL != this->vk(); }
+
+ const GrVkInterface* vk() const { return fVk->fInterface; };
+
+protected:
+ VkTestContext(sk_sp<const GrVkBackendContext> vk) : fVk(std::move(vk)) {};
+
+ sk_sp<const GrVkBackendContext> fVk;
+
+private:
+ typedef TestContext INHERITED;
+};
+
+/**
+ * Creates Vk context object bound to the native Vk library.
+ */
+VkTestContext* CreatePlatformVkTestContext();
+
+} // namespace sk_gpu_test
+
+#endif
+
+#endif

Powered by Google App Engine
This is Rietveld 408576698