Index: include/core/SkImage.h |
diff --git a/include/core/SkImage.h b/include/core/SkImage.h |
index 0adb608bde042c1119a3edfef26d579973e72983..cbfe63e0bb69c2ff5154bf8e12f14c1fe511bda1 100644 |
--- a/include/core/SkImage.h |
+++ b/include/core/SkImage.h |
@@ -8,6 +8,7 @@ |
#ifndef SkImage_DEFINED |
#define SkImage_DEFINED |
+#include <functional> |
#include "SkFilterQuality.h" |
#include "SkImageInfo.h" |
#include "SkImageEncoder.h" |
@@ -24,9 +25,25 @@ class SkPicture; |
class SkPixelSerializer; |
class SkString; |
class SkSurface; |
+class GrCaps; |
class GrContext; |
class GrTexture; |
+class SkImage; |
+class SkImageTextureData { |
+public: |
+ SkImage* newImage(GrContext* context, SkBudgeted) const; |
+ |
+private: |
+ uint32_t fContextUniqueID; |
+ uint32_t fImageUniqueID; |
+ std::function<void(SkPixmap*)> fPixmapGenerator; |
+ |
+ friend class SkImage; |
+}; |
+ |
+class GrContextThreadSafeProxy; |
+ |
/** |
* 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 |
@@ -46,6 +63,11 @@ public: |
typedef SkImageInfo Info; |
typedef void* ReleaseContext; |
+ SkImageTextureData* newImageTextureData( |
+ const GrContextThreadSafeProxy&, |
+ const std::function<void*(size_t, const SkImage*)>& allocate = |
+ std::function<void*(size_t, const SkImage*)>()) const; |
+ |
static SkImage* NewRasterCopy(const Info&, const void* pixels, size_t rowBytes, |
SkColorTable* ctable = NULL); |
static SkImage* NewRasterData(const Info&, SkData* pixels, size_t rowBytes); |
@@ -145,6 +167,8 @@ public: |
static SkImage* NewFromPicture(const SkPicture*, const SkISize& dimensions, |
const SkMatrix*, const SkPaint*); |
+ static SkImage* NewTextureFromPixmap(GrContext*, const SkPixmap&, SkBudgeted budgeted); |
+ |
/////////////////////////////////////////////////////////////////////////////////////////////// |
int width() const { return fWidth; } |