Fix bug where createTexture may bind a texture to GL without ever updating fHWState.fTexture (when texture is not bound to FBO).

Other minor changes:
Add commented out GL logging define to GrUserConfig
Remove dead GrGpuD3D9 file from xcode proj



git-svn-id: http://skia.googlecode.com/svn/trunk@663 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/include/GrUserConfig.h b/gpu/include/GrUserConfig.h
index 2e6f391..b0ea58c 100644
--- a/gpu/include/GrUserConfig.h
+++ b/gpu/include/GrUserConfig.h
@@ -42,6 +42,12 @@
  */
 //#define GR_DUMP_TEXTURE_UPLOAD    1
 
+/*
+ * To log all GL calls define this. Can be turned on and off at runtime by
+ * gPrintGL global variable. 
+ */
+//#define GR_GL_LOG_CALLS 1
+ 
 ////////////////////////////////////////////////////////////////////////////////
 // Decide Ganesh types
 
diff --git a/gpu/src/GrGpuGL.cpp b/gpu/src/GrGpuGL.cpp
index ebd0d03..de4010f 100644
--- a/gpu/src/GrGpuGL.cpp
+++ b/gpu/src/GrGpuGL.cpp
@@ -629,6 +629,7 @@
 #if GR_COLLECT_STATS
     ++fStats.fTextureChngCnt;
 #endif
+    fHWDrawState.fTexture = NULL;
 
     GR_GL(PixelStorei(GL_UNPACK_ALIGNMENT, glDesc.fUploadByteCount));
     if (GrTexture::kIndex_8_PixelConfig == desc.fFormat &&
@@ -770,8 +771,7 @@
 #if GR_COLLECT_STATS
         ++fStats.fTextureChngCnt;
 #endif
-
-        fHWDrawState.fTexture = NULL;
+        GrAssert(NULL == fHWDrawState.fTexture);
 
         err = ~GL_NO_ERROR;
         for (int i = 0; i < attempts; ++i) {
@@ -1440,6 +1440,7 @@
                 //GrPrintf("---- bindtexture %d\n", nextTexture->textureID());
                 fHWDrawState.fTexture = nextTexture;
             }
+
             const GrGLTexture::TexParams& oldTexParams = nextTexture->getTexParams();
             GrGLTexture::TexParams newTexParams;
             newTexParams.fFilter = fCurrDrawState.fSamplerState.isFilter() ?