aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-03-30 18:22:01 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-03-30 18:22:01 +0000
commit423d6d9070c99dacb46a8b5d120b348550316b01 (patch)
tree25acee678e17345d1b022f2220abc03558c99453 /include
parent6de0bfc51a4f729a5a4a0fd870e2077f9416635e (diff)
Improve save layer handling in SkGpuDevice
Diffstat (limited to 'include')
-rw-r--r--include/gpu/SkGpuDevice.h22
1 files changed, 8 insertions, 14 deletions
diff --git a/include/gpu/SkGpuDevice.h b/include/gpu/SkGpuDevice.h
index 409e3b30a5..ffc24a8c4b 100644
--- a/include/gpu/SkGpuDevice.h
+++ b/include/gpu/SkGpuDevice.h
@@ -29,14 +29,11 @@ class SK_API SkGpuDevice : public SkDevice {
public:
/**
* New device that will create an offscreen renderTarget based on the
- * config, width, height.
- *
- * usage is a special flag that should only be set by SkCanvas
- * internally.
+ * config, width, height. The device's storage will not count against
+ * the GrContext's texture cache budget. The device's pixels will be
+ * uninitialized.
*/
- SkGpuDevice(GrContext*, SkBitmap::Config,
- int width, int height,
- SkDevice::Usage usage = SkDevice::kGeneral_Usage);
+ SkGpuDevice(GrContext*, SkBitmap::Config, int width, int height);
/**
* New device that will render to the specified renderTarget.
@@ -118,14 +115,8 @@ public:
protected:
typedef GrContext::TextureCacheEntry TexCache;
- enum TexType {
- kBitmap_TexType,
- kDeviceRenderTarget_TexType,
- kSaveLayerDeviceRenderTarget_TexType
- };
TexCache lockCachedTexture(const SkBitmap& bitmap,
- const GrSamplerState* sampler,
- TexType type = kBitmap_TexType);
+ const GrSamplerState* sampler);
bool isBitmapInTextureCache(const SkBitmap& bitmap,
const GrSamplerState& sampler) const;
void unlockCachedTexture(TexCache);
@@ -152,6 +143,9 @@ private:
// called from rt and tex cons
void initFromRenderTarget(GrContext*, GrRenderTarget*);
+ // used by createCompatibleDevice
+ SkGpuDevice(GrContext*, GrTexture* texture, TexCache, bool needClear);
+
// override from SkDevice
virtual SkDevice* onCreateCompatibleDevice(SkBitmap::Config config,
int width, int height,