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 "SkUtils.h" | 8 #include "SkUtils.h" |
9 #include "Timer.h" | 9 #include "Timer.h" |
10 #include "WindowContextFactory_mac.h" | 10 #include "WindowContextFactory_mac.h" |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 void Window_mac::show() { | 219 void Window_mac::show() { |
220 SDL_ShowWindow(fWindow); | 220 SDL_ShowWindow(fWindow); |
221 } | 221 } |
222 | 222 |
223 bool Window_mac::attach(BackendType attachType, const DisplayParams& params) { | 223 bool Window_mac::attach(BackendType attachType, const DisplayParams& params) { |
224 this->initWindow(¶ms); | 224 this->initWindow(¶ms); |
225 | 225 |
226 window_context_factory::MacWindowInfo info; | 226 window_context_factory::MacWindowInfo info; |
227 info.fWindow = fWindow; | 227 info.fWindow = fWindow; |
228 switch (attachType) { | 228 switch (attachType) { |
| 229 case kRaster_BackendType: |
| 230 fWindowContext = NewRasterForMac(info, params); |
| 231 break; |
| 232 |
229 case kNativeGL_BackendType: | 233 case kNativeGL_BackendType: |
230 default: | 234 default: |
231 fWindowContext = NewGLForMac(info, params); | 235 fWindowContext = NewGLForMac(info, params); |
232 break; | 236 break; |
233 } | 237 } |
234 | 238 |
235 return (SkToBool(fWindowContext)); | 239 return (SkToBool(fWindowContext)); |
236 } | 240 } |
237 | 241 |
238 void Window_mac::onInval() { | 242 void Window_mac::onInval() { |
239 SDL_Event sdlevent; | 243 SDL_Event sdlevent; |
240 sdlevent.type = SDL_WINDOWEVENT; | 244 sdlevent.type = SDL_WINDOWEVENT; |
241 sdlevent.window.windowID = fWindowID; | 245 sdlevent.window.windowID = fWindowID; |
242 sdlevent.window.event = SDL_WINDOWEVENT_EXPOSED; | 246 sdlevent.window.event = SDL_WINDOWEVENT_EXPOSED; |
243 SDL_PushEvent(&sdlevent); | 247 SDL_PushEvent(&sdlevent); |
244 } | 248 } |
245 | 249 |
246 } // namespace sk_app | 250 } // namespace sk_app |
OLD | NEW |