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 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(ctx, budgeted, info, sa
mpleCount, props, | 125 GrTextureStorageAllocator customAllocator)
{ |
126 SkGpuDevice::kClear_Ini
tContents)); | 126 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create( |
| 127 ctx, budgeted, info, sampleCount, props, SkGpuDevice::kClear_InitCon
tents, |
| 128 customAllocator)); |
127 if (!device) { | 129 if (!device) { |
128 return nullptr; | 130 return nullptr; |
129 } | 131 } |
130 return new SkSurface_Gpu(device); | 132 return new SkSurface_Gpu(device); |
131 } | 133 } |
132 | 134 |
133 SkSurface* SkSurface::NewFromBackendTexture(GrContext* context, const GrBackendT
extureDesc& desc, | 135 SkSurface* SkSurface::NewFromBackendTexture(GrContext* context, const GrBackendT
extureDesc& desc, |
134 const SkSurfaceProps* props) { | 136 const SkSurfaceProps* props) { |
135 if (nullptr == context) { | 137 if (nullptr == context) { |
136 return nullptr; | 138 return nullptr; |
(...skipping 26 matching lines...) Expand all Loading... |
163 } | 165 } |
164 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(rt, props, | 166 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(rt, props, |
165 SkGpuDevice::kUninit_In
itContents)); | 167 SkGpuDevice::kUninit_In
itContents)); |
166 if (!device) { | 168 if (!device) { |
167 return nullptr; | 169 return nullptr; |
168 } | 170 } |
169 return new SkSurface_Gpu(device); | 171 return new SkSurface_Gpu(device); |
170 } | 172 } |
171 | 173 |
172 #endif | 174 #endif |
OLD | NEW |