Revert r5491, r5495, r5497, and r5498.

Review URL: https://codereview.appspot.com/6499097

git-svn-id: http://skia.googlecode.com/svn/trunk@5501 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
borenet@google.com 2012-09-11 20:39:09 +00:00
parent 9f5898d31b
commit dabdd9e71d
3 changed files with 2 additions and 185 deletions

View File

@ -90,18 +90,15 @@ public:
}
static const int kBogusSize = 1;
if (!glCtx.get()) {
SkDebugf("GrContextFactory.h: no context\n");
return NULL;
}
if (!glCtx.get()->init(kBogusSize, kBogusSize)) {
SkDebugf("GrContextFactory.h: no init\n");
return NULL;
}
GrPlatform3DContext p3dctx =
reinterpret_cast<GrPlatform3DContext>(glCtx.get()->gl());
grCtx.reset(GrContext::Create(kOpenGL_Shaders_GrEngine, p3dctx));
if (!grCtx.get()) {
SkDebugf("GrContextFactory.h: no gr context\n");
return NULL;
}
GPUContext& ctx = fContexts.push_back();

View File

@ -57,7 +57,7 @@ const GrGLInterface* SkNativeGLContext::createGLContext() {
EGLint majorVersion;
EGLint minorVersion;
eglInitialize(fDisplay, &majorVersion, &minorVersion);
SkDebugf("SkNativeGLContext::createGLContext(): EGL v%i.%i\n", majorVersion, minorVersion);
EGLint numConfigs;
static const EGLint configAttribs[] = {
EGL_SURFACE_TYPE, EGL_PBUFFER_BIT,
@ -72,8 +72,6 @@ const GrGLInterface* SkNativeGLContext::createGLContext() {
EGLConfig surfaceConfig;
eglChooseConfig(fDisplay, configAttribs, &surfaceConfig, 1, &numConfigs);
SkDebugf("SkNativeGLContext::createGLContext(): numConfigs=%i", numConfigs);
static const EGLint contextAttribs[] = {
EGL_CONTEXT_CLIENT_VERSION, 2,
EGL_NONE
@ -92,7 +90,7 @@ const GrGLInterface* SkNativeGLContext::createGLContext() {
const GrGLInterface* interface = GrGLCreateNativeInterface();
if (!interface) {
printf("Failed to create gl interface\n");
SkDebugf("Failed to create gl interface");
this->destroyGLContext();
return NULL;
}

View File

@ -35,7 +35,6 @@ bool GrGLInterface::validate(GrGLBinding binding) const {
GR_STATIC_ASSERT(kNone_GrGLBinding == 0);
if (0 == (binding & fBindingsExported)) {
SkDebugf("%d: %i\n", __LINE__, (binding & fBindingsExported));
return false;
}
@ -129,95 +128,6 @@ bool GrGLInterface::validate(GrGLBinding binding) const {
NULL == fGenFramebuffers ||
NULL == fGenRenderbuffers ||
NULL == fRenderbufferStorage) {
SkDebugf("%d: %i\n", __LINE__, fActiveTexture );
SkDebugf("%d: %i\n", __LINE__, fAttachShader );
SkDebugf("%d: %i\n", __LINE__, fBindAttribLocation );
SkDebugf("%d: %i\n", __LINE__, fBindBuffer );
SkDebugf("%d: %i\n", __LINE__, fBindTexture );
SkDebugf("%d: %i\n", __LINE__, fBlendFunc );
SkDebugf("%d: %i\n", __LINE__, fBlendColor ); // -> GL >= 1.4, ES >= 2.0 or extension
SkDebugf("%d: %i\n", __LINE__, fBufferData );
SkDebugf("%d: %i\n", __LINE__, fBufferSubData );
SkDebugf("%d: %i\n", __LINE__, fClear );
SkDebugf("%d: %i\n", __LINE__, fClearColor );
SkDebugf("%d: %i\n", __LINE__, fClearStencil );
SkDebugf("%d: %i\n", __LINE__, fColorMask );
SkDebugf("%d: %i\n", __LINE__, fCompileShader );
SkDebugf("%d: %i\n", __LINE__, fCreateProgram );
SkDebugf("%d: %i\n", __LINE__, fCreateShader );
SkDebugf("%d: %i\n", __LINE__, fCullFace );
SkDebugf("%d: %i\n", __LINE__, fDeleteBuffers );
SkDebugf("%d: %i\n", __LINE__, fDeleteProgram );
SkDebugf("%d: %i\n", __LINE__, fDeleteShader );
SkDebugf("%d: %i\n", __LINE__, fDeleteTextures );
SkDebugf("%d: %i\n", __LINE__, fDepthMask );
SkDebugf("%d: %i\n", __LINE__, fDisable );
SkDebugf("%d: %i\n", __LINE__, fDisableVertexAttribArray );
SkDebugf("%d: %i\n", __LINE__, fDrawArrays );
SkDebugf("%d: %i\n", __LINE__, fDrawElements );
SkDebugf("%d: %i\n", __LINE__, fEnable );
SkDebugf("%d: %i\n", __LINE__, fEnableVertexAttribArray );
SkDebugf("%d: %i\n", __LINE__, fFrontFace );
SkDebugf("%d: %i\n", __LINE__, fGenBuffers );
SkDebugf("%d: %i\n", __LINE__, fGenTextures );
SkDebugf("%d: %i\n", __LINE__, fGetBufferParameteriv );
SkDebugf("%d: %i\n", __LINE__, fGetError );
SkDebugf("%d: %i\n", __LINE__, fGetIntegerv );
SkDebugf("%d: %i\n", __LINE__, fGetProgramInfoLog );
SkDebugf("%d: %i\n", __LINE__, fGetProgramiv );
SkDebugf("%d: %i\n", __LINE__, fGetShaderInfoLog );
SkDebugf("%d: %i\n", __LINE__, fGetShaderiv );
SkDebugf("%d: %i\n", __LINE__, fGetString );
SkDebugf("%d: %i\n", __LINE__, fGetUniformLocation );
SkDebugf("%d: %i\n", __LINE__, fLinkProgram );
SkDebugf("%d: %i\n", __LINE__, fPixelStorei );
SkDebugf("%d: %i\n", __LINE__, fReadPixels );
SkDebugf("%d: %i\n", __LINE__, fScissor );
SkDebugf("%d: %i\n", __LINE__, fShaderSource );
SkDebugf("%d: %i\n", __LINE__, fStencilFunc );
SkDebugf("%d: %i\n", __LINE__, fStencilMask );
SkDebugf("%d: %i\n", __LINE__, fStencilOp );
SkDebugf("%d: %i\n", __LINE__, fTexImage2D );
SkDebugf("%d: %i\n", __LINE__, fTexParameteri );
SkDebugf("%d: %i\n", __LINE__, fTexParameteriv );
SkDebugf("%d: %i\n", __LINE__, fTexSubImage2D );
SkDebugf("%d: %i\n", __LINE__, fUniform1f );
SkDebugf("%d: %i\n", __LINE__, fUniform1i );
SkDebugf("%d: %i\n", __LINE__, fUniform1fv );
SkDebugf("%d: %i\n", __LINE__, fUniform1iv );
SkDebugf("%d: %i\n", __LINE__, fUniform2f );
SkDebugf("%d: %i\n", __LINE__, fUniform2i );
SkDebugf("%d: %i\n", __LINE__, fUniform2fv );
SkDebugf("%d: %i\n", __LINE__, fUniform2iv );
SkDebugf("%d: %i\n", __LINE__, fUniform3f );
SkDebugf("%d: %i\n", __LINE__, fUniform3i );
SkDebugf("%d: %i\n", __LINE__, fUniform3fv );
SkDebugf("%d: %i\n", __LINE__, fUniform3iv );
SkDebugf("%d: %i\n", __LINE__, fUniform4f );
SkDebugf("%d: %i\n", __LINE__, fUniform4i );
SkDebugf("%d: %i\n", __LINE__, fUniform4fv );
SkDebugf("%d: %i\n", __LINE__, fUniform4iv );
SkDebugf("%d: %i\n", __LINE__, fUniformMatrix2fv );
SkDebugf("%d: %i\n", __LINE__, fUniformMatrix3fv );
SkDebugf("%d: %i\n", __LINE__, fUniformMatrix4fv );
SkDebugf("%d: %i\n", __LINE__, fUseProgram );
SkDebugf("%d: %i\n", __LINE__, fVertexAttrib4fv );
SkDebugf("%d: %i\n", __LINE__, fVertexAttribPointer );
SkDebugf("%d: %i\n", __LINE__, fViewport );
SkDebugf("%d: %i\n", __LINE__, fBindFramebuffer );
SkDebugf("%d: %i\n", __LINE__, fBindRenderbuffer );
SkDebugf("%d: %i\n", __LINE__, fCheckFramebufferStatus );
SkDebugf("%d: %i\n", __LINE__, fDeleteFramebuffers );
SkDebugf("%d: %i\n", __LINE__, fDeleteRenderbuffers );
SkDebugf("%d: %i\n", __LINE__, fFinish );
SkDebugf("%d: %i\n", __LINE__, fFlush );
SkDebugf("%d: %i\n", __LINE__, fFramebufferRenderbuffer );
SkDebugf("%d: %i\n", __LINE__, fFramebufferTexture2D );
SkDebugf("%d: %i\n", __LINE__, fGetFramebufferAttachmentParameteriv );
SkDebugf("%d: %i\n", __LINE__, fGetRenderbufferParameteriv );
SkDebugf("%d: %i\n", __LINE__, fGenFramebuffers );
SkDebugf("%d: %i\n", __LINE__, fGenRenderbuffers );
SkDebugf("%d: %i\n", __LINE__, fRenderbufferStorage);
return false;
}
@ -236,9 +146,6 @@ bool GrGLInterface::validate(GrGLBinding binding) const {
if (NULL == fStencilFuncSeparate ||
NULL == fStencilMaskSeparate ||
NULL == fStencilOpSeparate) {
SkDebugf("%d: %i\n", __LINE__, fStencilFuncSeparate );
SkDebugf("%d: %i\n", __LINE__, fStencilMaskSeparate );
SkDebugf("%d: %i\n", __LINE__, fStencilOpSeparate);
return false;
}
} else if (kDesktop_GrGLBinding == binding) {
@ -247,20 +154,15 @@ bool GrGLInterface::validate(GrGLBinding binding) const {
if (NULL == fStencilFuncSeparate ||
NULL == fStencilMaskSeparate ||
NULL == fStencilOpSeparate) {
SkDebugf("%d: %i\n", __LINE__, fStencilFuncSeparate );
SkDebugf("%d: %i\n", __LINE__, fStencilMaskSeparate );
SkDebugf("%d: %i\n", __LINE__, fStencilOpSeparate);
return false;
}
}
if (glVer >= GR_GL_VER(3,0) && NULL == fBindFragDataLocation) {
SkDebugf("%d: %i\n", __LINE__, fBindFragDataLocation );
return false;
}
if (glVer >= GR_GL_VER(2,0) ||
GrGLHasExtensionFromString("GL_ARB_draw_buffers", ext)) {
if (NULL == fDrawBuffers) {
SkDebugf("%d: %i\n", __LINE__, fDrawBuffers );
return false;
}
}
@ -274,13 +176,6 @@ bool GrGLInterface::validate(GrGLBinding binding) const {
NULL == fGetQueryiv ||
NULL == fGetQueryObjectiv ||
NULL == fGetQueryObjectuiv) {
SkDebugf("%d: %i\n", __LINE__, fGenQueries );
SkDebugf("%d: %i\n", __LINE__, fDeleteQueries );
SkDebugf("%d: %i\n", __LINE__, fBeginQuery);
SkDebugf("%d: %i\n", __LINE__, fEndQuery );
SkDebugf("%d: %i\n", __LINE__, fGetQueryiv );
SkDebugf("%d: %i\n", __LINE__, fGetQueryObjectiv);
SkDebugf("%d: %i\n", __LINE__, fGetQueryObjectuiv);
return false;
}
}
@ -289,15 +184,12 @@ bool GrGLInterface::validate(GrGLBinding binding) const {
GrGLHasExtensionFromString("GL_EXT_timer_query", ext)) {
if (NULL == fGetQueryObjecti64v ||
NULL == fGetQueryObjectui64v) {
SkDebugf("%d: %i\n", __LINE__, fGetQueryObjecti64v);
SkDebugf("%d: %i\n", __LINE__, fGetQueryObjectui64v);
return false;
}
}
if (glVer >= GR_GL_VER(3,3) ||
GrGLHasExtensionFromString("GL_ARB_timer_query", ext)) {
if (NULL == fQueryCounter) {
SkDebugf("%d: %i\n", __LINE__, fQueryCounter);
return false;
}
}
@ -308,9 +200,6 @@ bool GrGLInterface::validate(GrGLBinding binding) const {
(NULL == fMatrixMode ||
NULL == fLoadIdentity ||
NULL == fLoadMatrixf)) {
SkDebugf("%d: %i\n", __LINE__, fMatrixMode );
SkDebugf("%d: %i\n", __LINE__, fLoadIdentity);
SkDebugf("%d: %i\n", __LINE__, fLoadMatrixf);
return false;
}
if (false && GrGLHasExtensionFromString("GL_NV_path_rendering", ext)) {
@ -363,55 +252,6 @@ bool GrGLInterface::validate(GrGLBinding binding) const {
NULL == fIsPointInStrokePath ||
NULL == fGetPathLength ||
NULL == fPointAlongPath) {
SkDebugf("%d: %i\n", __LINE__, fPathCommands );
SkDebugf("%d: %i\n", __LINE__, fPathCoords );
SkDebugf("%d: %i\n", __LINE__, fPathSubCommands );
SkDebugf("%d: %i\n", __LINE__, fPathSubCoords );
SkDebugf("%d: %i\n", __LINE__, fPathString );
SkDebugf("%d: %i\n", __LINE__, fPathGlyphs );
SkDebugf("%d: %i\n", __LINE__, fPathGlyphRange );
SkDebugf("%d: %i\n", __LINE__, fWeightPaths );
SkDebugf("%d: %i\n", __LINE__, fCopyPath );
SkDebugf("%d: %i\n", __LINE__, fInterpolatePaths );
SkDebugf("%d: %i\n", __LINE__, fTransformPath );
SkDebugf("%d: %i\n", __LINE__, fPathParameteriv );
SkDebugf("%d: %i\n", __LINE__, fPathParameteri );
SkDebugf("%d: %i\n", __LINE__, fPathParameterfv );
SkDebugf("%d: %i\n", __LINE__, fPathParameterf );
SkDebugf("%d: %i\n", __LINE__, fPathDashArray );
SkDebugf("%d: %i\n", __LINE__, fGenPaths );
SkDebugf("%d: %i\n", __LINE__, fDeletePaths );
SkDebugf("%d: %i\n", __LINE__, fIsPath );
SkDebugf("%d: %i\n", __LINE__, fPathStencilFunc );
SkDebugf("%d: %i\n", __LINE__, fPathStencilDepthOffset );
SkDebugf("%d: %i\n", __LINE__, fStencilFillPath );
SkDebugf("%d: %i\n", __LINE__, fStencilStrokePath );
SkDebugf("%d: %i\n", __LINE__, fStencilFillPathInstanced );
SkDebugf("%d: %i\n", __LINE__, fStencilStrokePathInstanced );
SkDebugf("%d: %i\n", __LINE__, fPathCoverDepthFunc );
SkDebugf("%d: %i\n", __LINE__, fPathColorGen );
SkDebugf("%d: %i\n", __LINE__, fPathTexGen );
SkDebugf("%d: %i\n", __LINE__, fPathFogGen );
SkDebugf("%d: %i\n", __LINE__, fCoverFillPath );
SkDebugf("%d: %i\n", __LINE__, fCoverStrokePath );
SkDebugf("%d: %i\n", __LINE__, fCoverFillPathInstanced );
SkDebugf("%d: %i\n", __LINE__, fCoverStrokePathInstanced );
SkDebugf("%d: %i\n", __LINE__, fGetPathParameteriv );
SkDebugf("%d: %i\n", __LINE__, fGetPathParameterfv );
SkDebugf("%d: %i\n", __LINE__, fGetPathCommands );
SkDebugf("%d: %i\n", __LINE__, fGetPathCoords );
SkDebugf("%d: %i\n", __LINE__, fGetPathDashArray );
SkDebugf("%d: %i\n", __LINE__, fGetPathMetrics );
SkDebugf("%d: %i\n", __LINE__, fGetPathMetricRange );
SkDebugf("%d: %i\n", __LINE__, fGetPathSpacing );
SkDebugf("%d: %i\n", __LINE__, fGetPathColorGeniv );
SkDebugf("%d: %i\n", __LINE__, fGetPathColorGenfv );
SkDebugf("%d: %i\n", __LINE__, fGetPathTexGeniv );
SkDebugf("%d: %i\n", __LINE__, fGetPathTexGenfv );
SkDebugf("%d: %i\n", __LINE__, fIsPointInFillPath );
SkDebugf("%d: %i\n", __LINE__, fIsPointInStrokePath );
SkDebugf("%d: %i\n", __LINE__, fGetPathLength );
SkDebugf("%d: %i\n", __LINE__, fPointAlongPath );
return false;
}
}
@ -422,7 +262,6 @@ bool GrGLInterface::validate(GrGLBinding binding) const {
(glVer >= GR_GL_VER(1,3) ||
GrGLHasExtensionFromString("GL_ARB_texture_compression", ext))) {
if (NULL == fCompressedTexImage2D) {
SkDebugf("%d: %i\n", __LINE__, fCompressedTexImage2D);
return false;
}
}
@ -433,10 +272,6 @@ bool GrGLInterface::validate(GrGLBinding binding) const {
NULL == fGetTexLevelParameteriv ||
NULL == fDrawBuffer ||
NULL == fReadBuffer)) {
SkDebugf("%d: %i\n", __LINE__, fLineWidth);
SkDebugf("%d: %i\n", __LINE__, fGetTexLevelParameteriv);
SkDebugf("%d: %i\n", __LINE__, fDrawBuffer);
SkDebugf("%d: %i\n", __LINE__, fReadBuffer);
return false;
}
@ -447,13 +282,11 @@ bool GrGLInterface::validate(GrGLBinding binding) const {
GrGLHasExtensionFromString("GL_ARB_texture_storage", ext) ||
GrGLHasExtensionFromString("GL_EXT_texture_storage", ext)) {
if (NULL == fTexStorage2D) {
SkDebugf("%d: %i\n", __LINE__, fTexStorage2D);
return false;
}
}
} else if (GrGLHasExtensionFromString("GL_EXT_texture_storage", ext)) {
if (NULL == fTexStorage2D) {
SkDebugf("%d: %i\n", __LINE__, fTexStorage2D);
return false;
}
}
@ -464,19 +297,15 @@ bool GrGLInterface::validate(GrGLBinding binding) const {
if (glVer >= GR_GL_VER(3,0) || GrGLHasExtensionFromString("GL_ARB_framebuffer_object", ext)) {
if (NULL == fRenderbufferStorageMultisample ||
NULL == fBlitFramebuffer) {
SkDebugf("%d: %i\n", __LINE__, fRenderbufferStorageMultisample);
SkDebugf("%d: %i\n", __LINE__, fBlitFramebuffer);
return false;
}
} else {
if (GrGLHasExtensionFromString("GL_EXT_framebuffer_blit", ext) &&
NULL == fBlitFramebuffer) {
SkDebugf("%d: %i\n", __LINE__, fBlitFramebuffer);
return false;
}
if (GrGLHasExtensionFromString("GL_EXT_framebuffer_multisample", ext) &&
NULL == fRenderbufferStorageMultisample) {
SkDebugf("%d: %i\n", __LINE__, fRenderbufferStorageMultisample);
return false;
}
}
@ -484,16 +313,12 @@ bool GrGLInterface::validate(GrGLBinding binding) const {
if (GrGLHasExtensionFromString("GL_CHROMIUM_framebuffer_multisample", ext)) {
if (NULL == fRenderbufferStorageMultisample ||
NULL == fBlitFramebuffer) {
SkDebugf("%d: %i\n", __LINE__, fRenderbufferStorageMultisample);
SkDebugf("%d: %i\n", __LINE__, fBlitFramebuffer);
return false;
}
}
if (GrGLHasExtensionFromString("GL_APPLE_framebuffer_multisample", ext)) {
if (NULL == fRenderbufferStorageMultisample ||
NULL == fResolveMultisampleFramebuffer) {
SkDebugf("%d: %i\n", __LINE__, fRenderbufferStorageMultisample);
SkDebugf("%d: %i\n", __LINE__, fResolveMultisampleFramebuffer);
return false;
}
}
@ -506,8 +331,6 @@ bool GrGLInterface::validate(GrGLBinding binding) const {
GrGLHasExtensionFromString("GL_OES_mapbuffer", ext)) {
if (NULL == fMapBuffer ||
NULL == fUnmapBuffer) {
SkDebugf("%d: %i\n", __LINE__, fMapBuffer);
SkDebugf("%d: %i\n", __LINE__, fUnmapBuffer);
return false;
}
}
@ -517,7 +340,6 @@ bool GrGLInterface::validate(GrGLBinding binding) const {
(glVer >= GR_GL_VER(3,3) ||
GrGLHasExtensionFromString("GL_ARB_blend_func_extended", ext))) {
if (NULL == fBindFragDataLocationIndexed) {
SkDebugf("%d: %i\n", __LINE__, fBindFragDataLocationIndexed);
return false;
}
}