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 "GrResourceProvider.h" | 10 #include "GrResourceProvider.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 SkAutoTUnref<SkGpuDevice> device( | 139 SkAutoTUnref<SkGpuDevice> device( |
140 SkGpuDevice::Create(target, props, SkGpuDevice::kUninit_InitContents)); | 140 SkGpuDevice::Create(target, props, SkGpuDevice::kUninit_InitContents)); |
141 if (!device) { | 141 if (!device) { |
142 return nullptr; | 142 return nullptr; |
143 } | 143 } |
144 return sk_make_sp<SkSurface_Gpu>(device); | 144 return sk_make_sp<SkSurface_Gpu>(device); |
145 } | 145 } |
146 | 146 |
147 sk_sp<SkSurface> SkSurface::MakeRenderTarget(GrContext* ctx, SkBudgeted budgeted
, | 147 sk_sp<SkSurface> SkSurface::MakeRenderTarget(GrContext* ctx, SkBudgeted budgeted
, |
148 const SkImageInfo& info, int sample
Count, | 148 const SkImageInfo& info, int sample
Count, |
149 const SkSurfaceProps* props, | 149 const SkSurfaceProps* props) { |
150 GrTextureStorageAllocator customAll
ocator) { | |
151 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create( | 150 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create( |
152 ctx, budgeted, info, sampleCount, props, SkGpuDevice::kClear_InitCon
tents, | 151 ctx, budgeted, info, sampleCount, props, SkGpuDevice::kClear_InitCon
tents)); |
153 customAllocator)); | |
154 if (!device) { | 152 if (!device) { |
155 return nullptr; | 153 return nullptr; |
156 } | 154 } |
157 return sk_make_sp<SkSurface_Gpu>(device); | 155 return sk_make_sp<SkSurface_Gpu>(device); |
158 } | 156 } |
159 | 157 |
160 sk_sp<SkSurface> SkSurface::MakeFromBackendTexture(GrContext* context, | 158 sk_sp<SkSurface> SkSurface::MakeFromBackendTexture(GrContext* context, |
161 const GrBackendTextureDesc& d
esc, | 159 const GrBackendTextureDesc& d
esc, |
162 const SkSurfaceProps* props)
{ | 160 const SkSurfaceProps* props)
{ |
163 if (nullptr == context) { | 161 if (nullptr == context) { |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 } | 208 } |
211 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(rt, props, | 209 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(rt, props, |
212 SkGpuDevice::kUninit_In
itContents)); | 210 SkGpuDevice::kUninit_In
itContents)); |
213 if (!device) { | 211 if (!device) { |
214 return nullptr; | 212 return nullptr; |
215 } | 213 } |
216 return sk_make_sp<SkSurface_Gpu>(device); | 214 return sk_make_sp<SkSurface_Gpu>(device); |
217 } | 215 } |
218 | 216 |
219 #endif | 217 #endif |
OLD | NEW |