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 15 matching lines...) Expand all Loading... | |
26 class GrDrawingManager; | 26 class GrDrawingManager; |
27 class GrDrawTarget; | 27 class GrDrawTarget; |
28 class GrFixedClip; | 28 class GrFixedClip; |
29 class GrPaint; | 29 class GrPaint; |
30 class GrPathProcessor; | 30 class GrPathProcessor; |
31 class GrPipelineBuilder; | 31 class GrPipelineBuilder; |
32 class GrRenderTarget; | 32 class GrRenderTarget; |
33 class GrStyle; | 33 class GrStyle; |
34 class GrSurface; | 34 class GrSurface; |
35 struct GrUserStencilSettings; | 35 struct GrUserStencilSettings; |
36 class SkColorSpaceXform; | |
msarett
2016/09/14 20:20:35
Brian, we can back out the gpu parts of this chang
| |
36 class SkDrawFilter; | 37 class SkDrawFilter; |
37 struct SkIPoint; | 38 struct SkIPoint; |
38 struct SkIRect; | 39 struct SkIRect; |
39 class SkLatticeIter; | 40 class SkLatticeIter; |
40 class SkMatrix; | 41 class SkMatrix; |
41 class SkPaint; | 42 class SkPaint; |
42 class SkPath; | 43 class SkPath; |
43 struct SkPoint; | 44 struct SkPoint; |
44 struct SkRect; | 45 struct SkRect; |
45 class SkRRect; | 46 class SkRRect; |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
328 int height() const { return fRenderTarget->height(); } | 329 int height() const { return fRenderTarget->height(); } |
329 GrPixelConfig config() const { return fRenderTarget->config(); } | 330 GrPixelConfig config() const { return fRenderTarget->config(); } |
330 int numColorSamples() const { return fRenderTarget->numColorSamples(); } | 331 int numColorSamples() const { return fRenderTarget->numColorSamples(); } |
331 bool isGammaCorrect() const { return SkToBool(fColorSpace.get()); } | 332 bool isGammaCorrect() const { return SkToBool(fColorSpace.get()); } |
332 SkSourceGammaTreatment sourceGammaTreatment() const { | 333 SkSourceGammaTreatment sourceGammaTreatment() const { |
333 return this->isGammaCorrect() ? SkSourceGammaTreatment::kRespect | 334 return this->isGammaCorrect() ? SkSourceGammaTreatment::kRespect |
334 : SkSourceGammaTreatment::kIgnore; | 335 : SkSourceGammaTreatment::kIgnore; |
335 } | 336 } |
336 const SkSurfaceProps& surfaceProps() const { return fSurfaceProps; } | 337 const SkSurfaceProps& surfaceProps() const { return fSurfaceProps; } |
337 SkColorSpace* getColorSpace() const { return fColorSpace.get(); } | 338 SkColorSpace* getColorSpace() const { return fColorSpace.get(); } |
338 GrColorSpaceXform* getColorXformFromSRGB() const { return fColorXformFromSRG B.get(); } | 339 SkColorSpaceXform* getColorXformFromSRGB() const { return fColorXformFromSRG B.get(); } |
339 GrSurfaceOrigin origin() const { return fRenderTarget->origin(); } | 340 GrSurfaceOrigin origin() const { return fRenderTarget->origin(); } |
340 | 341 |
341 bool wasAbandoned() const; | 342 bool wasAbandoned() const; |
342 | 343 |
343 GrRenderTarget* accessRenderTarget() { return fRenderTarget.get(); } | 344 GrRenderTarget* accessRenderTarget() { return fRenderTarget.get(); } |
344 | 345 |
345 sk_sp<GrTexture> asTexture() { return sk_ref_sp(fRenderTarget->asTexture()); } | 346 sk_sp<GrTexture> asTexture() { return sk_ref_sp(fRenderTarget->asTexture()); } |
346 | 347 |
347 // Provides access to functions that aren't part of the public API. | 348 // Provides access to functions that aren't part of the public API. |
348 GrDrawContextPriv drawContextPriv(); | 349 GrDrawContextPriv drawContextPriv(); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
409 const SkMatrix& viewMatrix, | 410 const SkMatrix& viewMatrix, |
410 const SkPath& path, | 411 const SkPath& path, |
411 const GrStyle& style); | 412 const GrStyle& style); |
412 | 413 |
413 // This entry point allows the GrTextContext-derived classes to add their ba tches to | 414 // This entry point allows the GrTextContext-derived classes to add their ba tches to |
414 // the drawTarget. | 415 // the drawTarget. |
415 void drawBatch(const GrPipelineBuilder& pipelineBuilder, const GrClip&, GrDr awBatch* batch); | 416 void drawBatch(const GrPipelineBuilder& pipelineBuilder, const GrClip&, GrDr awBatch* batch); |
416 | 417 |
417 GrDrawTarget* getDrawTarget(); | 418 GrDrawTarget* getDrawTarget(); |
418 | 419 |
419 GrDrawingManager* fDrawingManager; | 420 GrDrawingManager* fDrawingManager; |
420 sk_sp<GrRenderTarget> fRenderTarget; | 421 sk_sp<GrRenderTarget> fRenderTarget; |
421 | 422 |
422 // In MDB-mode the drawTarget can be closed by some other drawContext that h as picked | 423 // In MDB-mode the drawTarget can be closed by some other drawContext that h as picked |
423 // it up. For this reason, the drawTarget should only ever be accessed via ' getDrawTarget'. | 424 // it up. For this reason, the drawTarget should only ever be accessed via ' getDrawTarget'. |
424 GrDrawTarget* fDrawTarget; | 425 GrDrawTarget* fDrawTarget; |
425 GrContext* fContext; | 426 GrContext* fContext; |
426 GrInstancedPipelineInfo fInstancedPipelineInfo; | 427 GrInstancedPipelineInfo fInstancedPipelineInfo; |
427 | 428 |
428 sk_sp<SkColorSpace> fColorSpace; | 429 sk_sp<SkColorSpace> fColorSpace; |
429 sk_sp<GrColorSpaceXform> fColorXformFromSRGB; | 430 std::unique_ptr<SkColorSpaceXform> fColorXformFromSRGB; |
430 SkSurfaceProps fSurfaceProps; | 431 SkSurfaceProps fSurfaceProps; |
431 GrAuditTrail* fAuditTrail; | 432 GrAuditTrail* fAuditTrail; |
432 | 433 |
433 // In debug builds we guard against improper thread handling | 434 // In debug builds we guard against improper thread handling |
434 SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;) | 435 SkDEBUGCODE(mutable GrSingleOwner* fSingleOwner;) |
435 }; | 436 }; |
436 | 437 |
437 #endif | 438 #endif |
OLD | NEW |