Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Unified Diff: include/core/SkImage.h

Issue 1738513002: start on pre-upload data (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: stuff Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/gpu/GrContext.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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; }
« no previous file with comments | « no previous file | include/gpu/GrContext.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698