Update to allow packed depth-stencil on ES3
authorcommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 6 Sep 2013 15:28:01 +0000 (15:28 +0000)
committercommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 6 Sep 2013 15:28:01 +0000 (15:28 +0000)
R=robertphillips@google.com

Author: bsalomon@google.com

Review URL: https://chromiumcodereview.appspot.com/22880023

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

src/gpu/gl/GrGLCaps.cpp
src/gpu/gl/SkGLContextHelper.cpp

index 1488e75c293c4af9f1f8032ad9d75e6bb0d65157..8ca88c14aa1a73141290c7c656884495b6d17be3 100644 (file)
@@ -501,7 +501,8 @@ void GrGLCaps::initStencilFormats(const GrGLContextInfo& ctxInfo) {
 
         fStencilFormats.push_back() = gS8;
         //fStencilFormats.push_back() = gS16;
-        if (ctxInfo.hasExtension("GL_OES_packed_depth_stencil")) {
+        if (ctxInfo.version() >= GR_GL_VER(3,0) ||
+            ctxInfo.hasExtension("GL_OES_packed_depth_stencil")) {
             fStencilFormats.push_back() = gD24S8;
         }
         if (ctxInfo.hasExtension("GL_OES_stencil4")) {
index c4e94318ff88486b4a4b20806efe6cd910668ef2..6f0372dde4fa391eeb191beeae876d455298a522 100644 (file)
@@ -82,7 +82,8 @@ bool SkGLContextHelper::init(int width, int height) {
         // depth stencil being available.
         bool supportsPackedDepthStencil;
         if (kES_GrGLBinding == bindingInUse) {
-            supportsPackedDepthStencil = this->hasExtension("GL_OES_packed_depth_stencil");
+            supportsPackedDepthStencil = version >= GR_GL_VER(3,0) ||
+                                         this->hasExtension("GL_OES_packed_depth_stencil");
         } else {
             supportsPackedDepthStencil = version >= GR_GL_VER(3,0) ||
                                          this->hasExtension("GL_EXT_packed_depth_stencil") ||