remove unused (and undefined) SkColorSpace parameter.
authormike@reedtribe.org <mike@reedtribe.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 15 Nov 2012 02:37:45 +0000 (02:37 +0000)
committermike@reedtribe.org <mike@reedtribe.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Thu, 15 Nov 2012 02:37:45 +0000 (02:37 +0000)
git-svn-id: http://skia.googlecode.com/svn/trunk@6427 2bbb7eff-a529-9590-31e7-b0007b416f81

13 files changed:
gm/fatpathfill.cpp
gm/image.cpp
include/core/SkImage.h
include/core/SkSurface.h
samplecode/SampleFatBits.cpp
src/image/SkImagePriv.cpp
src/image/SkImage_Raster.cpp
src/image/SkSurface.cpp
src/image/SkSurface_Base.h
src/image/SkSurface_Gpu.cpp
src/image/SkSurface_Picture.cpp
src/image/SkSurface_Raster.cpp
tests/PathTest.cpp

index 3fea6f4f3da946635bbe3b834fadd880d4a17d66..c86dfcb6af9b5b47133330f1fe2e494d3549f045 100644 (file)
@@ -22,7 +22,7 @@ static SkSurface* new_surface(int width, int height) {
         SkImage::kPMColor_ColorType,
         SkImage::kPremul_AlphaType
     };
-    return SkSurface::NewRaster(info, NULL);
+    return SkSurface::NewRaster(info);
 }
 
 static void draw_pixel_centers(SkCanvas* canvas) {
index 6f326a8a29b74854934a6dcc6fed4bf923369be1..e54d3c7b2f163f8bf0b218349e3862019dc476b3 100644 (file)
@@ -158,13 +158,13 @@ protected:
         info.fHeight = H;
         info.fColorType = SkImage::kPMColor_ColorType;
         info.fAlphaType = SkImage::kPremul_AlphaType;
-        SkAutoTUnref<SkSurface> surf0(SkSurface::NewRasterDirect(info, NULL, fBuffer, RB));
-        SkAutoTUnref<SkSurface> surf1(SkSurface::NewRaster(info, NULL));
+        SkAutoTUnref<SkSurface> surf0(SkSurface::NewRasterDirect(info, fBuffer, RB));
+        SkAutoTUnref<SkSurface> surf1(SkSurface::NewRaster(info));
         SkAutoTUnref<SkSurface> surf2(SkSurface::NewPicture(info.fWidth, info.fHeight));
 #if SK_SUPPORT_GPU
         GrContext* ctx = skiagm::GetGr();
 
-        SkAutoTUnref<SkSurface> surf3(SkSurface::NewRenderTarget(ctx, info, NULL, 0));
+        SkAutoTUnref<SkSurface> surf3(SkSurface::NewRenderTarget(ctx, info, 0));
 #endif
 
         test_surface(canvas, surf0);
index 2fa7b51e45f06ee279b527d1af6023a42e372b5e..b8ebc3aca57f65bdd76e730f22ac1cac4bf21290 100644 (file)
@@ -23,8 +23,6 @@ class GrTexture;
 
 ////// EXPERIMENTAL
 
-class SkColorSpace;
-
 /**
  *  SkImage is an abstraction for drawing a rectagle of pixels, though the
  *  particular type of image could be actually storing its data on the GPU, or
@@ -65,8 +63,8 @@ public:
         AlphaType   fAlphaType;
     };
 
-    static SkImage* NewRasterCopy(const Info&, SkColorSpace*, const void* pixels, size_t rowBytes);
-    static SkImage* NewRasterData(const Info&, SkColorSpace*, SkData* pixels, size_t rowBytes);
+    static SkImage* NewRasterCopy(const Info&, const void* pixels, size_t rowBytes);
+    static SkImage* NewRasterData(const Info&, SkData* pixels, size_t rowBytes);
     static SkImage* NewEncodedData(SkData*);
     static SkImage* NewTexture(GrTexture*);
 
index 18ae5ccdc77ffc8225b464949f038f9ae3985ee1..70012994db03cf5eb7308494c1a64b4c233cf4be 100644 (file)
@@ -35,8 +35,7 @@ public:
      *  If the requested surface cannot be created, or the request is not a
      *  supported configuration, NULL will be returned.
      */
-    static SkSurface* NewRasterDirect(const SkImage::Info&, SkColorSpace*,
-                                      void* pixels, size_t rowBytes);
+    static SkSurface* NewRasterDirect(const SkImage::Info&, void* pixels, size_t rowBytes);
 
     /**
      *  Return a new surface, with the memory for the pixels automatically
@@ -45,7 +44,7 @@ public:
      *  If the requested surface cannot be created, or the request is not a
      *  supported configuration, NULL will be returned.
      */
-    static SkSurface* NewRaster(const SkImage::Info&, SkColorSpace*);
+    static SkSurface* NewRaster(const SkImage::Info&);
 
     /**
      *  Return a new surface whose contents will be recorded into a picture.
@@ -63,8 +62,7 @@ public:
      *  Return a new surface whose contents will be drawn to an offscreen
      *  render target, allocated by the surface.
      */
-    static SkSurface* NewRenderTarget(GrContext*, const SkImage::Info&,
-                                      SkColorSpace*, int sampleCount = 0);
+    static SkSurface* NewRenderTarget(GrContext*, const SkImage::Info&, int sampleCount = 0);
 
     int width() const { return fWidth; }
     int height() const { return fHeight; }
@@ -107,7 +105,7 @@ public:
      *  ... // draw using canvasB
      *  canvasA->drawSurface(surfaceB); // <--- this will always be optimal!
      */
-    SkSurface* newSurface(const SkImage::Info&, SkColorSpace*);
+    SkSurface* newSurface(const SkImage::Info&);
 
     /**
      *  Returns an image of the current state of the surface pixels up to this
index e88a1d5aab8844a6ae347bef3907180f212e0a78..eac713632fbe2761b7c4a2868c895d12bbf9b43f 100644 (file)
@@ -91,10 +91,10 @@ public:
         SkImage::Info info = {
             width, height, SkImage::kPMColor_ColorType, SkImage::kPremul_AlphaType
         };
-        fMinSurface.reset(SkSurface::NewRaster(info, NULL));
+        fMinSurface.reset(SkSurface::NewRaster(info));
         info.fWidth *= zoom;
         info.fHeight *= zoom;
-        fMaxSurface.reset(SkSurface::NewRaster(info, NULL));
+        fMaxSurface.reset(SkSurface::NewRaster(info));
     }
 
     void drawBG(SkCanvas*);
index e7a244ab54b90d1f52ece17e33e0a2875fd7c898..e10a44c28c622562cf0597f58c0a1f9c4cc9752d 100644 (file)
@@ -108,8 +108,7 @@ SkImage* SkNewImageFromBitmap(const SkBitmap& bm, bool canSharePixelRef) {
     } else {
         bm.lockPixels();
         if (bm.getPixels()) {
-            image = SkImage::NewRasterCopy(info, NULL, bm.getPixels(),
-                                           bm.rowBytes());
+            image = SkImage::NewRasterCopy(info, bm.getPixels(), bm.rowBytes());
         }
         bm.unlockPixels();
     }
index c9a132d3718ac3d179d02c2ed793c769bb02dda4..8638052fc54ed907f6864457eccb441c4a7eafce 100644 (file)
@@ -14,7 +14,7 @@
 
 class SkImage_Raster : public SkImage_Base {
 public:
-    static bool ValidArgs(const Info& info, SkColorSpace* cs, size_t rowBytes) {
+    static bool ValidArgs(const Info& info, size_t rowBytes) {
         const int maxDimension = SK_MaxS32 >> 2;
         const size_t kMaxPixelByteSize = SK_MaxS32;
 
@@ -51,7 +51,7 @@ public:
 
     static SkImage* NewEmpty();
 
-    SkImage_Raster(const SkImage::Info&, SkColorSpace*, SkData*, size_t rb);
+    SkImage_Raster(const SkImage::Info&, SkData*, size_t rb);
     virtual ~SkImage_Raster();
 
     virtual void onDraw(SkCanvas*, SkScalar, SkScalar, const SkPaint*) SK_OVERRIDE;
@@ -81,9 +81,8 @@ SkImage* SkImage_Raster::NewEmpty() {
     return gEmpty;
 }
 
-SkImage_Raster::SkImage_Raster(const Info& info, SkColorSpace* cs,
-                               SkData* data, size_t rowBytes)
-: INHERITED(info.fWidth, info.fHeight) {
+SkImage_Raster::SkImage_Raster(const Info& info, SkData* data, size_t rowBytes)
+        : INHERITED(info.fWidth, info.fHeight) {
     bool isOpaque;
     SkBitmap::Config config = SkImageInfoToBitmapConfig(info, &isOpaque);
 
@@ -112,9 +111,8 @@ void SkImage_Raster::onDraw(SkCanvas* canvas, SkScalar x, SkScalar y, const SkPa
 
 ///////////////////////////////////////////////////////////////////////////////
 
-SkImage* SkImage::NewRasterCopy(const SkImage::Info& info, SkColorSpace* cs,
-                                const void* pixels, size_t rowBytes) {
-    if (!SkImage_Raster::ValidArgs(info, cs, rowBytes)) {
+SkImage* SkImage::NewRasterCopy(const SkImage::Info& info, const void* pixels, size_t rowBytes) {
+    if (!SkImage_Raster::ValidArgs(info, rowBytes)) {
         return NULL;
     }
     if (0 == info.fWidth && 0 == info.fHeight) {
@@ -127,13 +125,12 @@ SkImage* SkImage::NewRasterCopy(const SkImage::Info& info, SkColorSpace* cs,
 
     // Here we actually make a copy of the caller's pixel data
     SkAutoDataUnref data(SkData::NewWithCopy(pixels, info.fHeight * rowBytes));
-    return SkNEW_ARGS(SkImage_Raster, (info, cs, data, rowBytes));
+    return SkNEW_ARGS(SkImage_Raster, (info, data, rowBytes));
 }
 
 
-SkImage* SkImage::NewRasterData(const SkImage::Info& info, SkColorSpace* cs,
-                                SkData* pixelData, size_t rowBytes) {
-    if (!SkImage_Raster::ValidArgs(info, cs, rowBytes)) {
+SkImage* SkImage::NewRasterData(const SkImage::Info& info, SkData* pixelData, size_t rowBytes) {
+    if (!SkImage_Raster::ValidArgs(info, rowBytes)) {
         return NULL;
     }
     if (0 == info.fWidth && 0 == info.fHeight) {
@@ -151,7 +148,7 @@ SkImage* SkImage::NewRasterData(const SkImage::Info& info, SkColorSpace* cs,
     }
 
     SkAutoDataUnref data(pixelData);
-    return SkNEW_ARGS(SkImage_Raster, (info, cs, data, rowBytes));
+    return SkNEW_ARGS(SkImage_Raster, (info, data, rowBytes));
 }
 
 SkImage* SkNewImageFromPixelRef(const SkImage::Info& info, SkPixelRef* pr,
index 92089e38ad9f87aedac1ebfdacb03c66171791eb..654778043811bf765f39723b1ed16cd67e52c006 100644 (file)
@@ -123,8 +123,8 @@ SkImage* SkSurface::newImageShapshot() {
     return image;
 }
 
-SkSurface* SkSurface::newSurface(const SkImage::Info& info, SkColorSpace* cs) {
-    return asSB(this)->onNewSurface(info, cs);
+SkSurface* SkSurface::newSurface(const SkImage::Info& info) {
+    return asSB(this)->onNewSurface(info);
 }
 
 void SkSurface::draw(SkCanvas* canvas, SkScalar x, SkScalar y,
index 9d440f48921ed337deee4a8979d7e66e660c45ba..e5ca498b859d612b68e2b6b861e54d7ceb9540a4 100644 (file)
@@ -23,7 +23,7 @@ public:
      */
     virtual SkCanvas* onNewCanvas() = 0;
 
-    virtual SkSurface* onNewSurface(const SkImage::Info&, SkColorSpace*) = 0;
+    virtual SkSurface* onNewSurface(const SkImage::Info&) = 0;
 
     /**
      *  Allocate an SkImage that represents the current contents of the surface.
index 54c74b2babc035f06036bee356368634a9cf887f..74fbe0b0b2bbfedf94958b3605c646631a89e600 100644 (file)
@@ -19,7 +19,7 @@ public:
     virtual ~SkSurface_Gpu();
 
     virtual SkCanvas* onNewCanvas() SK_OVERRIDE;
-    virtual SkSurface* onNewSurface(const SkImage::Info&, SkColorSpace*) SK_OVERRIDE;
+    virtual SkSurface* onNewSurface(const SkImage::Info&) SK_OVERRIDE;
     virtual SkImage* onNewImageShapshot() SK_OVERRIDE;
     virtual void onDraw(SkCanvas*, SkScalar x, SkScalar y,
                         const SkPaint*) SK_OVERRIDE;
@@ -65,11 +65,10 @@ SkCanvas* SkSurface_Gpu::onNewCanvas() {
     return SkNEW_ARGS(SkCanvas, (fDevice));
 }
 
-SkSurface* SkSurface_Gpu::onNewSurface(const SkImage::Info& info,
-                                       SkColorSpace* cs) {
+SkSurface* SkSurface_Gpu::onNewSurface(const SkImage::Info& info) {
     GrRenderTarget* rt = (GrRenderTarget*) fDevice->accessRenderTarget();
     int sampleCount = rt->numSamples();
-    return SkSurface::NewRenderTarget(fDevice->context(), info, NULL, sampleCount);
+    return SkSurface::NewRenderTarget(fDevice->context(), info, sampleCount);
 }
 
 SkImage* SkSurface_Gpu::onNewImageShapshot() {
@@ -123,8 +122,7 @@ SkSurface* SkSurface::NewRenderTargetDirect(GrContext* ctx,
     return SkNEW_ARGS(SkSurface_Gpu, (ctx, target));
 }
 
-SkSurface* SkSurface::NewRenderTarget(GrContext* ctx, const SkImage::Info& info,
-                                      SkColorSpace*, int sampleCount) {
+SkSurface* SkSurface::NewRenderTarget(GrContext* ctx, const SkImage::Info& info, int sampleCount) {
     if (NULL == ctx) {
         return NULL;
     }
index 80fc1f45f66acdf05cc0064d8ae4379be47e9e4b..54998445bc5c2e1713035aba36330b0239f358a7 100644 (file)
@@ -20,7 +20,7 @@ public:
     virtual ~SkSurface_Picture();
 
     virtual SkCanvas* onNewCanvas() SK_OVERRIDE;
-    virtual SkSurface* onNewSurface(const SkImage::Info&, SkColorSpace*) SK_OVERRIDE;
+    virtual SkSurface* onNewSurface(const SkImage::Info&) SK_OVERRIDE;
     virtual SkImage* onNewImageShapshot() SK_OVERRIDE;
     virtual void onDraw(SkCanvas*, SkScalar x, SkScalar y,
                         const SkPaint*) SK_OVERRIDE;
@@ -52,7 +52,7 @@ SkCanvas* SkSurface_Picture::onNewCanvas() {
     return canvas;
 }
 
-SkSurface* SkSurface_Picture::onNewSurface(const SkImage::Info& info, SkColorSpace*) {
+SkSurface* SkSurface_Picture::onNewSurface(const SkImage::Info& info) {
     return SkSurface::NewPicture(info.fWidth, info.fHeight);
 }
 
@@ -64,7 +64,7 @@ SkImage* SkSurface_Picture::onNewImageShapshot() {
         info.fWidth = info.fHeight = 0;
         info.fColorType = SkImage::kPMColor_ColorType;
         info.fAlphaType = SkImage::kOpaque_AlphaType;
-        return SkImage::NewRasterCopy(info, NULL, NULL, 0);
+        return SkImage::NewRasterCopy(info, NULL, 0);
     }
 }
 
index 8afab6b01cf7b4dc03e7e18f8a6b12b1bc23e83d..dd318191a7871326e3ad65b128f744ffa0ae3183 100644 (file)
@@ -15,13 +15,13 @@ static const size_t kIgnoreRowBytesValue = (size_t)~0;
 
 class SkSurface_Raster : public SkSurface_Base {
 public:
-    static bool Valid(const SkImage::Info&, SkColorSpace*, size_t rb = kIgnoreRowBytesValue);
+    static bool Valid(const SkImage::Info&, size_t rb = kIgnoreRowBytesValue);
 
-    SkSurface_Raster(const SkImage::Info&, SkColorSpace*, void*, size_t rb);
-    SkSurface_Raster(const SkImage::Info&, SkColorSpace*, SkPixelRef*, size_t rb);
+    SkSurface_Raster(const SkImage::Info&, void*, size_t rb);
+    SkSurface_Raster(const SkImage::Info&, SkPixelRef*, size_t rb);
 
     virtual SkCanvas* onNewCanvas() SK_OVERRIDE;
-    virtual SkSurface* onNewSurface(const SkImage::Info&, SkColorSpace*) SK_OVERRIDE;
+    virtual SkSurface* onNewSurface(const SkImage::Info&) SK_OVERRIDE;
     virtual SkImage* onNewImageShapshot() SK_OVERRIDE;
     virtual void onDraw(SkCanvas*, SkScalar x, SkScalar y,
                         const SkPaint*) SK_OVERRIDE;
@@ -36,8 +36,7 @@ private:
 
 ///////////////////////////////////////////////////////////////////////////////
 
-bool SkSurface_Raster::Valid(const SkImage::Info& info, SkColorSpace* cs,
-                             size_t rowBytes) {
+bool SkSurface_Raster::Valid(const SkImage::Info& info, size_t rowBytes) {
     static const size_t kMaxTotalSize = SK_MaxS32;
 
     bool isOpaque;
@@ -82,8 +81,7 @@ bool SkSurface_Raster::Valid(const SkImage::Info& info, SkColorSpace* cs,
     return true;
 }
 
-SkSurface_Raster::SkSurface_Raster(const SkImage::Info& info, SkColorSpace* cs,
-                                   void* pixels, size_t rb)
+SkSurface_Raster::SkSurface_Raster(const SkImage::Info& info, void* pixels, size_t rb)
         : INHERITED(info.fWidth, info.fHeight) {
     bool isOpaque;
     SkBitmap::Config config = SkImageInfoToBitmapConfig(info, &isOpaque);
@@ -94,8 +92,7 @@ SkSurface_Raster::SkSurface_Raster(const SkImage::Info& info, SkColorSpace* cs,
     fWeOwnThePixels = false;    // We are "Direct"
 }
 
-SkSurface_Raster::SkSurface_Raster(const SkImage::Info& info, SkColorSpace* cs,
-                                   SkPixelRef* pr, size_t rb)
+SkSurface_Raster::SkSurface_Raster(const SkImage::Info& info, SkPixelRef* pr, size_t rb)
         : INHERITED(info.fWidth, info.fHeight) {
     bool isOpaque;
     SkBitmap::Config config = SkImageInfoToBitmapConfig(info, &isOpaque);
@@ -114,9 +111,8 @@ SkCanvas* SkSurface_Raster::onNewCanvas() {
     return SkNEW_ARGS(SkCanvas, (fBitmap));
 }
 
-SkSurface* SkSurface_Raster::onNewSurface(const SkImage::Info& info,
-                                          SkColorSpace* cs) {
-    return SkSurface::NewRaster(info, cs);
+SkSurface* SkSurface_Raster::onNewSurface(const SkImage::Info& info) {
+    return SkSurface::NewRaster(info);
 }
 
 void SkSurface_Raster::onDraw(SkCanvas* canvas, SkScalar x, SkScalar y,
@@ -143,21 +139,19 @@ void SkSurface_Raster::onCopyOnWrite(SkImage* image, SkCanvas* canvas) {
 
 ///////////////////////////////////////////////////////////////////////////////
 
-SkSurface* SkSurface::NewRasterDirect(const SkImage::Info& info,
-                                      SkColorSpace* cs,
-                                      void* pixels, size_t rowBytes) {
-    if (!SkSurface_Raster::Valid(info, cs, rowBytes)) {
+SkSurface* SkSurface::NewRasterDirect(const SkImage::Info& info, void* pixels, size_t rowBytes) {
+    if (!SkSurface_Raster::Valid(info, rowBytes)) {
         return NULL;
     }
     if (NULL == pixels) {
         return NULL;
     }
 
-    return SkNEW_ARGS(SkSurface_Raster, (info, cs, pixels, rowBytes));
+    return SkNEW_ARGS(SkSurface_Raster, (info, pixels, rowBytes));
 }
 
-SkSurface* SkSurface::NewRaster(const SkImage::Info& info, SkColorSpace* cs) {
-    if (!SkSurface_Raster::Valid(info, cs)) {
+SkSurface* SkSurface::NewRaster(const SkImage::Info& info) {
+    if (!SkSurface_Raster::Valid(info)) {
         return NULL;
     }
 
@@ -175,6 +169,6 @@ SkSurface* SkSurface::NewRaster(const SkImage::Info& info, SkColorSpace* cs) {
     }
 
     SkAutoTUnref<SkPixelRef> pr(SkNEW_ARGS(SkMallocPixelRef, (pixels, size, NULL, true)));
-    return SkNEW_ARGS(SkSurface_Raster, (info, cs, pr, rowBytes));
+    return SkNEW_ARGS(SkSurface_Raster, (info, pr, rowBytes));
 }
 
index a74ba8a8e63ab1a141540e402e55cd6b8ec74836..97ba258ed78b214d821ba31dfebc913ba50c9d94 100644 (file)
@@ -22,7 +22,7 @@ static SkSurface* new_surface(int w, int h) {
     SkImage::Info info = {
         w, h, SkImage::kPMColor_ColorType, SkImage::kPremul_AlphaType
     };
-    return SkSurface::NewRaster(info, NULL);
+    return SkSurface::NewRaster(info);
 }
 
 // Make sure we stay non-finite once we get there (unless we reset or rewind).