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

Unified Diff: include/gpu/SkGpuDevice.h

Issue 201153023: Adding a new SkSurface factory for generating surfaces from the scratch texture pool. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: build/typo fix Created 6 years, 9 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
Index: include/gpu/SkGpuDevice.h
diff --git a/include/gpu/SkGpuDevice.h b/include/gpu/SkGpuDevice.h
index 4ea67fe6203dd08951cf6150ded45742cc91c832..c7764ec5ddc76a392441898188ba53f96b192347 100644
--- a/include/gpu/SkGpuDevice.h
+++ b/include/gpu/SkGpuDevice.h
@@ -29,12 +29,18 @@ class GrTextContext;
*/
class SK_API SkGpuDevice : public SkBitmapDevice {
public:
+ enum Flags {
+ kNeedClear_Flag = 1 << 0, //!< Surface requires an initial clear
+ kCached_Flag = 1 << 1, //!< Surface is cached and needs to be unlocked when released
+ };
/**
* Creates an SkGpuDevice from a GrSurface. This will fail if the surface is not a render
- * target. The caller owns a ref on the returned device.
+ * target. The caller owns a ref on the returned device. If the surface is cached,
+ * the kCached_Flag should be specified to make the device responsible for unlocking
+ * the surface when it is released.
*/
- static SkGpuDevice* Create(GrSurface* surface);
+ static SkGpuDevice* Create(GrSurface* surface, unsigned flags = 0);
/**
* New device that will create an offscreen renderTarget based on the
@@ -58,7 +64,7 @@ public:
* DEPRECATED -- need to make this private, call Create(surface)
* New device that will render to the specified renderTarget.
*/
- SkGpuDevice(GrContext*, GrRenderTarget*);
+ SkGpuDevice(GrContext*, GrRenderTarget*, unsigned flags = 0);
/**
* DEPRECATED -- need to make this private, call Create(surface)
@@ -66,7 +72,7 @@ public:
* The GrTexture's asRenderTarget() must be non-NULL or device will not
* function.
*/
- SkGpuDevice(GrContext*, GrTexture*);
+ SkGpuDevice(GrContext*, GrTexture*, unsigned flags = 0);
virtual ~SkGpuDevice();
@@ -171,10 +177,7 @@ private:
bool fNeedClear;
// called from rt and tex cons
- void initFromRenderTarget(GrContext*, GrRenderTarget*, bool cached);
-
- // used by createCompatibleDevice
- SkGpuDevice(GrContext*, GrTexture* texture, bool needClear);
+ void initFromRenderTarget(GrContext*, GrRenderTarget*, unsigned flags);
virtual SkBaseDevice* onCreateDevice(const SkImageInfo&, Usage) SK_OVERRIDE;
« no previous file with comments | « include/gpu/GrContext.h ('k') | src/gpu/GrContext.cpp » ('j') | src/gpu/SkGpuDevice.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698