move SkImage::ColorType into SkColorType
objective -- move clients over to SkImage
tasks
- use SkImageInfo instead of SkBitmap::Config
- add support for colortables to SkImage
- add drawImage to SkCanvas
- return SkImage from readPixels
This CL works towards the first task
R=robertphillips@google.com
Review URL: https://codereview.chromium.org/54363008
git-svn-id: http://skia.googlecode.com/svn/trunk@12077 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/image/SkSurface_Raster.cpp b/src/image/SkSurface_Raster.cpp
index 5beabf7..27db504 100644
--- a/src/image/SkSurface_Raster.cpp
+++ b/src/image/SkSurface_Raster.cpp
@@ -15,13 +15,13 @@
class SkSurface_Raster : public SkSurface_Base {
public:
- static bool Valid(const SkImage::Info&, size_t rb = kIgnoreRowBytesValue);
+ static bool Valid(const SkImageInfo&, size_t rb = kIgnoreRowBytesValue);
- SkSurface_Raster(const SkImage::Info&, void*, size_t rb);
- SkSurface_Raster(const SkImage::Info&, SkPixelRef*, size_t rb);
+ SkSurface_Raster(const SkImageInfo&, void*, size_t rb);
+ SkSurface_Raster(const SkImageInfo&, SkPixelRef*, size_t rb);
virtual SkCanvas* onNewCanvas() SK_OVERRIDE;
- virtual SkSurface* onNewSurface(const SkImage::Info&) SK_OVERRIDE;
+ virtual SkSurface* onNewSurface(const SkImageInfo&) SK_OVERRIDE;
virtual SkImage* onNewImageSnapshot() SK_OVERRIDE;
virtual void onDraw(SkCanvas*, SkScalar x, SkScalar y,
const SkPaint*) SK_OVERRIDE;
@@ -36,7 +36,7 @@
///////////////////////////////////////////////////////////////////////////////
-bool SkSurface_Raster::Valid(const SkImage::Info& info, size_t rowBytes) {
+bool SkSurface_Raster::Valid(const SkImageInfo& info, size_t rowBytes) {
static const size_t kMaxTotalSize = SK_MaxS32;
SkBitmap::Config config = SkImageInfoToBitmapConfig(info);
@@ -80,7 +80,7 @@
return true;
}
-SkSurface_Raster::SkSurface_Raster(const SkImage::Info& info, void* pixels, size_t rb)
+SkSurface_Raster::SkSurface_Raster(const SkImageInfo& info, void* pixels, size_t rb)
: INHERITED(info.fWidth, info.fHeight) {
SkBitmap::Config config = SkImageInfoToBitmapConfig(info);
fBitmap.setConfig(config, info.fWidth, info.fHeight, rb, info.fAlphaType);
@@ -88,7 +88,7 @@
fWeOwnThePixels = false; // We are "Direct"
}
-SkSurface_Raster::SkSurface_Raster(const SkImage::Info& info, SkPixelRef* pr, size_t rb)
+SkSurface_Raster::SkSurface_Raster(const SkImageInfo& info, SkPixelRef* pr, size_t rb)
: INHERITED(info.fWidth, info.fHeight) {
SkBitmap::Config config = SkImageInfoToBitmapConfig(info);
fBitmap.setConfig(config, info.fWidth, info.fHeight, rb, info.fAlphaType);
@@ -104,7 +104,7 @@
return SkNEW_ARGS(SkCanvas, (fBitmap));
}
-SkSurface* SkSurface_Raster::onNewSurface(const SkImage::Info& info) {
+SkSurface* SkSurface_Raster::onNewSurface(const SkImageInfo& info) {
return SkSurface::NewRaster(info);
}
@@ -139,7 +139,7 @@
///////////////////////////////////////////////////////////////////////////////
-SkSurface* SkSurface::NewRasterDirect(const SkImage::Info& info, void* pixels, size_t rowBytes) {
+SkSurface* SkSurface::NewRasterDirect(const SkImageInfo& info, void* pixels, size_t rowBytes) {
if (!SkSurface_Raster::Valid(info, rowBytes)) {
return NULL;
}
@@ -150,7 +150,7 @@
return SkNEW_ARGS(SkSurface_Raster, (info, pixels, rowBytes));
}
-SkSurface* SkSurface::NewRaster(const SkImage::Info& info) {
+SkSurface* SkSurface::NewRaster(const SkImageInfo& info) {
if (!SkSurface_Raster::Valid(info)) {
return NULL;
}