| Index: src/image/SkSurface_Gpu.cpp
 | 
| diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp
 | 
| index f94dc5bd7002dc88a18b65b811702f2f5a992b20..48da2d33a45c240ccb752a9eaa25d8cff64a8b20 100644
 | 
| --- a/src/image/SkSurface_Gpu.cpp
 | 
| +++ b/src/image/SkSurface_Gpu.cpp
 | 
| @@ -14,8 +14,8 @@ class SkSurface_Gpu : public SkSurface_Base {
 | 
|  public:
 | 
|      SK_DECLARE_INST_COUNT(SkSurface_Gpu)
 | 
|  
 | 
| -    SkSurface_Gpu(GrRenderTarget*, bool cached, TextRenderMode trm, 
 | 
| -                  SkSurface::RenderTargetFlags flags);
 | 
| +    SkSurface_Gpu(GrRenderTarget*, bool cached, SkSurface::RenderTargetFlags flags,
 | 
| +                  const SkSurfaceProps*);
 | 
|      virtual ~SkSurface_Gpu();
 | 
|  
 | 
|      virtual SkCanvas* onNewCanvas() SK_OVERRIDE;
 | 
| @@ -34,15 +34,16 @@ private:
 | 
|  
 | 
|  ///////////////////////////////////////////////////////////////////////////////
 | 
|  
 | 
| -SkSurface_Gpu::SkSurface_Gpu(GrRenderTarget* renderTarget, bool cached, TextRenderMode trm,
 | 
| -                             SkSurface::RenderTargetFlags flags)
 | 
| -        : INHERITED(renderTarget->width(), renderTarget->height()) {
 | 
| +SkSurface_Gpu::SkSurface_Gpu(GrRenderTarget* renderTarget, bool cached, RenderTargetFlags flags,
 | 
| +                             const SkSurfaceProps* props)
 | 
| +    : INHERITED(renderTarget->width(), renderTarget->height(), props)
 | 
| +{
 | 
|      int deviceFlags = 0;
 | 
|      deviceFlags |= cached ? SkGpuDevice::kCached_Flag : 0;
 | 
| -    deviceFlags |= (kDistanceField_TextRenderMode == trm) ? SkGpuDevice::kDFFonts_Flag : 0;
 | 
| -    fDevice = SkGpuDevice::Create(renderTarget, deviceFlags);
 | 
| +    deviceFlags |= this->props().useDistanceFieldFonts() ? SkGpuDevice::kDFFonts_Flag : 0;
 | 
| +    fDevice = SkGpuDevice::Create(renderTarget, this->props(), deviceFlags);
 | 
|  
 | 
| -    if (kRGB_565_GrPixelConfig != renderTarget->config() && 
 | 
| +    if (kRGB_565_GrPixelConfig != renderTarget->config() &&
 | 
|          !(flags & kDontClear_RenderTargetFlag)) {
 | 
|          fDevice->clear(0x0);
 | 
|      }
 | 
| @@ -53,13 +54,17 @@ SkSurface_Gpu::~SkSurface_Gpu() {
 | 
|  }
 | 
|  
 | 
|  SkCanvas* SkSurface_Gpu::onNewCanvas() {
 | 
| -    return SkNEW_ARGS(SkCanvas, (fDevice));
 | 
| +    SkCanvas::InitFlags flags = SkCanvas::kDefault_InitFlags;
 | 
| +    // When we think this works...
 | 
| +//    flags |= SkCanvas::kConservativeRasterClip_InitFlag;
 | 
| +
 | 
| +    return SkNEW_ARGS(SkCanvas, (fDevice, &this->props(), flags));
 | 
|  }
 | 
|  
 | 
|  SkSurface* SkSurface_Gpu::onNewSurface(const SkImageInfo& info) {
 | 
|      GrRenderTarget* rt = fDevice->accessRenderTarget();
 | 
|      int sampleCount = rt->numSamples();
 | 
| -    return SkSurface::NewRenderTarget(fDevice->context(), info, sampleCount);
 | 
| +    return SkSurface::NewRenderTarget(fDevice->context(), info, sampleCount, &this->props());
 | 
|  }
 | 
|  
 | 
|  SkImage* SkSurface_Gpu::onNewImageSnapshot() {
 | 
| @@ -102,18 +107,16 @@ void SkSurface_Gpu::onDiscard() {
 | 
|      fDevice->accessRenderTarget()->discard();
 | 
|  }
 | 
|  
 | 
| -///////////////////////////////////////////////////////////////////////////////
 | 
| -
 | 
| -SkSurface* SkSurface::NewRenderTargetDirect(GrRenderTarget* target, TextRenderMode trm,
 | 
| +SkSurface* SkSurface::NewRenderTargetDirect(GrRenderTarget* target, const SkSurfaceProps* props,
 | 
|                                              RenderTargetFlags flags) {
 | 
|      if (NULL == target) {
 | 
|          return NULL;
 | 
|      }
 | 
| -    return SkNEW_ARGS(SkSurface_Gpu, (target, false, trm, flags));
 | 
| +    return SkNEW_ARGS(SkSurface_Gpu, (target, false, flags, props));
 | 
|  }
 | 
|  
 | 
|  SkSurface* SkSurface::NewRenderTarget(GrContext* ctx, const SkImageInfo& info, int sampleCount,
 | 
| -                                      TextRenderMode trm, RenderTargetFlags flags) {
 | 
| +                                      const SkSurfaceProps* props, RenderTargetFlags flags) {
 | 
|      if (NULL == ctx) {
 | 
|          return NULL;
 | 
|      }
 | 
| @@ -130,11 +133,11 @@ SkSurface* SkSurface::NewRenderTarget(GrContext* ctx, const SkImageInfo& info, i
 | 
|          return NULL;
 | 
|      }
 | 
|  
 | 
| -    return SkNEW_ARGS(SkSurface_Gpu, (tex->asRenderTarget(), false, trm, flags));
 | 
| +    return SkNEW_ARGS(SkSurface_Gpu, (tex->asRenderTarget(), false, flags, props));
 | 
|  }
 | 
|  
 | 
|  SkSurface* SkSurface::NewScratchRenderTarget(GrContext* ctx, const SkImageInfo& info,
 | 
| -                                             int sampleCount, TextRenderMode trm,
 | 
| +                                             int sampleCount, const SkSurfaceProps* props,
 | 
|                                               RenderTargetFlags flags) {
 | 
|      if (NULL == ctx) {
 | 
|          return NULL;
 | 
| @@ -153,5 +156,33 @@ SkSurface* SkSurface::NewScratchRenderTarget(GrContext* ctx, const SkImageInfo&
 | 
|          return NULL;
 | 
|      }
 | 
|  
 | 
| -    return SkNEW_ARGS(SkSurface_Gpu, (tex->asRenderTarget(), true, trm, flags));
 | 
| +    return SkNEW_ARGS(SkSurface_Gpu, (tex->asRenderTarget(), true, flags, props));
 | 
| +}
 | 
| +
 | 
| +///////////////////////////////////////////////////////////////////////////////
 | 
| +#ifdef SK_SUPPORT_LEGACY_TEXTRENDERMODE
 | 
| +
 | 
| +static SkSurfaceProps make_props(SkSurface::TextRenderMode trm) {
 | 
| +    uint32_t propsFlags = 0;
 | 
| +    if (SkSurface::kDistanceField_TextRenderMode == trm) {
 | 
| +        propsFlags |= SkSurfaceProps::kUseDistanceFieldFonts_Flag;
 | 
| +    }
 | 
| +    return SkSurfaceProps(propsFlags, SkSurfaceProps::kLegacyFontHost_InitType);
 | 
| +}
 | 
| +
 | 
| +SkSurface* SkSurface::NewRenderTargetDirect(GrRenderTarget* target, TextRenderMode trm,
 | 
| +                                            RenderTargetFlags flags) {
 | 
| +    return NewRenderTargetDirect(target, make_props(trm), flags);
 | 
| +}
 | 
| +
 | 
| +SkSurface* SkSurface::NewRenderTarget(GrContext* gr, const SkImageInfo& info, int sampleCount,
 | 
| +                                      TextRenderMode trm, RenderTargetFlags flags) {
 | 
| +    return NewRenderTarget(gr, info, sampleCount, make_props(trm), flags);
 | 
|  }
 | 
| +
 | 
| +SkSurface* SkSurface::NewScratchRenderTarget(GrContext* gr, const SkImageInfo& info, int sampleCount,
 | 
| +                                             TextRenderMode trm, RenderTargetFlags flags) {
 | 
| +    return NewScratchRenderTarget(gr, info, sampleCount, make_props(trm), flags);
 | 
| +}
 | 
| +
 | 
| +#endif
 | 
| 
 |