add abstract wrapper for platform-specific bitmap backends

git-svn-id: http://skia.googlecode.com/svn/trunk@596 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@android.com 2010-09-09 16:01:26 +00:00
parent 94d1464cca
commit ce4e53a234
3 changed files with 18 additions and 0 deletions

View File

@ -30,6 +30,9 @@ class SkRegion;
class SkFlattenableReadBuffer;
class SkFlattenableWriteBuffer;
// This is an opaque class, not interpreted by skia
class SkGpuTexture;
/** \class SkBitmap
The SkBitmap class specifies a raster bitmap. A bitmap has an integer width
@ -262,6 +265,10 @@ public:
fColorTable != NULL);
}
/** Returns the pixelRef's texture, or NULL
*/
SkGpuTexture* getTexture() const;
/** Return the bitmap's colortable (if any). Does not affect the colortable's
reference count.
*/

View File

@ -25,6 +25,9 @@ class SkMutex;
class SkFlattenableReadBuffer;
class SkFlattenableWriteBuffer;
// this is an opaque class, not interpreted by skia
class SkGpuTexture;
/** \class SkPixelRef
This class is the smart container for pixel memory, and is used with
@ -105,6 +108,10 @@ public:
*/
void setURI(const SkString& uri) { fURI = uri; }
/** Are we really wrapping a texture instead of a bitmap?
*/
virtual SkGpuTexture* getTexture() { return NULL; }
// serialization
typedef SkPixelRef* (*Factory)(SkFlattenableReadBuffer&);

View File

@ -371,6 +371,10 @@ void SkBitmap::notifyPixelsChanged() const {
}
}
SkGpuTexture* SkBitmap::getTexture() const {
return fPixelRef ? fPixelRef->getTexture() : NULL;
}
///////////////////////////////////////////////////////////////////////////////
SkMallocPixelRef::SkMallocPixelRef(void* storage, size_t size,