Index: src/image/SkSurface_Gpu.cpp |
diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp |
index 76456d0a5c4f2827e5c0813922162062f36243d3..024c151cea9fb73a146f5269d96c66e300827e3c 100644 |
--- a/src/image/SkSurface_Gpu.cpp |
+++ b/src/image/SkSurface_Gpu.cpp |
@@ -14,7 +14,7 @@ |
public: |
SK_DECLARE_INST_COUNT(SkSurface_Gpu) |
- SkSurface_Gpu(GrRenderTarget*, const SkSurfaceProps*, bool doClear); |
+ SkSurface_Gpu(GrRenderTarget*, bool cached, const SkSurfaceProps*, bool doClear); |
virtual ~SkSurface_Gpu(); |
virtual SkCanvas* onNewCanvas() SK_OVERRIDE; |
@@ -33,10 +33,12 @@ |
/////////////////////////////////////////////////////////////////////////////// |
-SkSurface_Gpu::SkSurface_Gpu(GrRenderTarget* renderTarget, const SkSurfaceProps* props, bool doClear) |
+SkSurface_Gpu::SkSurface_Gpu(GrRenderTarget* renderTarget, bool cached, const SkSurfaceProps* props, |
+ bool doClear) |
: INHERITED(renderTarget->width(), renderTarget->height(), props) |
{ |
int deviceFlags = 0; |
+ deviceFlags |= cached ? SkGpuDevice::kCached_Flag : 0; |
deviceFlags |= this->props().isUseDistanceFieldFonts() ? SkGpuDevice::kDFFonts_Flag : 0; |
fDevice = SkGpuDevice::Create(renderTarget, this->props(), deviceFlags); |
@@ -109,7 +111,7 @@ |
if (NULL == target) { |
return NULL; |
} |
- return SkNEW_ARGS(SkSurface_Gpu, (target, props, false)); |
+ return SkNEW_ARGS(SkSurface_Gpu, (target, false, props, false)); |
} |
SkSurface* SkSurface::NewRenderTarget(GrContext* ctx, const SkImageInfo& info, int sampleCount, |
@@ -130,7 +132,7 @@ |
return NULL; |
} |
- return SkNEW_ARGS(SkSurface_Gpu, (tex->asRenderTarget(), props, true)); |
+ return SkNEW_ARGS(SkSurface_Gpu, (tex->asRenderTarget(), false, props, true)); |
} |
SkSurface* SkSurface::NewScratchRenderTarget(GrContext* ctx, const SkImageInfo& info, |
@@ -152,5 +154,5 @@ |
return NULL; |
} |
- return SkNEW_ARGS(SkSurface_Gpu, (tex->asRenderTarget(), props, true)); |
+ return SkNEW_ARGS(SkSurface_Gpu, (tex->asRenderTarget(), true, props, true)); |
} |