Chromium Code Reviews| Index: src/image/SkSurface_Gpu.cpp |
| diff --git a/src/image/SkSurface_Gpu.cpp b/src/image/SkSurface_Gpu.cpp |
| index 2d5645b2b016d734b2c170881b8e7b276182d6ba..466b098939e197ad181528ba563d5486bce497b8 100644 |
| --- a/src/image/SkSurface_Gpu.cpp |
| +++ b/src/image/SkSurface_Gpu.cpp |
| @@ -121,9 +121,15 @@ SkSurface* SkSurface::NewRenderTargetDirect(GrRenderTarget* target, const SkSurf |
| } |
| SkSurface* SkSurface::NewRenderTarget(GrContext* ctx, Budgeted budgeted, const SkImageInfo& info, |
| - int sampleCount, const SkSurfaceProps* props) { |
| - SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(ctx, budgeted, info, sampleCount, props, |
| - SkGpuDevice::kClear_InitContents)); |
| + int sampleCount, const SkSurfaceProps* props, |
| + GrTextureStorageAllocator customAllocator) { |
| + // If the render target is being made with a custom allocator, it must be unbudgeted. |
| + if (customAllocator.fAllocateTextureStorage && (budgeted == kYes_Budgeted)) |
|
bsalomon
2016/02/04 16:27:08
This doesn't necessarily have to be true... kYes_B
erikchen
2016/02/04 18:44:07
Right - I've removed this logic.
|
| + return nullptr; |
| + |
| + SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create( |
| + ctx, budgeted, info, sampleCount, props, SkGpuDevice::kClear_InitContents, |
| + customAllocator)); |
| if (!device) { |
| return nullptr; |
| } |