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

Unified Diff: tools/viewer/sk_app/win/Window_win.cpp

Issue 1978573003: Add OpenGL context to Viewer. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase to ToT 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
« no previous file with comments | « tools/viewer/sk_app/win/Window_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/viewer/sk_app/win/Window_win.cpp
diff --git a/tools/viewer/sk_app/win/Window_win.cpp b/tools/viewer/sk_app/win/Window_win.cpp
index 241a41cabaac7d7a20a3ef3bef2f493b0c85e22d..8355c7295a927903ea700bb7c73fca089084a64c 100644
--- a/tools/viewer/sk_app/win/Window_win.cpp
+++ b/tools/viewer/sk_app/win/Window_win.cpp
@@ -12,7 +12,8 @@
#include <windowsx.h>
#include "SkUtils.h"
-#include "VulkanWindowContext_win.h"
+#include "../GLWindowContext.h"
+#include "../VulkanWindowContext.h"
namespace sk_app {
@@ -264,16 +265,21 @@ void Window_win::show() {
}
-bool Window_win::attach(BackEndType attachType, const DisplayParams& params) {
- if (kVulkan_BackendType != attachType) {
- return false;
- }
-
+bool Window_win::attach(BackendType attachType, const DisplayParams& params) {
ContextPlatformData_win platformData;
platformData.fHInstance = fHInstance;
platformData.fHWnd = fHWnd;
- fWindowContext = VulkanWindowContext::Create((void*)&platformData, params);
+ switch (attachType) {
+ case kNativeGL_BackendType:
+ default:
+ fWindowContext = GLWindowContext::Create((void*)&platformData, params);
+ break;
+
+ case kVulkan_BackendType:
+ fWindowContext = VulkanWindowContext::Create((void*)&platformData, params);
+ break;
+ }
return (SkToBool(fWindowContext));
}
« no previous file with comments | « tools/viewer/sk_app/win/Window_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698