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

Side by Side Diff: tools/viewer/sk_app/win/Window_win.cpp

Issue 2067023002: Enable viewer in non-Vulkan builds (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Only include XCB if using Vulkan Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « tools/viewer/sk_app/unix/Window_unix.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 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 #include "Window_win.h" 8 #include "Window_win.h"
9 9
10 #include <tchar.h> 10 #include <tchar.h>
11 #include <windows.h> 11 #include <windows.h>
12 #include <windowsx.h> 12 #include <windowsx.h>
13 13
14 #include "SkUtils.h" 14 #include "SkUtils.h"
15 #include "../GLWindowContext.h" 15 #include "../GLWindowContext.h"
16 #ifdef SK_VULKAN
16 #include "../VulkanWindowContext.h" 17 #include "../VulkanWindowContext.h"
18 #endif
17 19
18 namespace sk_app { 20 namespace sk_app {
19 21
20 Window* Window::CreateNativeWindow(void* platformData) { 22 Window* Window::CreateNativeWindow(void* platformData) {
21 HINSTANCE hInstance = (HINSTANCE)platformData; 23 HINSTANCE hInstance = (HINSTANCE)platformData;
22 24
23 Window_win* window = new Window_win(); 25 Window_win* window = new Window_win();
24 if (!window->init(hInstance)) { 26 if (!window->init(hInstance)) {
25 delete window; 27 delete window;
26 return nullptr; 28 return nullptr;
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 bool Window_win::attach(BackendType attachType, const DisplayParams& params) { 270 bool Window_win::attach(BackendType attachType, const DisplayParams& params) {
269 ContextPlatformData_win platformData; 271 ContextPlatformData_win platformData;
270 platformData.fHInstance = fHInstance; 272 platformData.fHInstance = fHInstance;
271 platformData.fHWnd = fHWnd; 273 platformData.fHWnd = fHWnd;
272 274
273 switch (attachType) { 275 switch (attachType) {
274 case kNativeGL_BackendType: 276 case kNativeGL_BackendType:
275 default: 277 default:
276 fWindowContext = GLWindowContext::Create((void*)&platformData, param s); 278 fWindowContext = GLWindowContext::Create((void*)&platformData, param s);
277 break; 279 break;
278 280 #ifdef SK_VULKAN
279 case kVulkan_BackendType: 281 case kVulkan_BackendType:
280 fWindowContext = VulkanWindowContext::Create((void*)&platformData, p arams); 282 fWindowContext = VulkanWindowContext::Create((void*)&platformData, p arams);
281 break; 283 break;
284 #endif
282 } 285 }
283 286
284 return (SkToBool(fWindowContext)); 287 return (SkToBool(fWindowContext));
285 } 288 }
286 289
287 void Window_win::onInval() { 290 void Window_win::onInval() {
288 InvalidateRect(fHWnd, nullptr, false); 291 InvalidateRect(fHWnd, nullptr, false);
289 } 292 }
290 293
291 } // namespace sk_app 294 } // namespace sk_app
OLDNEW
« no previous file with comments | « tools/viewer/sk_app/unix/Window_unix.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698