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

Side by Side Diff: tools/viewer/sk_app/unix/Window_unix.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
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 <tchar.h> 8 //#include <tchar.h>
9 9
10 #include "SkUtils.h" 10 #include "SkUtils.h"
11 #include "Timer.h" 11 #include "Timer.h"
12 #include "../GLWindowContext.h" 12 #include "../GLWindowContext.h"
13 #ifdef SK_VULKAN
13 #include "../VulkanWindowContext.h" 14 #include "../VulkanWindowContext.h"
15 #endif
14 #include "Window_unix.h" 16 #include "Window_unix.h"
15 17
16 extern "C" { 18 extern "C" {
17 #include "keysym2ucs.h" 19 #include "keysym2ucs.h"
18 } 20 }
19 #include <X11/Xutil.h> 21 #include <X11/Xutil.h>
20 #include <X11/XKBlib.h> 22 #include <X11/XKBlib.h>
21 23
22 namespace sk_app { 24 namespace sk_app {
23 25
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 } 271 }
270 272
271 bool Window_unix::attach(BackendType attachType, const DisplayParams& params) { 273 bool Window_unix::attach(BackendType attachType, const DisplayParams& params) {
272 this->initWindow(fDisplay, &params); 274 this->initWindow(fDisplay, &params);
273 275
274 ContextPlatformData_unix platformData; 276 ContextPlatformData_unix platformData;
275 platformData.fDisplay = fDisplay; 277 platformData.fDisplay = fDisplay;
276 platformData.fWindow = fWindow; 278 platformData.fWindow = fWindow;
277 platformData.fVisualInfo = fVisualInfo; 279 platformData.fVisualInfo = fVisualInfo;
278 switch (attachType) { 280 switch (attachType) {
281 #ifdef SK_VULKAN
279 case kVulkan_BackendType: 282 case kVulkan_BackendType:
280 fWindowContext = VulkanWindowContext::Create((void*)&platformData, p arams); 283 fWindowContext = VulkanWindowContext::Create((void*)&platformData, p arams);
281 break; 284 break;
282 285 #endif
283 case kNativeGL_BackendType: 286 case kNativeGL_BackendType:
284 default: 287 default:
285 fWindowContext = GLWindowContext::Create((void*)&platformData, param s); 288 fWindowContext = GLWindowContext::Create((void*)&platformData, param s);
286 break; 289 break;
287 } 290 }
288 291
289 return (SkToBool(fWindowContext)); 292 return (SkToBool(fWindowContext));
290 } 293 }
291 294
292 void Window_unix::onInval() { 295 void Window_unix::onInval() {
293 XEvent event; 296 XEvent event;
294 event.type = Expose; 297 event.type = Expose;
295 event.xexpose.send_event = True; 298 event.xexpose.send_event = True;
296 event.xexpose.display = fDisplay; 299 event.xexpose.display = fDisplay;
297 event.xexpose.window = fWindow; 300 event.xexpose.window = fWindow;
298 event.xexpose.x = 0; 301 event.xexpose.x = 0;
299 event.xexpose.y = 0; 302 event.xexpose.y = 0;
300 event.xexpose.width = fWidth; 303 event.xexpose.width = fWidth;
301 event.xexpose.height = fHeight; 304 event.xexpose.height = fHeight;
302 event.xexpose.count = 0; 305 event.xexpose.count = 0;
303 306
304 XSendEvent(fDisplay, fWindow, False, 0, &event); 307 XSendEvent(fDisplay, fWindow, False, 0, &event);
305 } 308 }
306 309
307 } // namespace sk_app 310 } // namespace sk_app
OLDNEW
« no previous file with comments | « tools/viewer/sk_app/unix/GLWindowContext_unix.cpp ('k') | tools/viewer/sk_app/win/Window_win.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698