aboutsummaryrefslogtreecommitdiffstats
path: root/include/core/SkPixelRef.h
diff options
context:
space:
mode:
authorDerek Sollenberger <djsollen@google.com>2011-04-14 09:57:06 -0400
committerDerek Sollenberger <djsollen@google.com>2011-04-14 15:01:11 -0400
commit87b8e645865f9633f410c02252a0fd3feb18f09b (patch)
tree21e2521ed6f69bf466849f7c9579c37aa6b22b06 /include/core/SkPixelRef.h
parent7f10e10e25231b613ebb242fa14ad8c924ce694f (diff)
downloadexternal_skia-87b8e645865f9633f410c02252a0fd3feb18f09b.zip
external_skia-87b8e645865f9633f410c02252a0fd3feb18f09b.tar.gz
external_skia-87b8e645865f9633f410c02252a0fd3feb18f09b.tar.bz2
Skia Merge (revision 1116)
There is a companion change in external/webkit Change-Id: I1c4110e7520bbef3f4e5f9551adb7ec79ac1e3ed
Diffstat (limited to 'include/core/SkPixelRef.h')
-rw-r--r--include/core/SkPixelRef.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/core/SkPixelRef.h b/include/core/SkPixelRef.h
index 177ecec..8fb368a 100644
--- a/include/core/SkPixelRef.h
+++ b/include/core/SkPixelRef.h
@@ -20,7 +20,9 @@
#include "SkRefCnt.h"
#include "SkString.h"
+class SkBitmap;
class SkColorTable;
+struct SkIRect;
class SkMutex;
class SkFlattenableReadBuffer;
class SkFlattenableWriteBuffer;
@@ -112,6 +114,8 @@ public:
*/
virtual SkGpuTexture* getTexture() { return NULL; }
+ bool readPixels(SkBitmap* dst, const SkIRect* subset = NULL);
+
// serialization
typedef SkPixelRef* (*Factory)(SkFlattenableReadBuffer&);
@@ -157,6 +161,14 @@ protected:
*/
virtual void onUnlockPixels() = 0;
+ /**
+ * For pixelrefs that don't have access to their raw pixels, they may be
+ * able to make a copy of them (e.g. if the pixels are on the GPU).
+ *
+ * The base class implementation returns false;
+ */
+ virtual bool onReadPixels(SkBitmap* dst, const SkIRect* subsetOrNull);
+
/** Return the mutex associated with this pixelref. This value is assigned
in the constructor, and cannot change during the lifetime of the object.
*/