Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 8c277bd

Browse files
egdanielSkia Commit-Bot
authored andcommitted
Revert "Fix crash on windows viewer when starting in vulkan."
This reverts commit fcd6816. Reason for revert: going to do this a different way Original change's description: > Fix crash on windows viewer when starting in vulkan. > > setRequestedDisplayParams is called when setting up viewer before we've > inited the Window. On windows this tries to attach the Window for a given > backend. However, we haven't set fBackend yet. Later on we will directly > call attach. > > Change-Id: I4bd6586478f2b040e5913314c4e47e92fc893a60 > Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344756 > Reviewed-by: Brian Osman <[email protected]> > Commit-Queue: Greg Daniel <[email protected]> [email protected],[email protected] Change-Id: Ie4d33b557868e4906df9b7a3988072fdc79a19c7 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://skia-review.googlesource.com/c/skia/+/344897 Reviewed-by: Greg Daniel <[email protected]> Commit-Queue: Greg Daniel <[email protected]>
1 parent 0263bff commit 8c277bd

File tree

7 files changed

+2
-15
lines changed

7 files changed

+2
-15
lines changed

tools/sk_app/Window.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ class Window {
5252
virtual bool scaleContentToFit() const { return false; }
5353

5454
enum BackendType {
55-
kUnknown_BackendType,
5655
#ifdef SK_GL
5756
kNativeGL_BackendType,
5857
#endif

tools/sk_app/android/Window_android.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,6 @@ void Window_android::initDisplay(ANativeWindow* window) {
6666
window_context_factory::MakeVulkanForAndroid(window, fRequestedDisplayParams);
6767
break;
6868
#endif
69-
case kUnknown_BackendType:
70-
SkUNREACHABLE;
7169
}
7270
this->onBackendCreated();
7371
}

tools/sk_app/ios/Window_ios.mm

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,6 @@ - (WindowViewController*)initWithWindow:(sk_app::Window_ios*)initWindow;
100100
case kRaster_BackendType:
101101
fWindowContext = MakeRasterForIOS(info, fRequestedDisplayParams);
102102
break;
103-
case kUnknown_BackendType:
104-
SkUNREACHABLE;
105103
}
106104
this->onBackendCreated();
107105

tools/sk_app/mac/Window_mac.mm

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,6 @@ - (MainView*)initWithWindow:(sk_app::Window_mac*)initWindow;
148148
case kRaster_BackendType:
149149
fWindowContext = MakeRasterForMac(info, fRequestedDisplayParams);
150150
break;
151-
case kUnknown_BackendType:
152-
SkUNREACHABLE;
153151
}
154152
this->onBackendCreated();
155153

tools/sk_app/unix/Window_unix.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,6 @@ bool Window_unix::attach(BackendType attachType) {
418418
fWindowContext =
419419
window_context_factory::MakeRasterForXlib(winInfo, fRequestedDisplayParams);
420420
break;
421-
case kUnknown_BackendType:
422-
SkUNREACHABLE;
423421
}
424422
this->onBackendCreated();
425423

tools/sk_app/win/Window_win.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,6 @@ bool Window_win::attach(BackendType attachType) {
383383
window_context_factory::MakeD3D12ForWin(fHWnd, fRequestedDisplayParams);
384384
break;
385385
#endif
386-
case kUnknown_BackendType:
387-
SkUNREACHABLE;
388386
}
389387
this->onBackendCreated();
390388

@@ -405,9 +403,7 @@ void Window_win::setRequestedDisplayParams(const DisplayParams& params, bool all
405403
fWindowContext = nullptr;
406404
this->closeWindow();
407405
this->init(fHInstance);
408-
if (fBackend != kUnknown_BackendType) {
409-
this->attach(fBackend);
410-
}
406+
this->attach(fBackend);
411407
}
412408

413409
INHERITED::setRequestedDisplayParams(params, allowReattach);

tools/sk_app/win/Window_win.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Window_win : public Window {
3535

3636
HINSTANCE fHInstance;
3737
HWND fHWnd;
38-
BackendType fBackend = kUnknown_BackendType;
38+
BackendType fBackend;
3939

4040
using INHERITED = Window;
4141
};

0 commit comments

Comments
 (0)