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

Side by Side Diff: src/gpu/gl/GrGLCaps.cpp

Issue 12875005: Add support for IMG's MSAA extension. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « src/gpu/gl/GrGLCaps.h ('k') | src/gpu/gl/GrGLDefines.h » ('j') | 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 2012 Google Inc. 2 * Copyright 2012 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 8
9 #include "GrGLCaps.h" 9 #include "GrGLCaps.h"
10 #include "GrGLContext.h" 10 #include "GrGLContext.h"
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 void GrGLCaps::initFSAASupport(const GrGLContextInfo& ctxInfo, const GrGLInterfa ce* gli) { 244 void GrGLCaps::initFSAASupport(const GrGLContextInfo& ctxInfo, const GrGLInterfa ce* gli) {
245 245
246 fMSFBOType = kNone_MSFBOType; 246 fMSFBOType = kNone_MSFBOType;
247 if (kDesktop_GrGLBinding != ctxInfo.binding()) { 247 if (kDesktop_GrGLBinding != ctxInfo.binding()) {
248 if (ctxInfo.hasExtension("GL_CHROMIUM_framebuffer_multisample")) { 248 if (ctxInfo.hasExtension("GL_CHROMIUM_framebuffer_multisample")) {
249 // chrome's extension is equivalent to the EXT msaa 249 // chrome's extension is equivalent to the EXT msaa
250 // and fbo_blit extensions. 250 // and fbo_blit extensions.
251 fMSFBOType = kDesktopEXT_MSFBOType; 251 fMSFBOType = kDesktopEXT_MSFBOType;
252 } else if (ctxInfo.hasExtension("GL_APPLE_framebuffer_multisample")) { 252 } else if (ctxInfo.hasExtension("GL_APPLE_framebuffer_multisample")) {
253 fMSFBOType = kAppleES_MSFBOType; 253 fMSFBOType = kAppleES_MSFBOType;
254 } else if (ctxInfo.hasExtension("GL_IMG_multisampled_render_to_texture")) {
255 fMSFBOType = kImaginationES_MSFBOType;
254 } 256 }
255 } else { 257 } else {
256 if ((ctxInfo.version() >= GR_GL_VER(3,0)) || 258 if ((ctxInfo.version() >= GR_GL_VER(3,0)) ||
257 ctxInfo.hasExtension("GL_ARB_framebuffer_object")) { 259 ctxInfo.hasExtension("GL_ARB_framebuffer_object")) {
258 fMSFBOType = GrGLCaps::kDesktopARB_MSFBOType; 260 fMSFBOType = GrGLCaps::kDesktopARB_MSFBOType;
259 } else if (ctxInfo.hasExtension("GL_EXT_framebuffer_multisample") && 261 } else if (ctxInfo.hasExtension("GL_EXT_framebuffer_multisample") &&
260 ctxInfo.hasExtension("GL_EXT_framebuffer_blit")) { 262 ctxInfo.hasExtension("GL_EXT_framebuffer_blit")) {
261 fMSFBOType = GrGLCaps::kDesktopEXT_MSFBOType; 263 fMSFBOType = GrGLCaps::kDesktopEXT_MSFBOType;
262 } 264 }
263 // TODO: We could populate fMSAACoverageModes using GetInternalformativ 265 // TODO: We could populate fMSAACoverageModes using GetInternalformativ
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
413 GrPrintf("Stencil Format %d, stencil bits: %02d, total bits: %02d\n", 415 GrPrintf("Stencil Format %d, stencil bits: %02d, total bits: %02d\n",
414 i, 416 i,
415 fStencilFormats[i].fStencilBits, 417 fStencilFormats[i].fStencilBits,
416 fStencilFormats[i].fTotalBits); 418 fStencilFormats[i].fTotalBits);
417 } 419 }
418 420
419 GR_STATIC_ASSERT(0 == kNone_MSFBOType); 421 GR_STATIC_ASSERT(0 == kNone_MSFBOType);
420 GR_STATIC_ASSERT(1 == kDesktopARB_MSFBOType); 422 GR_STATIC_ASSERT(1 == kDesktopARB_MSFBOType);
421 GR_STATIC_ASSERT(2 == kDesktopEXT_MSFBOType); 423 GR_STATIC_ASSERT(2 == kDesktopEXT_MSFBOType);
422 GR_STATIC_ASSERT(3 == kAppleES_MSFBOType); 424 GR_STATIC_ASSERT(3 == kAppleES_MSFBOType);
425 GR_STATIC_ASSERT(4 == kImaginationES_MSFBOType);
423 static const char* gMSFBOExtStr[] = { 426 static const char* gMSFBOExtStr[] = {
424 "None", 427 "None",
425 "ARB", 428 "ARB",
426 "EXT", 429 "EXT",
427 "Apple", 430 "Apple",
431 "IMG",
428 }; 432 };
429 GrPrintf("MSAA Type: %s\n", gMSFBOExtStr[fMSFBOType]); 433 GrPrintf("MSAA Type: %s\n", gMSFBOExtStr[fMSFBOType]);
430 GrPrintf("Max FS Uniform Vectors: %d\n", fMaxFragmentUniformVectors); 434 GrPrintf("Max FS Uniform Vectors: %d\n", fMaxFragmentUniformVectors);
431 GrPrintf("Support RGBA8 Render Buffer: %s\n", 435 GrPrintf("Support RGBA8 Render Buffer: %s\n",
432 (fRGBA8RenderbufferSupport ? "YES": "NO")); 436 (fRGBA8RenderbufferSupport ? "YES": "NO"));
433 GrPrintf("BGRA is an internal format: %s\n", 437 GrPrintf("BGRA is an internal format: %s\n",
434 (fBGRAIsInternalFormat ? "YES": "NO")); 438 (fBGRAIsInternalFormat ? "YES": "NO"));
435 GrPrintf("Support texture swizzle: %s\n", 439 GrPrintf("Support texture swizzle: %s\n",
436 (fTextureSwizzleSupport ? "YES": "NO")); 440 (fTextureSwizzleSupport ? "YES": "NO"));
437 GrPrintf("Unpack Row length support: %s\n", 441 GrPrintf("Unpack Row length support: %s\n",
438 (fUnpackRowLengthSupport ? "YES": "NO")); 442 (fUnpackRowLengthSupport ? "YES": "NO"));
439 GrPrintf("Unpack Flip Y support: %s\n", 443 GrPrintf("Unpack Flip Y support: %s\n",
440 (fUnpackFlipYSupport ? "YES": "NO")); 444 (fUnpackFlipYSupport ? "YES": "NO"));
441 GrPrintf("Pack Row length support: %s\n", 445 GrPrintf("Pack Row length support: %s\n",
442 (fPackRowLengthSupport ? "YES": "NO")); 446 (fPackRowLengthSupport ? "YES": "NO"));
443 GrPrintf("Pack Flip Y support: %s\n", 447 GrPrintf("Pack Flip Y support: %s\n",
444 (fPackFlipYSupport ? "YES": "NO")); 448 (fPackFlipYSupport ? "YES": "NO"));
445 GrPrintf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO")); 449 GrPrintf("Two Format Limit: %s\n", (fTwoFormatLimit ? "YES": "NO"));
446 GrPrintf("Fragment coord conventions support: %s\n", (fFragCoordsConventionS upport ? "YES": "NO")); 450 GrPrintf("Fragment coord conventions support: %s\n", (fFragCoordsConventionS upport ? "YES": "NO"));
447 } 451 }
OLDNEW
« no previous file with comments | « src/gpu/gl/GrGLCaps.h ('k') | src/gpu/gl/GrGLDefines.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698