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

Unified Diff: src/utils/win/SkWGL_win.cpp

Issue 1427583007: Assert when running SampleApp with msaa 16 on Windows 10 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/utils/win/SkWGL_win.cpp
diff --git a/src/utils/win/SkWGL_win.cpp b/src/utils/win/SkWGL_win.cpp
index ef07bea61e7bb2b6ac138c641d5d4febcd65799d..15d08564a6197a0f34753263698c6f0ad02a3643 100644
--- a/src/utils/win/SkWGL_win.cpp
+++ b/src/utils/win/SkWGL_win.cpp
@@ -123,6 +123,8 @@ int SkWGLExtensions::selectFormat(const int formats[],
int formatCount,
HDC dc,
int desiredSampleCount) const {
+ if (formatCount <= 0)
bsalomon 2015/11/03 18:28:14 We always use braces
+ return -1;
PixelFormat desiredFormat = {
0,
desiredSampleCount,
@@ -316,7 +318,7 @@ static void get_pixel_formats_to_try(HDC dc, const SkWGLExtensions& extensions,
int formats[64];
extensions.choosePixelFormat(dc, msaaIAttrs, fAttrs, 64, formats, &num);
num = SkTMin(num, 64U);
- formatsToTry[0] = extensions.selectFormat(formats, num, dc, msaaSampleCount);
+ formatsToTry[0] = num == 0 ? -1 : extensions.selectFormat(formats, num, dc, msaaSampleCount);
bsalomon 2015/11/03 18:28:14 We wrap lines at 100 (usually). Maybe rewrite with
}
// Get a non-MSAA format
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698