OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2010 Google Inc. | 2 * Copyright 2010 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 GrContext_DEFINED | 8 #ifndef GrContext_DEFINED |
9 #define GrContext_DEFINED | 9 #define GrContext_DEFINED |
10 | 10 |
(...skipping 29 matching lines...) Expand all Loading... |
40 class GrVertexBuffer; | 40 class GrVertexBuffer; |
41 class GrStrokeInfo; | 41 class GrStrokeInfo; |
42 class GrSoftwarePathRenderer; | 42 class GrSoftwarePathRenderer; |
43 class SkGpuDevice; | 43 class SkGpuDevice; |
44 | 44 |
45 class SK_API GrContext : public SkRefCnt { | 45 class SK_API GrContext : public SkRefCnt { |
46 public: | 46 public: |
47 SK_DECLARE_INST_COUNT(GrContext) | 47 SK_DECLARE_INST_COUNT(GrContext) |
48 | 48 |
49 struct Options { | 49 struct Options { |
50 Options() : fDrawPathToCompressedTexture(false) { } | 50 Options() : fDrawPathToCompressedTexture(false), fSuppressPrints(false)
{ } |
51 | 51 |
52 // EXPERIMENTAL | 52 // EXPERIMENTAL |
53 // May be removed in the future, or may become standard depending | 53 // May be removed in the future, or may become standard depending |
54 // on the outcomes of a variety of internal tests. | 54 // on the outcomes of a variety of internal tests. |
55 bool fDrawPathToCompressedTexture; | 55 bool fDrawPathToCompressedTexture; |
| 56 bool fSuppressPrints; |
56 }; | 57 }; |
57 | 58 |
58 /** | 59 /** |
59 * Creates a GrContext for a backend context. | 60 * Creates a GrContext for a backend context. |
60 */ | 61 */ |
61 static GrContext* Create(GrBackend, GrBackendContext, const Options* opts =
NULL); | 62 static GrContext* Create(GrBackend, GrBackendContext, const Options* opts =
NULL); |
62 | 63 |
63 /** | 64 /** |
64 * Only defined in test apps. | 65 * Only defined in test apps. |
65 */ | 66 */ |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
522 GrGpu* getGpu() { return fGpu; } | 523 GrGpu* getGpu() { return fGpu; } |
523 const GrGpu* getGpu() const { return fGpu; } | 524 const GrGpu* getGpu() const { return fGpu; } |
524 GrBatchFontCache* getBatchFontCache() { return fBatchFontCache; } | 525 GrBatchFontCache* getBatchFontCache() { return fBatchFontCache; } |
525 GrLayerCache* getLayerCache() { return fLayerCache.get(); } | 526 GrLayerCache* getLayerCache() { return fLayerCache.get(); } |
526 GrTextBlobCache* getTextBlobCache() { return fTextBlobCache; } | 527 GrTextBlobCache* getTextBlobCache() { return fTextBlobCache; } |
527 GrDrawTarget* getTextTarget(); | 528 GrDrawTarget* getTextTarget(); |
528 GrAARectRenderer* getAARectRenderer() { return fAARectRenderer; } | 529 GrAARectRenderer* getAARectRenderer() { return fAARectRenderer; } |
529 GrResourceProvider* resourceProvider() { return fResourceProvider; } | 530 GrResourceProvider* resourceProvider() { return fResourceProvider; } |
530 const GrResourceProvider* resourceProvider() const { return fResourceProvide
r; } | 531 const GrResourceProvider* resourceProvider() const { return fResourceProvide
r; } |
531 GrResourceCache* getResourceCache() { return fResourceCache; } | 532 GrResourceCache* getResourceCache() { return fResourceCache; } |
| 533 bool suppressPrints() const { return fOptions.fSuppressPrints; } |
532 | 534 |
533 // Called by tests that draw directly to the context via GrDrawTarget | 535 // Called by tests that draw directly to the context via GrDrawTarget |
534 void getTestTarget(GrTestTarget*); | 536 void getTestTarget(GrTestTarget*); |
535 | 537 |
536 void addGpuTraceMarker(const GrGpuTraceMarker* marker); | 538 void addGpuTraceMarker(const GrGpuTraceMarker* marker); |
537 void removeGpuTraceMarker(const GrGpuTraceMarker* marker); | 539 void removeGpuTraceMarker(const GrGpuTraceMarker* marker); |
538 | 540 |
539 GrPathRenderer* getPathRenderer( | 541 GrPathRenderer* getPathRenderer( |
540 const GrDrawTarget* target, | 542 const GrDrawTarget* target, |
541 const GrPipelineBuilder*, | 543 const GrPipelineBuilder*, |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
658 */ | 660 */ |
659 static void TextBlobCacheOverBudgetCB(void* data); | 661 static void TextBlobCacheOverBudgetCB(void* data); |
660 | 662 |
661 // TODO see note on createTextContext | 663 // TODO see note on createTextContext |
662 friend class SkGpuDevice; | 664 friend class SkGpuDevice; |
663 | 665 |
664 typedef SkRefCnt INHERITED; | 666 typedef SkRefCnt INHERITED; |
665 }; | 667 }; |
666 | 668 |
667 #endif | 669 #endif |
OLD | NEW |