OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 "GrDrawContext.h" | 8 #include "GrDrawContext.h" |
9 #include "GrDrawingManager.h" | 9 #include "GrDrawingManager.h" |
10 #include "GrDrawTarget.h" | 10 #include "GrDrawTarget.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 if (!fSoftwarePathRenderer) { | 168 if (!fSoftwarePathRenderer) { |
169 fSoftwarePathRenderer = new GrSoftwarePathRenderer(fContext->texture
Provider()); | 169 fSoftwarePathRenderer = new GrSoftwarePathRenderer(fContext->texture
Provider()); |
170 } | 170 } |
171 pr = fSoftwarePathRenderer; | 171 pr = fSoftwarePathRenderer; |
172 } | 172 } |
173 | 173 |
174 return pr; | 174 return pr; |
175 } | 175 } |
176 | 176 |
177 sk_sp<GrDrawContext> GrDrawingManager::drawContext(sk_sp<GrRenderTarget> rt, | 177 sk_sp<GrDrawContext> GrDrawingManager::drawContext(sk_sp<GrRenderTarget> rt, |
| 178 sk_sp<SkColorSpace> colorSpac
e, |
178 const SkSurfaceProps* surface
Props) { | 179 const SkSurfaceProps* surface
Props) { |
179 if (this->wasAbandoned()) { | 180 if (this->wasAbandoned()) { |
180 return nullptr; | 181 return nullptr; |
181 } | 182 } |
182 | 183 |
183 | 184 |
184 bool useDIF = false; | 185 bool useDIF = false; |
185 if (surfaceProps) { | 186 if (surfaceProps) { |
186 useDIF = surfaceProps->isUseDeviceIndependentFonts(); | 187 useDIF = surfaceProps->isUseDeviceIndependentFonts(); |
187 } | 188 } |
188 | 189 |
189 if (useDIF && fContext->caps()->shaderCaps()->pathRenderingSupport() && | 190 if (useDIF && fContext->caps()->shaderCaps()->pathRenderingSupport() && |
190 rt->isStencilBufferMultisampled()) { | 191 rt->isStencilBufferMultisampled()) { |
191 GrStencilAttachment* sb = fContext->resourceProvider()->attachStencilAtt
achment(rt.get()); | 192 GrStencilAttachment* sb = fContext->resourceProvider()->attachStencilAtt
achment(rt.get()); |
192 if (sb) { | 193 if (sb) { |
193 return sk_sp<GrDrawContext>(new GrPathRenderingDrawContext( | 194 return sk_sp<GrDrawContext>(new GrPathRenderingDrawContext( |
194 fContext, this, std::mov
e(rt), | 195 fContext, this, std::mov
e(rt), |
195 surfaceProps, | 196 std::move(colorSpace), s
urfaceProps, |
196 fContext->getAuditTrail(
), fSingleOwner)); | 197 fContext->getAuditTrail(
), fSingleOwner)); |
197 } | 198 } |
198 } | 199 } |
199 | 200 |
200 return sk_sp<GrDrawContext>(new GrDrawContext(fContext, this, std::move(rt),
surfaceProps, | 201 return sk_sp<GrDrawContext>(new GrDrawContext(fContext, this, std::move(rt), |
| 202 std::move(colorSpace), surface
Props, |
201 fContext->getAuditTrail(), | 203 fContext->getAuditTrail(), |
202 fSingleOwner)); | 204 fSingleOwner)); |
203 } | 205 } |
OLD | NEW |