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