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

Side by Side Diff: tools/viewer/sk_app/mac/Window_mac.cpp

Issue 2228883003: Add RasterWindowContext_mac (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comment; enable backend switching 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/mac/WindowContextFactory_mac.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 "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
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(&params); 224 this->initWindow(&params);
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
OLDNEW
« no previous file with comments | « tools/viewer/sk_app/mac/WindowContextFactory_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698