Make RT & TEX base classes aware of NPOT/min-RT bloated size

Review URL: http://codereview.appspot.com/4849045/


git-svn-id: http://skia.googlecode.com/svn/trunk@2057 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/include/GrRenderTarget.h b/gpu/include/GrRenderTarget.h
index 06d62a4..13b1a3ac 100644
--- a/gpu/include/GrRenderTarget.h
+++ b/gpu/include/GrRenderTarget.h
@@ -44,6 +44,20 @@
     int height() const { return fHeight; }
 
     /**
+     * Retrieves the allocated width. It may differ from width for
+     * NPOT or min-RT size reasons.
+     * @return allocated width in pixels
+     */
+    int allocatedWidth() const { return fAllocatedWidth; }
+
+    /**
+     * Retrieves the allocated height. It may differ from height for
+     * NPOT or min-RT size reasons.
+     * @return allocated height in pixels
+     */
+    int allocatedHeight() const { return fAllocatedHeight; }
+
+    /**
      * @return the pixel config. Can be kUnknown_GrPixelConfig
      * if client asked us to render to a target that has a pixel
      * config that isn't equivalent with one of our configs.
@@ -151,6 +165,8 @@
                    GrTexture* texture,
                    int width,
                    int height,
+                   int allocatedWidth,
+                   int allocatedHeight,
                    GrPixelConfig config,
                    int sampleCnt)
         : INHERITED(gpu)
@@ -158,6 +174,8 @@
         , fTexture(texture)
         , fWidth(width)
         , fHeight(height)
+        , fAllocatedWidth(allocatedWidth)
+        , fAllocatedHeight(allocatedHeight)
         , fConfig(config)
         , fSampleCnt(sampleCnt)
     {
@@ -181,6 +199,8 @@
     GrTexture*      fTexture; // not ref'ed
     int             fWidth;
     int             fHeight;
+    int             fAllocatedWidth;
+    int             fAllocatedHeight;
     GrPixelConfig   fConfig;
     int             fSampleCnt;
     GrIRect         fResolveRect;