aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/utils/win
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-02-03 00:25:12 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-02-03 00:25:20 +0000
commit3a2cc2c2ec124de36d2544b2a523ef1dd317ca32 (patch)
treedf3154eabde3275c5a6b88f66233b9a3984bd04f /src/utils/win
parent5bb82cbecd740d21b92e8d2944280ab6eb6af7a6 (diff)
Revert "Revert "Revert "Revert "Revert "Redefine the meaning of sample counts in GPU backend."""""
This reverts commit 5bb82cbecd740d21b92e8d2944280ab6eb6af7a6. Reason for revert: <INSERT REASONING HERE> Original change's description: > Revert "Revert "Revert "Revert "Redefine the meaning of sample counts in GPU backend."""" > > This reverts commit 18c52a7b52211de5d0dcd86dc048adef758c6c75. > > Also relands "More sample count cleanup:" and "Add new GrContext queries for imagability, surfacability, and max sample count of color types" > > > Bug: skia: > Change-Id: I4028105a3a1f16ce3944e134619eb6245af6b947 > Reviewed-on: https://skia-review.googlesource.com/102940 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Brian Salomon <bsalomon@google.com> TBR=egdaniel@google.com,bsalomon@google.com Change-Id: Idee23be2f1719f0bdc9305043e95a2d589bee8d1 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/103220 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/utils/win')
-rw-r--r--src/utils/win/SkWGL.h8
-rw-r--r--src/utils/win/SkWGL_win.cpp7
2 files changed, 4 insertions, 11 deletions
diff --git a/src/utils/win/SkWGL.h b/src/utils/win/SkWGL.h
index cd19f2eeba..c6c9479abe 100644
--- a/src/utils/win/SkWGL.h
+++ b/src/utils/win/SkWGL.h
@@ -83,8 +83,7 @@ public:
* priority are:
* * Choose formats with the smallest sample count that is >=
* desiredSampleCount (or the largest sample count if all formats have
- * fewer samples than desiredSampleCount.) If desiredSampleCount is 1 then
- * all msaa formats are excluded from consideration.
+ * fewer samples than desiredSampleCount.)
* * Choose formats with the fewest color samples when coverage sampling
* is available.
* * If the above rules leave multiple formats, choose the one that
@@ -131,9 +130,8 @@ enum SkWGLContextRequest {
/**
* Helper to create an OpenGL context for a DC using WGL. Configs with a sample count >= to
* msaaSampleCount are preferred but if none is available then a context with a lower sample count
- * (including non-MSAA) will be created. If msaaSampleCount is 1 then this will fail if a non-msaa
- * context cannot be created. If preferCoreProfile is true but a core profile cannot be created
- * then a compatible profile context will be created.
+ * (including non-MSAA) will be created. If preferCoreProfile is true but a core profile cannot be
+ * created then a compatible profile context will be created.
*/
HGLRC SkCreateWGLContext(HDC dc, int msaaSampleCount, bool deepColor, SkWGLContextRequest context,
HGLRC shareContext = nullptr);
diff --git a/src/utils/win/SkWGL_win.cpp b/src/utils/win/SkWGL_win.cpp
index 441d7a4ebb..b7c89944e0 100644
--- a/src/utils/win/SkWGL_win.cpp
+++ b/src/utils/win/SkWGL_win.cpp
@@ -126,7 +126,6 @@ int SkWGLExtensions::selectFormat(const int formats[],
int formatCount,
HDC dc,
int desiredSampleCount) const {
- SkASSERT(desiredSampleCount >= 1);
if (formatCount <= 0) {
return -1;
}
@@ -147,7 +146,7 @@ int SkWGLExtensions::selectFormat(const int formats[],
&kQueryAttr,
&numSamples);
rankedFormats[i].fFormat = formats[i];
- rankedFormats[i].fSampleCnt = SkTMax(1, numSamples);
+ rankedFormats[i].fSampleCnt = numSamples;
rankedFormats[i].fChoosePixelFormatRank = i;
}
SkTQSort(rankedFormats.begin(),
@@ -160,10 +159,6 @@ int SkWGLExtensions::selectFormat(const int formats[],
if (idx < 0) {
idx = ~idx;
}
- // If the caller asked for non-MSAA fail if the closest format has MSAA.
- if (desiredSampleCount == 1 && rankedFormats[idx].fSampleCnt != 1) {
- return -1;
- }
return rankedFormats[idx].fFormat;
}