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

Unified Diff: src/gpu/gl/GrGLCaps.cpp

Issue 23882009: Rip out CSAA support (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 3 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 | « src/gpu/gl/GrGLCaps.h ('k') | src/gpu/gl/GrGpuGL.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLCaps.cpp
diff --git a/src/gpu/gl/GrGLCaps.cpp b/src/gpu/gl/GrGLCaps.cpp
index 1488e75c293c4af9f1f8032ad9d75e6bb0d65157..1ff2785390d53d8cdf2c0964588a229f52006b93 100644
--- a/src/gpu/gl/GrGLCaps.cpp
+++ b/src/gpu/gl/GrGLCaps.cpp
@@ -24,7 +24,6 @@ void GrGLCaps::reset() {
fStencilFormats.reset();
fStencilVerifiedColorConfigs.reset();
fMSFBOType = kNone_MSFBOType;
- fCoverageAAType = kNone_CoverageAAType;
fFBFetchType = kNone_FBFetchType;
fMaxFragmentUniformVectors = 0;
fMaxVertexAttributes = 0;
@@ -65,8 +64,6 @@ GrGLCaps& GrGLCaps::operator = (const GrGLCaps& caps) {
fMaxFragmentTextureUnits = caps.fMaxFragmentTextureUnits;
fMaxFixedFunctionTextureCoords = caps.fMaxFixedFunctionTextureCoords;
fMSFBOType = caps.fMSFBOType;
- fCoverageAAType = caps.fCoverageAAType;
- fMSAACoverageModes = caps.fMSAACoverageModes;
fFBFetchType = caps.fFBFetchType;
fRGBA8RenderbufferSupport = caps.fRGBA8RenderbufferSupport;
fBGRAFormatSupport = caps.fBGRAFormatSupport;
@@ -368,20 +365,6 @@ bool GrGLCaps::readPixelsSupported(const GrGLInterface* intf,
return (GrGLenum)otherFormat == format && (GrGLenum)otherType == type;
}
-namespace {
-bool cov_mode_less(const GrGLCaps::MSAACoverageMode& left,
- const GrGLCaps::MSAACoverageMode& right) {
- if (left.fCoverageSampleCnt < right.fCoverageSampleCnt) {
- return true;
- } else if (right.fCoverageSampleCnt < left.fCoverageSampleCnt) {
- return false;
- } else if (left.fColorSampleCnt < right.fColorSampleCnt) {
- return true;
- }
- return false;
-}
-}
-
void GrGLCaps::initFSAASupport(const GrGLContextInfo& ctxInfo, const GrGLInterface* gli) {
fMSFBOType = kNone_MSFBOType;
@@ -409,49 +392,6 @@ void GrGLCaps::initFSAASupport(const GrGLContextInfo& ctxInfo, const GrGLInterfa
ctxInfo.hasExtension("GL_EXT_framebuffer_blit")) {
fMSFBOType = GrGLCaps::kDesktop_EXT_MSFBOType;
}
- // TODO: We could populate fMSAACoverageModes using GetInternalformativ
- // on GL 4.2+. It's format-specific, though. See also
- // http://code.google.com/p/skia/issues/detail?id=470 about using actual
- // rather than requested sample counts in cache key.
- if (ctxInfo.hasExtension("GL_NV_framebuffer_multisample_coverage")) {
- fCoverageAAType = kNVDesktop_CoverageAAType;
- GrGLint count;
- GR_GL_GetIntegerv(gli,
- GR_GL_MAX_MULTISAMPLE_COVERAGE_MODES,
- &count);
- fMSAACoverageModes.setCount(count);
- GR_GL_GetIntegerv(gli,
- GR_GL_MULTISAMPLE_COVERAGE_MODES,
- (int*)&fMSAACoverageModes[0]);
- // The NV driver seems to return the modes already sorted but the
- // spec doesn't require this. So we sort.
- typedef SkTLessFunctionToFunctorAdaptor<MSAACoverageMode, cov_mode_less> SortFunctor;
- SortFunctor sortFunctor;
- SkTQSort<MSAACoverageMode, SortFunctor>(fMSAACoverageModes.begin(),
- fMSAACoverageModes.end() - 1,
- sortFunctor);
- }
- }
-}
-
-const GrGLCaps::MSAACoverageMode& GrGLCaps::getMSAACoverageMode(int desiredSampleCount) const {
- static const MSAACoverageMode kNoneMode = {0, 0};
- if (0 == fMSAACoverageModes.count()) {
- return kNoneMode;
- } else {
- SkASSERT(kNone_CoverageAAType != fCoverageAAType);
- int max = (fMSAACoverageModes.end() - 1)->fCoverageSampleCnt;
- desiredSampleCount = GrMin(desiredSampleCount, max);
- MSAACoverageMode desiredMode = {desiredSampleCount, 0};
- int idx = SkTSearch<const MSAACoverageMode, cov_mode_less>(&fMSAACoverageModes[0],
- fMSAACoverageModes.count(),
- desiredMode,
- sizeof(MSAACoverageMode));
- if (idx < 0) {
- idx = ~idx;
- }
- SkASSERT(idx >= 0 && idx < fMSAACoverageModes.count());
- return fMSAACoverageModes[idx];
}
}
« no previous file with comments | « src/gpu/gl/GrGLCaps.h ('k') | src/gpu/gl/GrGpuGL.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698