Index: include/core/SkSurface.h |
diff --git a/include/core/SkSurface.h b/include/core/SkSurface.h |
index cb5133ae003e4d89de0f2f376b749977aee715f4..96f2d6c8edf84154f98bcdad24a9c6f7b89e98e3 100644 |
--- a/include/core/SkSurface.h |
+++ b/include/core/SkSurface.h |
@@ -10,6 +10,7 @@ |
#include "SkRefCnt.h" |
#include "SkImage.h" |
+#include "SkSurfaceProps.h" |
class SkCanvas; |
class SkPaint; |
@@ -28,6 +29,8 @@ class SK_API SkSurface : public SkRefCnt { |
public: |
SK_DECLARE_INST_COUNT(SkSurface) |
+ typedef SkSurfaceProps Props; |
+ |
/** |
* Create a new surface, using the specified pixels/rowbytes as its |
* backend. |
@@ -35,7 +38,8 @@ public: |
* If the requested surface cannot be created, or the request is not a |
* supported configuration, NULL will be returned. |
*/ |
- static SkSurface* NewRasterDirect(const SkImageInfo&, void* pixels, size_t rowBytes); |
+ static SkSurface* NewRasterDirect(const SkImageInfo&, void* pixels, size_t rowBytes, |
+ const Props* = NULL); |
/** |
* The same as NewRasterDirect, but also accepts a call-back routine, which is invoked |
@@ -43,7 +47,7 @@ public: |
*/ |
static SkSurface* NewRasterDirectReleaseProc(const SkImageInfo&, void* pixels, size_t rowBytes, |
void (*releaseProc)(void* pixels, void* context), |
- void* context); |
+ void* context, const Props* = NULL); |
/** |
* Return a new surface, with the memory for the pixels automatically |
@@ -52,15 +56,15 @@ public: |
* If the requested surface cannot be created, or the request is not a |
* supported configuration, NULL will be returned. |
*/ |
- static SkSurface* NewRaster(const SkImageInfo&); |
+ static SkSurface* NewRaster(const SkImageInfo&, const Props* = NULL); |
/** |
* Helper version of NewRaster. It creates a SkImageInfo with the |
* specified width and height, and populates the rest of info to match |
* pixels in SkPMColor format. |
*/ |
- static SkSurface* NewRasterPMColor(int width, int height) { |
- return NewRaster(SkImageInfo::MakeN32Premul(width, height)); |
+ static SkSurface* NewRasterPMColor(int width, int height, const Props* props = NULL) { |
+ return NewRaster(SkImageInfo::MakeN32Premul(width, height), props); |
} |
/** |
@@ -204,9 +208,11 @@ public: |
*/ |
const void* peekPixels(SkImageInfo* info, size_t* rowBytes); |
robertphillips
2014/09/16 14:15:17
Why not "const Props&" ?
reed1
2014/09/16 18:16:01
Done.
|
+ Props props() const { return fProps; } |
+ |
protected: |
- SkSurface(int width, int height); |
- SkSurface(const SkImageInfo&); |
+ SkSurface(int width, int height, const Props&); |
+ SkSurface(const SkImageInfo&, const Props&); |
// called by subclass if their contents have changed |
void dirtyGenerationID() { |
@@ -214,6 +220,7 @@ protected: |
} |
private: |
+ const Props fProps; |
const int fWidth; |
const int fHeight; |
uint32_t fGenerationID; |