Index: tools/gpu/gl/debug/DebugGLTestContext.cpp |
diff --git a/tools/gpu/gl/debug/DebugGLTestContext.cpp b/tools/gpu/gl/debug/DebugGLTestContext.cpp |
index 022d56a452a1ccd4c57260869a8759f14e358b7a..cf8a9e424091596b5893a9e6b0524bc7276be137 100644 |
--- a/tools/gpu/gl/debug/DebugGLTestContext.cpp |
+++ b/tools/gpu/gl/debug/DebugGLTestContext.cpp |
@@ -373,6 +373,34 @@ public: |
} |
} |
+ GrGLvoid renderbufferStorage(GrGLenum target, GrGLenum internalformat, GrGLsizei width, |
+ GrGLsizei height) override { |
+ GrAlwaysAssert(GR_GL_RENDERBUFFER == target); |
+ GrRenderBufferObj* renderBuffer = this->getRenderBuffer(); |
+ GrAlwaysAssert(renderBuffer); |
+ renderBuffer->setNumSamples(1); |
+ } |
+ |
+ GrGLvoid renderbufferStorageMultisample(GrGLenum target, GrGLsizei samples, |
+ GrGLenum internalformat, GrGLsizei width, |
+ GrGLsizei height) override { |
+ GrAlwaysAssert(GR_GL_RENDERBUFFER == target); |
+ GrRenderBufferObj* renderBuffer = this->getRenderBuffer(); |
+ GrAlwaysAssert(renderBuffer); |
+ renderBuffer->setNumSamples(samples); |
+ } |
+ |
+ GrGLvoid namedRenderbufferStorage(GrGLuint renderbuffer, GrGLenum GrGLinternalformat, |
+ GrGLsizei width, GrGLsizei height) override { |
+ SK_ABORT("Not implemented"); |
+ } |
+ |
+ GrGLvoid namedRenderbufferStorageMultisample(GrGLuint renderbuffer, GrGLsizei samples, |
+ GrGLenum GrGLinternalformat, GrGLsizei width, |
+ GrGLsizei height) override { |
+ SK_ABORT("Not implemented"); |
+ } |
+ |
GrGLvoid framebufferRenderbuffer(GrGLenum target, |
GrGLenum attachment, |
GrGLenum renderbuffertarget, |
@@ -410,6 +438,12 @@ public: |
} |
+ GrGLvoid namedFramebufferRenderbuffer(GrGLuint framebuffer, GrGLenum attachment, |
+ GrGLenum renderbuffertarget, |
+ GrGLuint renderbuffer) override { |
+ SK_ABORT("Not implemented"); |
+ } |
+ |
//////////////////////////////////////////////////////////////////////////////// |
GrGLvoid framebufferTexture2D(GrGLenum target, GrGLenum attachment, GrGLenum textarget, |
GrGLuint textureID, GrGLint level) override { |
@@ -450,6 +484,30 @@ public: |
}; |
} |
+ GrGLvoid framebufferTexture2DMultisample(GrGLenum target, GrGLenum attachment, |
+ GrGLenum textarget, GrGLuint texture, GrGLint level, |
+ GrGLsizei samples) override { |
+ SK_ABORT("Not implemented"); |
+ } |
+ |
+ GrGLvoid namedFramebufferTexture1D(GrGLuint framebuffer, GrGLenum attachment, |
+ GrGLenum textarget, GrGLuint texture, |
+ GrGLint level) override { |
+ SK_ABORT("Not implemented"); |
+ } |
+ |
+ GrGLvoid namedFramebufferTexture2D(GrGLuint framebuffer, GrGLenum attachment, |
+ GrGLenum textarget, GrGLuint texture, |
+ GrGLint level) override { |
+ SK_ABORT("Not implemented"); |
+ } |
+ |
+ GrGLvoid namedFramebufferTexture3D(GrGLuint framebuffer, GrGLenum attachment, |
+ GrGLenum textarget, GrGLuint texture, GrGLint level, |
+ GrGLint zoffset) override { |
+ SK_ABORT("Not implemented"); |
+ } |
+ |
GrGLuint createProgram() override { |
GrProgramObj *program = CREATE(GrProgramObj, kProgram_ObjTypes); |
@@ -530,9 +588,26 @@ public: |
case GR_GL_STENCIL_BITS: |
*params = 8; |
break; |
- case GR_GL_SAMPLES: |
- *params = 1; |
+ case GR_GL_SAMPLES: { |
+ GrFrameBufferObj* framebuffer = this->getFrameBuffer(); |
+ GrAlwaysAssert(framebuffer); |
+ int numSamples = 0; |
+ |
+ if (GrFBBindableObj* stencil = framebuffer->getStencil()) { |
+ numSamples = stencil->numSamples(); |
+ } |
+ if (GrFBBindableObj* depth = framebuffer->getDepth()) { |
+ GrAlwaysAssert(!numSamples || numSamples == depth->numSamples()); |
+ numSamples = depth->numSamples(); |
+ } |
+ if (GrFBBindableObj* color = framebuffer->getColor()) { |
+ GrAlwaysAssert(!numSamples || numSamples == color->numSamples()); |
+ numSamples = color->numSamples(); |
+ } |
+ GrAlwaysAssert(numSamples); |
+ *params = numSamples; |
break; |
+ } |
case GR_GL_FRAMEBUFFER_BINDING: |
*params = 0; |
break; |