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 #ifndef GrDrawContext_DEFINED | 8 #ifndef GrDrawContext_DEFINED |
9 #define GrDrawContext_DEFINED | 9 #define GrDrawContext_DEFINED |
10 | 10 |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 return paint.isAntiAlias() && fRenderTarget->isUnifiedMultisampled(); | 263 return paint.isAntiAlias() && fRenderTarget->isUnifiedMultisampled(); |
264 } | 264 } |
265 | 265 |
266 const GrSurfaceDesc& desc() const { return fRenderTarget->desc(); } | 266 const GrSurfaceDesc& desc() const { return fRenderTarget->desc(); } |
267 int width() const { return fRenderTarget->width(); } | 267 int width() const { return fRenderTarget->width(); } |
268 int height() const { return fRenderTarget->height(); } | 268 int height() const { return fRenderTarget->height(); } |
269 GrPixelConfig config() const { return fRenderTarget->config(); } | 269 GrPixelConfig config() const { return fRenderTarget->config(); } |
270 int numColorSamples() const { return fRenderTarget->numColorSamples(); } | 270 int numColorSamples() const { return fRenderTarget->numColorSamples(); } |
271 bool isGammaCorrect() const { return fSurfaceProps.isGammaCorrect(); } | 271 bool isGammaCorrect() const { return fSurfaceProps.isGammaCorrect(); } |
272 const SkSurfaceProps& surfaceProps() const { return fSurfaceProps; } | 272 const SkSurfaceProps& surfaceProps() const { return fSurfaceProps; } |
| 273 SkColorSpace* getColorSpace() const { return fColorSpace.get(); } |
273 | 274 |
274 bool wasAbandoned() const; | 275 bool wasAbandoned() const; |
275 | 276 |
276 GrRenderTarget* accessRenderTarget() { return fRenderTarget.get(); } | 277 GrRenderTarget* accessRenderTarget() { return fRenderTarget.get(); } |
277 | 278 |
278 sk_sp<GrRenderTarget> renderTarget() { return fRenderTarget; } | 279 sk_sp<GrRenderTarget> renderTarget() { return fRenderTarget; } |
279 | 280 |
280 sk_sp<GrTexture> asTexture() { return sk_ref_sp(fRenderTarget->asTexture());
} | 281 sk_sp<GrTexture> asTexture() { return sk_ref_sp(fRenderTarget->asTexture());
} |
281 | 282 |
282 // Provides access to functions that aren't part of the public API. | 283 // Provides access to functions that aren't part of the public API. |
283 GrDrawContextPriv drawContextPriv(); | 284 GrDrawContextPriv drawContextPriv(); |
284 const GrDrawContextPriv drawContextPriv() const; | 285 const GrDrawContextPriv drawContextPriv() const; |
285 | 286 |
286 GrAuditTrail* auditTrail() { return fAuditTrail; } | 287 GrAuditTrail* auditTrail() { return fAuditTrail; } |
287 | 288 |
288 protected: | 289 protected: |
289 GrDrawContext(GrContext*, GrDrawingManager*, sk_sp<GrRenderTarget>, | 290 GrDrawContext(GrContext*, GrDrawingManager*, sk_sp<GrRenderTarget>, sk_sp<Sk
ColorSpace>, |
290 const SkSurfaceProps* surfaceProps, GrAuditTrail*, GrSingleOwn
er*); | 291 const SkSurfaceProps* surfaceProps, GrAuditTrail*, GrSingleOwn
er*); |
291 | 292 |
292 GrDrawingManager* drawingManager() { return fDrawingManager; } | 293 GrDrawingManager* drawingManager() { return fDrawingManager; } |
293 | 294 |
294 SkDEBUGCODE(GrSingleOwner* singleOwner() { return fSingleOwner; }) | 295 SkDEBUGCODE(GrSingleOwner* singleOwner() { return fSingleOwner; }) |
295 SkDEBUGCODE(void validate() const;) | 296 SkDEBUGCODE(void validate() const;) |
296 | 297 |
297 private: | 298 private: |
298 friend class GrAtlasTextBlob; // for access to drawBatch | 299 friend class GrAtlasTextBlob; // for access to drawBatch |
299 friend class GrStencilAndCoverTextContext; // for access to drawBatch | 300 friend class GrStencilAndCoverTextContext; // for access to drawBatch |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 GrDrawingManager* fDrawingManager; | 353 GrDrawingManager* fDrawingManager; |
353 sk_sp<GrRenderTarget> fRenderTarget; | 354 sk_sp<GrRenderTarget> fRenderTarget; |
354 | 355 |
355 // In MDB-mode the drawTarget can be closed by some other drawContext that h
as picked | 356 // In MDB-mode the drawTarget can be closed by some other drawContext that h
as picked |
356 // it up. For this reason, the drawTarget should only ever be accessed via '
getDrawTarget'. | 357 // it up. For this reason, the drawTarget should only ever be accessed via '
getDrawTarget'. |
357 GrDrawTarget* fDrawTarget; | 358 GrDrawTarget* fDrawTarget; |
358 SkAutoTDelete<GrAtlasTextContext> fAtlasTextContext; | 359 SkAutoTDelete<GrAtlasTextContext> fAtlasTextContext; |
359 GrContext* fContext; | 360 GrContext* fContext; |
360 GrInstancedPipelineInfo fInstancedPipelineInfo; | 361 GrInstancedPipelineInfo fInstancedPipelineInfo; |
361 | 362 |
| 363 sk_sp<SkColorSpace> fColorSpace; |
362 SkSurfaceProps fSurfaceProps; | 364 SkSurfaceProps fSurfaceProps; |
363 GrAuditTrail* fAuditTrail; | 365 GrAuditTrail* fAuditTrail; |
364 | 366 |
365 // In debug builds we guard against improper thread handling | 367 // In debug builds we guard against improper thread handling |
366 SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;) | 368 SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;) |
367 }; | 369 }; |
368 | 370 |
369 #endif | 371 #endif |
OLD | NEW |