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), fSuppressPrints(false)
{ } | 50 Options() : fDrawPathToCompressedTexture(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; | |
57 }; | 56 }; |
58 | 57 |
59 /** | 58 /** |
60 * Creates a GrContext for a backend context. | 59 * Creates a GrContext for a backend context. |
61 */ | 60 */ |
62 static GrContext* Create(GrBackend, GrBackendContext, const Options* opts =
NULL); | 61 static GrContext* Create(GrBackend, GrBackendContext, const Options* opts =
NULL); |
63 | 62 |
64 /** | 63 /** |
65 * Only defined in test apps. | 64 * Only defined in test apps. |
66 */ | 65 */ |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 GrGpu* getGpu() { return fGpu; } | 522 GrGpu* getGpu() { return fGpu; } |
524 const GrGpu* getGpu() const { return fGpu; } | 523 const GrGpu* getGpu() const { return fGpu; } |
525 GrBatchFontCache* getBatchFontCache() { return fBatchFontCache; } | 524 GrBatchFontCache* getBatchFontCache() { return fBatchFontCache; } |
526 GrLayerCache* getLayerCache() { return fLayerCache.get(); } | 525 GrLayerCache* getLayerCache() { return fLayerCache.get(); } |
527 GrTextBlobCache* getTextBlobCache() { return fTextBlobCache; } | 526 GrTextBlobCache* getTextBlobCache() { return fTextBlobCache; } |
528 GrDrawTarget* getTextTarget(); | 527 GrDrawTarget* getTextTarget(); |
529 GrAARectRenderer* getAARectRenderer() { return fAARectRenderer; } | 528 GrAARectRenderer* getAARectRenderer() { return fAARectRenderer; } |
530 GrResourceProvider* resourceProvider() { return fResourceProvider; } | 529 GrResourceProvider* resourceProvider() { return fResourceProvider; } |
531 const GrResourceProvider* resourceProvider() const { return fResourceProvide
r; } | 530 const GrResourceProvider* resourceProvider() const { return fResourceProvide
r; } |
532 GrResourceCache* getResourceCache() { return fResourceCache; } | 531 GrResourceCache* getResourceCache() { return fResourceCache; } |
533 bool suppressPrints() const { return fOptions.fSuppressPrints; } | |
534 | 532 |
535 // Called by tests that draw directly to the context via GrDrawTarget | 533 // Called by tests that draw directly to the context via GrDrawTarget |
536 void getTestTarget(GrTestTarget*); | 534 void getTestTarget(GrTestTarget*); |
537 | 535 |
538 void addGpuTraceMarker(const GrGpuTraceMarker* marker); | 536 void addGpuTraceMarker(const GrGpuTraceMarker* marker); |
539 void removeGpuTraceMarker(const GrGpuTraceMarker* marker); | 537 void removeGpuTraceMarker(const GrGpuTraceMarker* marker); |
540 | 538 |
541 GrPathRenderer* getPathRenderer( | 539 GrPathRenderer* getPathRenderer( |
542 const GrDrawTarget* target, | 540 const GrDrawTarget* target, |
543 const GrPipelineBuilder*, | 541 const GrPipelineBuilder*, |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
660 */ | 658 */ |
661 static void TextBlobCacheOverBudgetCB(void* data); | 659 static void TextBlobCacheOverBudgetCB(void* data); |
662 | 660 |
663 // TODO see note on createTextContext | 661 // TODO see note on createTextContext |
664 friend class SkGpuDevice; | 662 friend class SkGpuDevice; |
665 | 663 |
666 typedef SkRefCnt INHERITED; | 664 typedef SkRefCnt INHERITED; |
667 }; | 665 }; |
668 | 666 |
669 #endif | 667 #endif |
OLD | NEW |