silence some of our startup spew

tie skia and gr's debug symbols together in the Makefile



git-svn-id: http://skia.googlecode.com/svn/trunk@654 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@google.com 2010-12-23 15:12:59 +00:00
parent 873cb1e23b
commit eeeb5a05b9
3 changed files with 92 additions and 47 deletions

View File

@ -18,9 +18,9 @@ else
endif endif
ifeq ($(SKIA_DEBUG),true) ifeq ($(SKIA_DEBUG),true)
DEFINES += -DSK_DEBUG -DSK_SUPPORT_UNIT DEFINES += -DSK_DEBUG -DSK_SUPPORT_UNIT -DGR_DEBUG=1
else else
DEFINES += -DSK_RELEASE DEFINES += -DSK_RELEASE -DGR_DEBUG=0
endif endif
DEFINES += -DSK_SUPPORT_LCDTEXT DEFINES += -DSK_SUPPORT_LCDTEXT

View File

@ -108,13 +108,17 @@ bool fbo_test(GrGLExts exts, int w, int h) {
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
static bool gPrintStartupSpew;
GrGpuGL::GrGpuGL() { GrGpuGL::GrGpuGL() {
GrPrintf("------------------------- create GrGpuGL %p --------------\n", if (gPrintStartupSpew) {
this); GrPrintf("------------------------- create GrGpuGL %p --------------\n",
GrPrintf("------ VENDOR %s\n", glGetString(GL_VENDOR)); this);
GrPrintf("------ RENDERER %s\n", glGetString(GL_RENDERER)); GrPrintf("------ VENDOR %s\n", glGetString(GL_VENDOR));
GrPrintf("------ VERSION %s\n", glGetString(GL_VERSION)); GrPrintf("------ RENDERER %s\n", glGetString(GL_RENDERER));
GrPrintf("------ EXTENSIONS\n %s \n", glGetString(GL_EXTENSIONS)); GrPrintf("------ VERSION %s\n", glGetString(GL_VERSION));
GrPrintf("------ EXTENSIONS\n %s \n", glGetString(GL_EXTENSIONS));
}
GrGLClearErr(); GrGLClearErr();
@ -160,7 +164,10 @@ GrGpuGL::GrGpuGL() {
break; break;
} }
} }
GrPrintf("Palette8 support: %s\n", (f8bitPaletteSupport ? "YES" : "NO"));
if (gPrintStartupSpew) {
GrPrintf("Palette8 support: %s\n", (f8bitPaletteSupport ? "YES" : "NO"));
}
GR_STATIC_ASSERT(0 == kNone_AALevel); GR_STATIC_ASSERT(0 == kNone_AALevel);
GR_STATIC_ASSERT(1 == kLow_AALevel); GR_STATIC_ASSERT(1 == kLow_AALevel);
@ -171,11 +178,15 @@ GrGpuGL::GrGpuGL() {
fMSFBOType = kNone_MSFBO; fMSFBOType = kNone_MSFBO;
if (has_gl_extension("GL_IMG_multisampled_render_to_texture")) { if (has_gl_extension("GL_IMG_multisampled_render_to_texture")) {
fMSFBOType = kIMG_MSFBO; fMSFBOType = kIMG_MSFBO;
GrPrintf("MSAA Support: IMG ES EXT.\n"); if (gPrintStartupSpew) {
GrPrintf("MSAA Support: IMG ES EXT.\n");
}
} }
else if (has_gl_extension("GL_APPLE_framebuffer_multisample")) { else if (has_gl_extension("GL_APPLE_framebuffer_multisample")) {
fMSFBOType = kApple_MSFBO; fMSFBOType = kApple_MSFBO;
GrPrintf("MSAA Support: APPLE ES EXT.\n"); if (gPrintStartupSpew) {
GrPrintf("MSAA Support: APPLE ES EXT.\n");
}
} }
#if GR_GL_DESKTOP #if GR_GL_DESKTOP
else if ((major >= 3) || else if ((major >= 3) ||
@ -183,11 +194,15 @@ GrGpuGL::GrGpuGL() {
(has_gl_extension("GL_EXT_framebuffer_multisample") && (has_gl_extension("GL_EXT_framebuffer_multisample") &&
has_gl_extension("GL_EXT_framebuffer_blit"))) { has_gl_extension("GL_EXT_framebuffer_blit"))) {
fMSFBOType = kDesktop_MSFBO; fMSFBOType = kDesktop_MSFBO;
GrPrintf("MSAA Support: DESKTOP\n"); if (gPrintStartupSpew) {
GrPrintf("MSAA Support: DESKTOP\n");
}
} }
#endif #endif
else { else {
GrPrintf("MSAA Support: NONE\n"); if (gPrintStartupSpew) {
GrPrintf("MSAA Support: NONE\n");
}
} }
if (kNone_MSFBO != fMSFBOType) { if (kNone_MSFBO != fMSFBOType) {
@ -206,7 +221,9 @@ GrGpuGL::GrGpuGL() {
maxSamples)); maxSamples));
fAASamples[kHigh_AALevel] = maxSamples; fAASamples[kHigh_AALevel] = maxSamples;
} }
GrPrintf("\tMax Samples: %d\n", maxSamples); if (gPrintStartupSpew) {
GrPrintf("\tMax Samples: %d\n", maxSamples);
}
} }
#if GR_GL_DESKTOP #if GR_GL_DESKTOP
@ -215,7 +232,9 @@ GrGpuGL::GrGpuGL() {
#else #else
fHasStencilWrap = (major >= 2) || has_gl_extension("GL_OES_stencil_wrap"); fHasStencilWrap = (major >= 2) || has_gl_extension("GL_OES_stencil_wrap");
#endif #endif
GrPrintf("Stencil Wrap: %s\n", (fHasStencilWrap ? "YES" : "NO")); if (gPrintStartupSpew) {
GrPrintf("Stencil Wrap: %s\n", (fHasStencilWrap ? "YES" : "NO"));
}
#if GR_GL_DESKTOP #if GR_GL_DESKTOP
// we could also look for GL_ATI_separate_stencil extension or // we could also look for GL_ATI_separate_stencil extension or
@ -227,7 +246,9 @@ GrGpuGL::GrGpuGL() {
// an ES1 extension. // an ES1 extension.
fSingleStencilPassForWinding = (major >= 2); fSingleStencilPassForWinding = (major >= 2);
#endif #endif
GrPrintf("Single Stencil Pass For Winding: %s\n", (fSingleStencilPassForWinding ? "YES" : "NO")); if (gPrintStartupSpew) {
GrPrintf("Single Stencil Pass For Winding: %s\n", (fSingleStencilPassForWinding ? "YES" : "NO"));
}
#if GR_GL_DESKTOP #if GR_GL_DESKTOP
@ -235,7 +256,9 @@ GrGpuGL::GrGpuGL() {
#else #else
fRGBA8Renderbuffer = has_gl_extension("GL_OES_rgb8_rgba8"); fRGBA8Renderbuffer = has_gl_extension("GL_OES_rgb8_rgba8");
#endif #endif
GrPrintf("RGBA Renderbuffer: %s\n", (fRGBA8Renderbuffer ? "YES" : "NO")); if (gPrintStartupSpew) {
GrPrintf("RGBA Renderbuffer: %s\n", (fRGBA8Renderbuffer ? "YES" : "NO"));
}
#if GR_GL_DESKTOP #if GR_GL_DESKTOP
@ -244,7 +267,9 @@ GrGpuGL::GrGpuGL() {
#else #else
fBufferLockSupport = has_gl_extension("GL_OES_mapbuffer"); fBufferLockSupport = has_gl_extension("GL_OES_mapbuffer");
#endif #endif
GrPrintf("Map Buffer: %s\n", (fBufferLockSupport ? "YES" : "NO")); if (gPrintStartupSpew) {
GrPrintf("Map Buffer: %s\n", (fBufferLockSupport ? "YES" : "NO"));
}
#if GR_GL_DESKTOP #if GR_GL_DESKTOP
fNPOTTextureSupport = fNPOTTextureSupport =
@ -276,33 +301,42 @@ GrGpuGL::GrGpuGL() {
bool npotFBOSuccess = fbo_test(fExts, 200, 200); bool npotFBOSuccess = fbo_test(fExts, 200, 200);
if (!npotFBOSuccess) { if (!npotFBOSuccess) {
fNPOTTextureSupport = kNonRendertarget_NPOTTextureType; fNPOTTextureSupport = kNonRendertarget_NPOTTextureType;
GrPrintf("NPOT Renderbuffer Test: FAILED\n"); if (gPrintStartupSpew) {
GrPrintf("NPOT Renderbuffer Test: FAILED\n");
}
} else { } else {
GrPrintf("NPOT Renderbuffer Test: PASSED\n"); if (gPrintStartupSpew) {
GrPrintf("NPOT Renderbuffer Test: PASSED\n");
}
} }
} }
switch (fNPOTTextureSupport) {
case kNone_NPOTTextureType: if (gPrintStartupSpew) {
GrPrintf("NPOT Support: NONE\n"); switch (fNPOTTextureSupport) {
break; case kNone_NPOTTextureType:
case kNoRepeat_NPOTTextureType: GrPrintf("NPOT Support: NONE\n");
GrPrintf("NPOT Support: NO REPEAT\n"); break;
break; case kNoRepeat_NPOTTextureType:
case kNonRendertarget_NPOTTextureType: GrPrintf("NPOT Support: NO REPEAT\n");
GrPrintf("NPOT Support: NO FBOTEX\n"); break;
break; case kNonRendertarget_NPOTTextureType:
case kFull_NPOTTextureType: GrPrintf("NPOT Support: NO FBOTEX\n");
GrPrintf("NPOT Support: FULL\n"); break;
break; case kFull_NPOTTextureType:
GrPrintf("NPOT Support: FULL\n");
break;
}
} }
// sanity check to make sure we can at least create an FBO from a POT texture // sanity check to make sure we can at least create an FBO from a POT texture
if (fNPOTTextureSupport < kFull_NPOTTextureType) { if (fNPOTTextureSupport < kFull_NPOTTextureType) {
bool npotFBOSuccess = fbo_test(fExts, 128, 128); bool npotFBOSuccess = fbo_test(fExts, 128, 128);
if (!npotFBOSuccess) { if (gPrintStartupSpew) {
GrPrintf("FBO Sanity Test: FAILED\n"); if (!npotFBOSuccess) {
} else { GrPrintf("FBO Sanity Test: FAILED\n");
GrPrintf("FBO Sanity Test: PASSED\n"); } else {
GrPrintf("FBO Sanity Test: PASSED\n");
}
} }
} }
@ -314,33 +348,45 @@ GrGpuGL::GrGpuGL() {
GLint maxRenderSize; GLint maxRenderSize;
glGetIntegerv(GR_MAX_RENDERBUFFER_SIZE, &maxRenderSize); glGetIntegerv(GR_MAX_RENDERBUFFER_SIZE, &maxRenderSize);
GrPrintf("Small height FBO texture experiments\n"); if (gPrintStartupSpew) {
GrPrintf("Small height FBO texture experiments\n");
}
for (GLuint i = 1; i <= 256; for (GLuint i = 1; i <= 256;
(kFull_NPOTTextureType != fNPOTTextureSupport) ? i *= 2 : ++i) { (kFull_NPOTTextureType != fNPOTTextureSupport) ? i *= 2 : ++i) {
GLuint w = maxRenderSize; GLuint w = maxRenderSize;
GLuint h = i; GLuint h = i;
if (fbo_test(fExts, w, h)) { if (fbo_test(fExts, w, h)) {
GrPrintf("\t[%d, %d]: PASSED\n", w, h); if (gPrintStartupSpew) {
GrPrintf("\t[%d, %d]: PASSED\n", w, h);
}
fMinRenderTargetHeight = i; fMinRenderTargetHeight = i;
break; break;
} else { } else {
GrPrintf("\t[%d, %d]: FAILED\n", w, h); if (gPrintStartupSpew) {
GrPrintf("\t[%d, %d]: FAILED\n", w, h);
}
} }
} }
GrAssert(GR_INVAL_GLINT != fMinRenderTargetHeight); GrAssert(GR_INVAL_GLINT != fMinRenderTargetHeight);
GrPrintf("Small width FBO texture experiments\n"); if (gPrintStartupSpew) {
GrPrintf("Small width FBO texture experiments\n");
}
fMinRenderTargetWidth = GR_MAX_GLUINT; fMinRenderTargetWidth = GR_MAX_GLUINT;
for (GLuint i = 1; i <= 256; for (GLuint i = 1; i <= 256;
(kFull_NPOTTextureType != fNPOTTextureSupport) ? i *= 2 : ++i) { (kFull_NPOTTextureType != fNPOTTextureSupport) ? i *= 2 : ++i) {
GLuint w = i; GLuint w = i;
GLuint h = maxRenderSize; GLuint h = maxRenderSize;
if (fbo_test(fExts, w, h)) { if (fbo_test(fExts, w, h)) {
GrPrintf("\t[%d, %d]: PASSED\n", w, h); if (gPrintStartupSpew) {
GrPrintf("\t[%d, %d]: PASSED\n", w, h);
}
fMinRenderTargetWidth = i; fMinRenderTargetWidth = i;
break; break;
} else { } else {
GrPrintf("\t[%d, %d]: FAILED\n", w, h); if (gPrintStartupSpew) {
GrPrintf("\t[%d, %d]: FAILED\n", w, h);
}
} }
} }
GrAssert(GR_INVAL_GLINT != fMinRenderTargetWidth); GrAssert(GR_INVAL_GLINT != fMinRenderTargetWidth);

View File

@ -15,7 +15,7 @@ bool SkEGLContext::init(int width, int height) {
AGLContext ctx; AGLContext ctx;
aglGetVersion(&major, &minor); aglGetVersion(&major, &minor);
SkDebugf("---- agl version %d %d\n", major, minor); // SkDebugf("---- agl version %d %d\n", major, minor);
const GLint pixelAttrs[] = { const GLint pixelAttrs[] = {
AGL_RGBA, AGL_RGBA,
@ -30,12 +30,11 @@ bool SkEGLContext::init(int width, int height) {
}; };
AGLPixelFormat format = aglChoosePixelFormat(NULL, 0, pixelAttrs); AGLPixelFormat format = aglChoosePixelFormat(NULL, 0, pixelAttrs);
//AGLPixelFormat format = aglCreatePixelFormat(pixelAttrs); //AGLPixelFormat format = aglCreatePixelFormat(pixelAttrs);
SkDebugf("----- agl format %p\n", format); // SkDebugf("----- agl format %p\n", format);
ctx = aglCreateContext(format, NULL); ctx = aglCreateContext(format, NULL);
SkDebugf("----- agl context %p\n", ctx); // SkDebugf("----- agl context %p\n", ctx);
aglDestroyPixelFormat(format); aglDestroyPixelFormat(format);
SkDebugf("---- sizeof aglcontext %d\n", sizeof(AGLContext));
/* /*
static const GLint interval = 1; static const GLint interval = 1;
aglSetInteger(ctx, AGL_SWAP_INTERVAL, &interval); aglSetInteger(ctx, AGL_SWAP_INTERVAL, &interval);