Remove IMG multisample texture support.
authorbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 21 Mar 2011 21:38:40 +0000 (21:38 +0000)
committerbsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Mon, 21 Mar 2011 21:38:40 +0000 (21:38 +0000)
This never worked correctly. The texture loses multisample status when the resolve occurs. We never had code to re-establish it. Also, we'd have to handle the case where you resolve but then want to render to it again without clearing.

Review URL: http://codereview.appspot.com/4274074/

git-svn-id: http://skia.googlecode.com/svn/trunk@974 2bbb7eff-a529-9590-31e7-b0007b416f81

gpu/include/GrGLConfig_chrome.h
gpu/include/GrGLDefines.h
gpu/include/GrGLInterface.h
gpu/include/GrGLPlatformIncludes.h
gpu/src/GrGLInterface.cpp
gpu/src/GrGpuGL.cpp
gpu/src/GrGpuGL.h

index 06a74d3a38795a8d78c3b676261d717fdcc556c9..1b3c1c6b49124dbb616ddf112fa9be373eaef225 100644 (file)
@@ -6,7 +6,6 @@
 // gl2ext.h will define these extensions macros but Chrome doesn't provide
 // prototypes.
 #define GL_OES_mapbuffer                      0
-#define GL_IMG_multisampled_render_to_texture 0
 
 #define GR_GL_PLATFORM_HEADER       <GLES2/gl2.h>
 #define GR_GL_PLATFORM_HEADER_EXT   <GLES2/gl2ext.h>
index e2d91065257936da050ab679a74642df0957d7c3..46bd2644609b877e841d8a95510fc14fe2f78a75 100644 (file)
 #define GR_GL_DEPTH24_STENCIL8               0x88F0
 
 #define GR_GL_MAX_SAMPLES                    0x8D57
-#define GR_GL_MAX_SAMPLES_IMG                0x9135 // to be removed soon.
 
 #define GR_GL_RENDERBUFFER_WIDTH             0x8D42
 #define GR_GL_RENDERBUFFER_HEIGHT            0x8D43
index b43baccf8fd93108edebb18ac607e7d36c57e5a1..700ce9ee14cc6bd3d2fd0ab0d86d183943dfb628 100644 (file)
@@ -178,9 +178,6 @@ struct GrGLInterface {
     // apple's es extension
     typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLResolveMultisampleFramebufferProc)();
 
-    // IMG'e es extension
-    typedef GrGLvoid (GR_GL_FUNCTION_TYPE *GrGLFramebufferTexture2DMultisampleProc)(GrGLenum target, GrGLenum attachment, GrGLenum textarget, GrGLuint texture, GrGLint level, GrGLsizei samples);
-
     // Buffer mapping (extension in ES).
     typedef GrGLvoid* (GR_GL_FUNCTION_TYPE *GrGLMapBufferProc)(GrGLenum target, GrGLenum access);
     typedef GrGLboolean (GR_GL_FUNCTION_TYPE *GrGLUnmapBufferProc)(GrGLenum target);
@@ -286,9 +283,6 @@ struct GrGLInterface {
     // apple's es extension
     GrGLResolveMultisampleFramebufferProc fResolveMultisampleFramebuffer;
 
-    // IMG'e es extension
-    GrGLFramebufferTexture2DMultisampleProc fFramebufferTexture2DMultisample;
-
     // Buffer mapping (extension in ES).
     GrGLMapBufferProc fMapBuffer;
     GrGLUnmapBufferProc fUnmapBuffer;
index 65e5281aef2f82d37d6a9dd9dca45827e6db3c42..13ce69498517cf0093d020fd7674ceb15f5ededb 100644 (file)
         // builds.
         #define GL_APPLE_framebuffer_multisample        1
         #define GL_EXT_framebuffer_object               1
-        #define GL_IMG_multisampled_render_to_texture   1
         #define GL_OES_mapbuffer                        1
         #define GL_OES_mapbuffer                        1
     #elif GR_MAC_BUILD
index cc2c7bf07df554a67c376db623280c189d5723f8..702b057e3eb92284d5b4e685b7147514dbd12b37 100644 (file)
@@ -220,13 +220,6 @@ void InitializeGLInterfaceExtensions(GrGLInterface* glBindings) {
     }
     #endif
 
-    #if GL_IMG_multisampled_render_to_texture
-    if (has_gl_extension_from_string(
-                "GL_IMG_multisampled_render_to_texture", extensionString)) {
-        GR_GL_GET_PROC_SUFFIX(FramebufferTexture2DMultisample, IMG);
-    }
-    #endif
-
     #if GL_OES_mapbuffer
     if (has_gl_extension_from_string("GL_OES_mapbuffer", extensionString)) {
         GR_GL_GET_PROC_SUFFIX(MapBuffer, OES);
index e94455100938039015f04193b12342d4176ad111..1862784c1ec5c3edd1703460bcca9bcb456cbd0f 100644 (file)
@@ -230,13 +230,7 @@ GrGpuGL::GrGpuGL() {
 
     memset(fAASamples, 0, sizeof(fAASamples));
     fMSFBOType = kNone_MSFBO;
-    if (has_gl_extension("GL_IMG_multisampled_render_to_texture")) {
-        fMSFBOType = kIMG_MSFBO;
-        if (gPrintStartupSpew) {
-            GrPrintf("MSAA Support: IMG ES EXT.\n");
-        }
-    }
-    else if (has_gl_extension("GL_APPLE_framebuffer_multisample")) {
+    if (has_gl_extension("GL_APPLE_framebuffer_multisample")) {
         fMSFBOType = kApple_MSFBO;
         if (gPrintStartupSpew) {
             GrPrintf("MSAA Support: APPLE ES EXT.\n");
@@ -260,10 +254,7 @@ GrGpuGL::GrGpuGL() {
 
     if (kNone_MSFBO != fMSFBOType) {
         GrGLint maxSamples;
-        GrGLenum maxSampleGetter = (kIMG_MSFBO == fMSFBOType) ?
-                                                            GR_GL_MAX_SAMPLES_IMG :
-                                                            GR_GL_MAX_SAMPLES;
-        GR_GL_GetIntegerv(maxSampleGetter, &maxSamples);
+        GR_GL_GetIntegerv(GR_GL_MAX_SAMPLES, &maxSamples);
         if (maxSamples > 1 ) {
             fAASamples[kNone_AALevel] = 0;
             fAASamples[kLow_AALevel] = GrMax(2,
@@ -830,11 +821,9 @@ GrTexture* GrGpuGL::createTextureHelper(const TextureDesc& desc,
         GR_GL(GenFramebuffers(1, &rtIDs.fTexFBOID));
         GrAssert(rtIDs.fTexFBOID);
 
-        // If we are using multisampling and any extension other than the IMG
-        // one we will create two FBOs. We render to one and then resolve to
-        // the texture bound to the other. The IMG extension does an implicit
-        // resolve.
-        if (samples > 1 && kIMG_MSFBO != fMSFBOType && kNone_MSFBO != fMSFBOType) {
+        // If we are using multisampling and we will create two FBOS We render 
+        // to one and then resolve to the texture bound to the other.
+        if (samples > 1 && kNone_MSFBO != fMSFBOType) {
             GR_GL(GenFramebuffers(1, &rtIDs.fRTFBOID));
             GrAssert(0 != rtIDs.fRTFBOID);
             GR_GL(GenRenderbuffers(1, &rtIDs.fMSColorRenderbufferID));
@@ -904,20 +893,10 @@ GrTexture* GrGpuGL::createTextureHelper(const TextureDesc& desc,
 #if GR_COLLECT_STATS
             ++fStats.fRenderTargetChngCnt;
 #endif
-            if (kIMG_MSFBO == fMSFBOType && samples > 1) {
-                GR_GL(FramebufferTexture2DMultisample(GR_GL_FRAMEBUFFER,
-                                                      GR_GL_COLOR_ATTACHMENT0,
-                                                      GR_GL_TEXTURE_2D,
-                                                      glDesc.fTextureID,
-                                                      0,
-                                                      samples));
-
-            } else {
-                GR_GL(FramebufferTexture2D(GR_GL_FRAMEBUFFER,
-                                           GR_GL_COLOR_ATTACHMENT0,
-                                           GR_GL_TEXTURE_2D,
-                                           glDesc.fTextureID, 0));
-            }
+            GR_GL(FramebufferTexture2D(GR_GL_FRAMEBUFFER,
+                                        GR_GL_COLOR_ATTACHMENT0,
+                                        GR_GL_TEXTURE_2D,
+                                        glDesc.fTextureID, 0));
             if (rtIDs.fRTFBOID != rtIDs.fTexFBOID) {
                 GrGLenum status = GR_GL(CheckFramebufferStatus(GR_GL_FRAMEBUFFER));
                 if (status != GR_GL_FRAMEBUFFER_COMPLETE) {
index 3e7d79d2a1a144c6ed65659407701f6affaaa13b..01344072d51d93cc41c59208a735dc47c3e6d65f 100644 (file)
@@ -167,8 +167,7 @@ private:
     enum {
         kNone_MSFBO = 0,
         kDesktop_MSFBO,
-        kApple_MSFBO,
-        kIMG_MSFBO
+        kApple_MSFBO
     } fMSFBOType;
 
     // Do we have stencil wrap ops.