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

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

Issue 2169543002: Use Windowing system-specific WindowContext factories. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: more xlib Created 4 years, 4 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/win/Window_win.h ('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 "WindowContextFactory_win.h"
16 #ifdef SK_VULKAN 16 #ifdef SK_VULKAN
17 #include "../VulkanWindowContext.h" 17 #include "../VulkanWindowContext.h"
18 #endif 18 #endif
19 19
20 namespace sk_app { 20 namespace sk_app {
21 21
22 Window* Window::CreateNativeWindow(void* platformData) { 22 Window* Window::CreateNativeWindow(void* platformData) {
23 HINSTANCE hInstance = (HINSTANCE)platformData; 23 HINSTANCE hInstance = (HINSTANCE)platformData;
24 24
25 Window_win* window = new Window_win(); 25 Window_win* window = new Window_win();
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 void Window_win::setTitle(const char* title) { 261 void Window_win::setTitle(const char* title) {
262 SetWindowTextA(fHWnd, title); 262 SetWindowTextA(fHWnd, title);
263 } 263 }
264 264
265 void Window_win::show() { 265 void Window_win::show() {
266 ShowWindow(fHWnd, SW_SHOW); 266 ShowWindow(fHWnd, SW_SHOW);
267 } 267 }
268 268
269 269
270 bool Window_win::attach(BackendType attachType, const DisplayParams& params) { 270 bool Window_win::attach(BackendType attachType, const DisplayParams& params) {
271 ContextPlatformData_win platformData;
272 platformData.fHInstance = fHInstance;
273 platformData.fHWnd = fHWnd;
274
275 switch (attachType) { 271 switch (attachType) {
276 case kNativeGL_BackendType: 272 case kNativeGL_BackendType:
277 default: 273 default:
278 fWindowContext = GLWindowContext::Create((void*)&platformData, param s); 274 fWindowContext = window_context_factory::NewGLForWin(fHWnd, params);
279 break; 275 break;
280 #ifdef SK_VULKAN 276 #ifdef SK_VULKAN
281 case kVulkan_BackendType: 277 case kVulkan_BackendType:
282 fWindowContext = VulkanWindowContext::Create((void*)&platformData, p arams); 278 fWindowContext = window_context_factory::NewVulkanForWin(fHWnd, para ms);
283 break; 279 break;
284 #endif 280 #endif
285 } 281 }
286 282
287 return (SkToBool(fWindowContext)); 283 return (SkToBool(fWindowContext));
288 } 284 }
289 285
290 void Window_win::onInval() { 286 void Window_win::onInval() {
291 InvalidateRect(fHWnd, nullptr, false); 287 InvalidateRect(fHWnd, nullptr, false);
292 } 288 }
293 289
294 } // namespace sk_app 290 } // namespace sk_app
OLDNEW
« 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