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

Unified Diff: tools/gpu/gl/debug/DebugGLTestContext.cpp

Issue 2085043002: Support GL_SAMPLES queries in null contexts (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 years, 6 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/GrGLCreateNullInterface.cpp ('k') | tools/gpu/gl/debug/GrFBBindableObj.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « src/gpu/gl/GrGLCreateNullInterface.cpp ('k') | tools/gpu/gl/debug/GrFBBindableObj.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698