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 GrDrawingManager_DEFINED | 8 #ifndef GrDrawingManager_DEFINED |
9 #define GrDrawingManager_DEFINED | 9 #define GrDrawingManager_DEFINED |
10 | 10 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 this->internalFlush(GrResourceCache::kImmediateMode); | 57 this->internalFlush(GrResourceCache::kImmediateMode); |
58 } | 58 } |
59 } | 59 } |
60 | 60 |
61 static bool ProgramUnitTest(GrContext* context, int maxStages); | 61 static bool ProgramUnitTest(GrContext* context, int maxStages); |
62 | 62 |
63 void prepareSurfaceForExternalIO(GrSurface*); | 63 void prepareSurfaceForExternalIO(GrSurface*); |
64 | 64 |
65 private: | 65 private: |
66 GrDrawingManager(GrContext* context, const GrDrawTarget::Options& optionsFor
DrawTargets, | 66 GrDrawingManager(GrContext* context, const GrDrawTarget::Options& optionsFor
DrawTargets, |
| 67 const GrPathRendererChain::Options& optionsForPathRendererC
hain, |
67 bool isImmediateMode, GrSingleOwner* singleOwner) | 68 bool isImmediateMode, GrSingleOwner* singleOwner) |
68 : fContext(context) | 69 : fContext(context) |
69 , fOptionsForDrawTargets(optionsForDrawTargets) | 70 , fOptionsForDrawTargets(optionsForDrawTargets) |
| 71 , fOptionsForPathRendererChain(optionsForPathRendererChain) |
70 , fSingleOwner(singleOwner) | 72 , fSingleOwner(singleOwner) |
71 , fAbandoned(false) | 73 , fAbandoned(false) |
72 , fAtlasTextContext(nullptr) | 74 , fAtlasTextContext(nullptr) |
73 , fPathRendererChain(nullptr) | 75 , fPathRendererChain(nullptr) |
74 , fSoftwarePathRenderer(nullptr) | 76 , fSoftwarePathRenderer(nullptr) |
75 , fFlushState(context->getGpu(), context->resourceProvider()) | 77 , fFlushState(context->getGpu(), context->resourceProvider()) |
76 , fFlushing(false) | 78 , fFlushing(false) |
77 , fIsImmediateMode(isImmediateMode) { | 79 , fIsImmediateMode(isImmediateMode) { |
78 } | 80 } |
79 | 81 |
80 void abandon(); | 82 void abandon(); |
81 void cleanup(); | 83 void cleanup(); |
82 void reset(); | 84 void reset(); |
83 void flush() { this->internalFlush(GrResourceCache::FlushType::kExternal); } | 85 void flush() { this->internalFlush(GrResourceCache::FlushType::kExternal); } |
84 void internalFlush(GrResourceCache::FlushType); | 86 void internalFlush(GrResourceCache::FlushType); |
85 | 87 |
86 friend class GrContext; // for access to: ctor, abandon, reset & flush | 88 friend class GrContext; // for access to: ctor, abandon, reset & flush |
87 | 89 |
88 static const int kNumPixelGeometries = 5; // The different pixel geometries | 90 static const int kNumPixelGeometries = 5; // The different pixel geometries |
89 static const int kNumDFTOptions = 2; // DFT or no DFT | 91 static const int kNumDFTOptions = 2; // DFT or no DFT |
90 | 92 |
91 GrContext* fContext; | 93 GrContext* fContext; |
92 GrDrawTarget::Options fOptionsForDrawTargets; | 94 GrDrawTarget::Options fOptionsForDrawTargets; |
| 95 GrPathRendererChain::Options fOptionsForPathRendererChain; |
93 | 96 |
94 // In debug builds we guard against improper thread handling | 97 // In debug builds we guard against improper thread handling |
95 GrSingleOwner* fSingleOwner; | 98 GrSingleOwner* fSingleOwner; |
96 | 99 |
97 bool fAbandoned; | 100 bool fAbandoned; |
98 SkTDArray<GrDrawTarget*> fDrawTargets; | 101 SkTDArray<GrDrawTarget*> fDrawTargets; |
99 | 102 |
100 SkAutoTDelete<GrAtlasTextContext> fAtlasTextContext; | 103 SkAutoTDelete<GrAtlasTextContext> fAtlasTextContext; |
101 | 104 |
102 GrPathRendererChain* fPathRendererChain; | 105 GrPathRendererChain* fPathRendererChain; |
103 GrSoftwarePathRenderer* fSoftwarePathRenderer; | 106 GrSoftwarePathRenderer* fSoftwarePathRenderer; |
104 | 107 |
105 GrBatchFlushState fFlushState; | 108 GrBatchFlushState fFlushState; |
106 bool fFlushing; | 109 bool fFlushing; |
107 | 110 |
108 bool fIsImmediateMode; | 111 bool fIsImmediateMode; |
109 }; | 112 }; |
110 | 113 |
111 #endif | 114 #endif |
OLD | NEW |