| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 SkSurface* SkSurface::NewRenderTargetDirect(GrRenderTarget* target, const SkSurf
aceProps* props) { | 114 SkSurface* SkSurface::NewRenderTargetDirect(GrRenderTarget* target, const SkSurf
aceProps* props) { |
| 115 SkAutoTUnref<SkGpuDevice> device( | 115 SkAutoTUnref<SkGpuDevice> device( |
| 116 SkGpuDevice::Create(target, props, SkGpuDevice::kUninit_InitContents)); | 116 SkGpuDevice::Create(target, props, SkGpuDevice::kUninit_InitContents)); |
| 117 if (!device) { | 117 if (!device) { |
| 118 return nullptr; | 118 return nullptr; |
| 119 } | 119 } |
| 120 return new SkSurface_Gpu(device); | 120 return new SkSurface_Gpu(device); |
| 121 } | 121 } |
| 122 | 122 |
| 123 SkSurface* SkSurface::NewRenderTarget(GrContext* ctx, Budgeted budgeted, const S
kImageInfo& info, | 123 SkSurface* SkSurface::NewRenderTarget(GrContext* ctx, Budgeted budgeted, const S
kImageInfo& info, |
| 124 int sampleCount, const SkSurfaceProps* pro
ps, | 124 int sampleCount, const SkSurfaceProps* pro
ps) { |
| 125 GrTextureStorageAllocator customAllocator)
{ | 125 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(ctx, budgeted, info, sa
mpleCount, props, |
| 126 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create( | 126 SkGpuDevice::kClear_Ini
tContents)); |
| 127 ctx, budgeted, info, sampleCount, props, SkGpuDevice::kClear_InitCon
tents, | |
| 128 customAllocator)); | |
| 129 if (!device) { | 127 if (!device) { |
| 130 return nullptr; | 128 return nullptr; |
| 131 } | 129 } |
| 132 return new SkSurface_Gpu(device); | 130 return new SkSurface_Gpu(device); |
| 133 } | 131 } |
| 134 | 132 |
| 135 SkSurface* SkSurface::NewFromBackendTexture(GrContext* context, const GrBackendT
extureDesc& desc, | 133 SkSurface* SkSurface::NewFromBackendTexture(GrContext* context, const GrBackendT
extureDesc& desc, |
| 136 const SkSurfaceProps* props) { | 134 const SkSurfaceProps* props) { |
| 137 if (nullptr == context) { | 135 if (nullptr == context) { |
| 138 return nullptr; | 136 return nullptr; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 165 } | 163 } |
| 166 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(rt, props, | 164 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(rt, props, |
| 167 SkGpuDevice::kUninit_In
itContents)); | 165 SkGpuDevice::kUninit_In
itContents)); |
| 168 if (!device) { | 166 if (!device) { |
| 169 return nullptr; | 167 return nullptr; |
| 170 } | 168 } |
| 171 return new SkSurface_Gpu(device); | 169 return new SkSurface_Gpu(device); |
| 172 } | 170 } |
| 173 | 171 |
| 174 #endif | 172 #endif |
| OLD | NEW |