make asABitmap() const
change private cache fields in gradient to be mutable



git-svn-id: http://skia.googlecode.com/svn/trunk@898 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/core/SkShader.cpp b/src/core/SkShader.cpp
index 6798bec..015389e 100644
--- a/src/core/SkShader.cpp
+++ b/src/core/SkShader.cpp
@@ -2,16 +2,16 @@
 **
 ** Copyright 2006, The Android Open Source Project
 **
-** Licensed under the Apache License, Version 2.0 (the "License"); 
-** you may not use this file except in compliance with the License. 
-** You may obtain a copy of the License at 
+** Licensed under the Apache License, Version 2.0 (the "License");
+** you may not use this file except in compliance with the License.
+** You may obtain a copy of the License at
 **
-**     http://www.apache.org/licenses/LICENSE-2.0 
+**     http://www.apache.org/licenses/LICENSE-2.0
 **
-** Unless required by applicable law or agreed to in writing, software 
-** distributed under the License is distributed on an "AS IS" BASIS, 
-** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 
-** See the License for the specific language governing permissions and 
+** Unless required by applicable law or agreed to in writing, software
+** distributed under the License is distributed on an "AS IS" BASIS,
+** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+** See the License for the specific language governing permissions and
 ** limitations under the License.
 */
 
@@ -120,7 +120,7 @@
 }
 
 #define kTempColorQuadCount 6   // balance between speed (larger) and saving stack-space
-#define kTempColorCount     (kTempColorQuadCount << 2)  
+#define kTempColorCount     (kTempColorQuadCount << 2)
 
 #ifdef SK_CPU_BENDIAN
     #define SkU32BitShiftToByteOffset(shift)    (3 - ((shift) >> 3))
@@ -198,7 +198,7 @@
 //////////////////////////////////////////////////////////////////////////////
 
 SkShader::BitmapType SkShader::asABitmap(SkBitmap*, SkMatrix*,
-                                         TileMode*, SkScalar*) {
+                                         TileMode*, SkScalar*) const {
     return kNone_BitmapType;
 }
 
@@ -311,7 +311,7 @@
 
 // if we had a asAColor method, that would be more efficient...
 SkShader::BitmapType SkColorShader::asABitmap(SkBitmap* bitmap, SkMatrix* matrix,
-                                              TileMode modes[], 
+                                              TileMode modes[],
                                               SkScalar* twoPointRadialParams) {
     // we cache the pixelref, since its generateID is used in the texture cache
     if (NULL == fAsABitmapPixelRef) {
@@ -320,7 +320,7 @@
         fAsABitmapPixelRef = new SkMallocPixelRef(storage, sizeof(SkPMColor),
                                                   NULL);
     }
-        
+
     if (bitmap) {
         bitmap->setConfig(SkBitmap::kARGB_8888_Config, 1, 1);
         bitmap->setPixelRef(fAsABitmapPixelRef);