Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 #ifdef SK_VULKAN |
| 14 #include "../VulkanWindowContext.h" | 14 #include "../VulkanWindowContext.h" |
| 15 #endif | 15 #endif |
| 16 #include "Window_unix.h" | 16 #include "Window_unix.h" |
| 17 #include "RasterWindowContext_unix.h" | |
| 17 | 18 |
| 18 extern "C" { | 19 extern "C" { |
| 19 #include "keysym2ucs.h" | 20 #include "keysym2ucs.h" |
| 20 } | 21 } |
| 21 #include <X11/Xutil.h> | 22 #include <X11/Xutil.h> |
| 22 #include <X11/XKBlib.h> | 23 #include <X11/XKBlib.h> |
| 23 | 24 |
| 24 namespace sk_app { | 25 namespace sk_app { |
| 25 | 26 |
| 26 SkTDynamicHash<Window_unix, XWindow> Window_unix::gWindowMap; | 27 SkTDynamicHash<Window_unix, XWindow> Window_unix::gWindowMap; |
| (...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 276 ContextPlatformData_unix platformData; | 277 ContextPlatformData_unix platformData; |
| 277 platformData.fDisplay = fDisplay; | 278 platformData.fDisplay = fDisplay; |
| 278 platformData.fWindow = fWindow; | 279 platformData.fWindow = fWindow; |
| 279 platformData.fVisualInfo = fVisualInfo; | 280 platformData.fVisualInfo = fVisualInfo; |
| 280 switch (attachType) { | 281 switch (attachType) { |
| 281 #ifdef SK_VULKAN | 282 #ifdef SK_VULKAN |
| 282 case kVulkan_BackendType: | 283 case kVulkan_BackendType: |
| 283 fWindowContext = VulkanWindowContext::Create((void*)&platformData, p arams); | 284 fWindowContext = VulkanWindowContext::Create((void*)&platformData, p arams); |
| 284 break; | 285 break; |
| 285 #endif | 286 #endif |
| 287 case kRaster_BackendType: | |
| 288 fWindowContext = RasterWindowContext_unix::Create(platformData.fDisp lay, | |
|
jvanverth1
2016/07/19 21:18:11
Is there a reason you're using RasterWindowContext
| |
| 289 platformData.fWind ow, params); | |
| 290 break; | |
| 286 case kNativeGL_BackendType: | 291 case kNativeGL_BackendType: |
| 287 default: | |
| 288 fWindowContext = GLWindowContext::Create((void*)&platformData, param s); | 292 fWindowContext = GLWindowContext::Create((void*)&platformData, param s); |
| 289 break; | 293 break; |
| 290 } | 294 } |
| 291 | 295 |
| 292 return (SkToBool(fWindowContext)); | 296 return (SkToBool(fWindowContext)); |
| 293 } | 297 } |
| 294 | 298 |
| 295 void Window_unix::onInval() { | 299 void Window_unix::onInval() { |
| 296 XEvent event; | 300 XEvent event; |
| 297 event.type = Expose; | 301 event.type = Expose; |
| 298 event.xexpose.send_event = True; | 302 event.xexpose.send_event = True; |
| 299 event.xexpose.display = fDisplay; | 303 event.xexpose.display = fDisplay; |
| 300 event.xexpose.window = fWindow; | 304 event.xexpose.window = fWindow; |
| 301 event.xexpose.x = 0; | 305 event.xexpose.x = 0; |
| 302 event.xexpose.y = 0; | 306 event.xexpose.y = 0; |
| 303 event.xexpose.width = fWidth; | 307 event.xexpose.width = fWidth; |
| 304 event.xexpose.height = fHeight; | 308 event.xexpose.height = fHeight; |
| 305 event.xexpose.count = 0; | 309 event.xexpose.count = 0; |
| 306 | 310 |
| 307 XSendEvent(fDisplay, fWindow, False, 0, &event); | 311 XSendEvent(fDisplay, fWindow, False, 0, &event); |
| 308 } | 312 } |
| 309 | 313 |
| 310 } // namespace sk_app | 314 } // namespace sk_app |
| OLD | NEW |