Add GrSurface parent class above GrTexture & GrRenderTarget

http://codereview.appspot.com/6297092/



git-svn-id: http://skia.googlecode.com/svn/trunk@4292 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/gl/GrGLRenderTarget.cpp b/src/gpu/gl/GrGLRenderTarget.cpp
index cce3def..4193519 100644
--- a/src/gpu/gl/GrGLRenderTarget.cpp
+++ b/src/gpu/gl/GrGLRenderTarget.cpp
@@ -25,6 +25,23 @@
     GrSafeRef(fTexIDObj);
 }
 
+namespace {
+GrTextureDesc MakeDesc(GrTextureFlags flags,
+                       int width, int height,
+                       GrPixelConfig config, int sampleCnt,
+                       uint64_t clientCacheID) {
+    GrTextureDesc temp;
+    temp.fFlags = flags;
+    temp.fWidth = width;
+    temp.fHeight = height;
+    temp.fConfig = config;
+    temp.fSampleCnt = sampleCnt;
+    temp.fClientCacheID = clientCacheID;
+    return temp;
+}
+
+};
+
 GrGLRenderTarget::GrGLRenderTarget(GrGpuGL* gpu,
                                    const Desc& desc,
                                    const GrGLIRect& viewport,
@@ -32,10 +49,10 @@
                                    GrGLTexture* texture)
     : INHERITED(gpu,
                 texture,
-                viewport.fWidth,
-                viewport.fHeight,
-                desc.fConfig,
-                desc.fSampleCnt) {
+                MakeDesc(kNone_GrTextureFlags,
+                         viewport.fWidth, viewport.fHeight,
+                         desc.fConfig, desc.fSampleCnt, 
+                         kDefault_CacheID)) {
     GrAssert(NULL != texID);
     GrAssert(NULL != texture);
     // FBO 0 can't also be a texture, right?
@@ -54,10 +71,10 @@
                                    const GrGLIRect& viewport)
     : INHERITED(gpu,
                 NULL,
-                viewport.fWidth,
-                viewport.fHeight,
-                desc.fConfig,
-                desc.fSampleCnt) {
+                MakeDesc(kNone_GrTextureFlags,
+                         viewport.fWidth, viewport.fHeight,
+                         desc.fConfig, desc.fSampleCnt, 
+                         kDefault_CacheID)) {
     this->init(desc, viewport, NULL);
 }