OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 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 "GrTextureProxy.h" | 8 #include "GrTextureProxy.h" |
9 | 9 |
10 #include "GrTextureProvider.h" | 10 #include "GrTextureProvider.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 } | 58 } |
59 | 59 |
60 sk_sp<GrTextureProxy> GrTextureProxy::Make(GrTextureProvider* texProvider, | 60 sk_sp<GrTextureProxy> GrTextureProxy::Make(GrTextureProvider* texProvider, |
61 const GrSurfaceDesc& desc, | 61 const GrSurfaceDesc& desc, |
62 SkBackingFit fit, | 62 SkBackingFit fit, |
63 SkBudgeted budgeted, | 63 SkBudgeted budgeted, |
64 const void* srcData, | 64 const void* srcData, |
65 size_t rowBytes) { | 65 size_t rowBytes) { |
66 if (srcData) { | 66 if (srcData) { |
67 // If we have srcData, for now, we create a wrapped GrTextureProxy | 67 // If we have srcData, for now, we create a wrapped GrTextureProxy |
68 sk_sp<GrTexture> tex = sk_ref_sp(texProvider->createTexture(desc, budget
ed, | 68 sk_sp<GrTexture> tex(texProvider->createTexture(desc, budgeted, srcData,
rowBytes)); |
69 srcData, row
Bytes)); | |
70 return GrTextureProxy::Make(std::move(tex)); | 69 return GrTextureProxy::Make(std::move(tex)); |
71 } | 70 } |
72 | 71 |
73 return sk_sp<GrTextureProxy>(new GrTextureProxy(desc, fit, budgeted, nullptr
, 0)); | 72 return sk_sp<GrTextureProxy>(new GrTextureProxy(desc, fit, budgeted, nullptr
, 0)); |
74 } | 73 } |
75 | 74 |
76 sk_sp<GrTextureProxy> GrTextureProxy::Make(sk_sp<GrTexture> tex) { | 75 sk_sp<GrTextureProxy> GrTextureProxy::Make(sk_sp<GrTexture> tex) { |
77 return sk_sp<GrTextureProxy>(new GrTextureProxy(std::move(tex))); | 76 return sk_sp<GrTextureProxy>(new GrTextureProxy(std::move(tex))); |
78 } | 77 } |
OLD | NEW |