| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkSurface_Gpu.h" | 8 #include "SkSurface_Gpu.h" |
| 9 | 9 |
| 10 #include "SkCanvas.h" | 10 #include "SkCanvas.h" |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 SkSurface* SkSurface::NewRenderTargetDirect(GrRenderTarget* target, const SkSurf
aceProps* props) { | 113 SkSurface* SkSurface::NewRenderTargetDirect(GrRenderTarget* target, const SkSurf
aceProps* props) { |
| 114 SkAutoTUnref<SkGpuDevice> device( | 114 SkAutoTUnref<SkGpuDevice> device( |
| 115 SkGpuDevice::Create(target, props, SkGpuDevice::kUninit_InitContents)); | 115 SkGpuDevice::Create(target, props, SkGpuDevice::kUninit_InitContents)); |
| 116 if (!device) { | 116 if (!device) { |
| 117 return nullptr; | 117 return nullptr; |
| 118 } | 118 } |
| 119 return new SkSurface_Gpu(device); | 119 return new SkSurface_Gpu(device); |
| 120 } | 120 } |
| 121 | 121 |
| 122 SkSurface* SkSurface::NewRenderTarget(GrContext* ctx, Budgeted budgeted, const S
kImageInfo& info, | 122 SkSurface* SkSurface::NewRenderTarget(GrContext* ctx, Budgeted budgeted, const S
kImageInfo& info, |
| 123 int sampleCount, const SkSurfaceProps* pro
ps) { | 123 int sampleCount, const SkSurfaceProps* pro
ps, |
| 124 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(ctx, budgeted, info, sa
mpleCount, props, | 124 GrTextureStorageAllocator customAllocator)
{ |
| 125 SkGpuDevice::kClear_Ini
tContents)); | 125 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create( |
| 126 ctx, budgeted, info, sampleCount, props, SkGpuDevice::kClear_InitCon
tents, |
| 127 customAllocator)); |
| 126 if (!device) { | 128 if (!device) { |
| 127 return nullptr; | 129 return nullptr; |
| 128 } | 130 } |
| 129 return new SkSurface_Gpu(device); | 131 return new SkSurface_Gpu(device); |
| 130 } | 132 } |
| 131 | 133 |
| 132 SkSurface* SkSurface::NewFromBackendTexture(GrContext* context, const GrBackendT
extureDesc& desc, | 134 SkSurface* SkSurface::NewFromBackendTexture(GrContext* context, const GrBackendT
extureDesc& desc, |
| 133 const SkSurfaceProps* props) { | 135 const SkSurfaceProps* props) { |
| 134 if (nullptr == context) { | 136 if (nullptr == context) { |
| 135 return nullptr; | 137 return nullptr; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 162 } | 164 } |
| 163 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(rt, props, | 165 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(rt, props, |
| 164 SkGpuDevice::kUninit_In
itContents)); | 166 SkGpuDevice::kUninit_In
itContents)); |
| 165 if (!device) { | 167 if (!device) { |
| 166 return nullptr; | 168 return nullptr; |
| 167 } | 169 } |
| 168 return new SkSurface_Gpu(device); | 170 return new SkSurface_Gpu(device); |
| 169 } | 171 } |
| 170 | 172 |
| 171 #endif | 173 #endif |
| OLD | NEW |