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 GrDrawTarget_DEFINED | 8 #ifndef GrDrawTarget_DEFINED |
9 #define GrDrawTarget_DEFINED | 9 #define GrDrawTarget_DEFINED |
10 | 10 |
| 11 #include "GrBatchFlushState.h" |
11 #include "GrClip.h" | 12 #include "GrClip.h" |
12 #include "GrClipMaskManager.h" | 13 #include "GrClipMaskManager.h" |
13 #include "GrContext.h" | 14 #include "GrContext.h" |
14 #include "GrPathProcessor.h" | 15 #include "GrPathProcessor.h" |
15 #include "GrPrimitiveProcessor.h" | 16 #include "GrPrimitiveProcessor.h" |
16 #include "GrIndexBuffer.h" | 17 #include "GrIndexBuffer.h" |
17 #include "GrPathRendering.h" | 18 #include "GrPathRendering.h" |
18 #include "GrPipelineBuilder.h" | 19 #include "GrPipelineBuilder.h" |
19 #include "GrPipeline.h" | 20 #include "GrPipeline.h" |
20 #include "GrVertexBuffer.h" | 21 #include "GrVertexBuffer.h" |
21 #include "GrXferProcessor.h" | 22 #include "GrXferProcessor.h" |
22 | 23 |
23 #include "SkClipStack.h" | 24 #include "SkClipStack.h" |
24 #include "SkMatrix.h" | 25 #include "SkMatrix.h" |
25 #include "SkPath.h" | 26 #include "SkPath.h" |
26 #include "SkStringUtils.h" | 27 #include "SkStringUtils.h" |
27 #include "SkStrokeRec.h" | 28 #include "SkStrokeRec.h" |
28 #include "SkTArray.h" | 29 #include "SkTArray.h" |
29 #include "SkTLazy.h" | 30 #include "SkTLazy.h" |
30 #include "SkTypes.h" | 31 #include "SkTypes.h" |
31 #include "SkXfermode.h" | 32 #include "SkXfermode.h" |
32 | 33 |
33 class GrBatch; | 34 class GrBatch; |
| 35 class GrBatchFlushState; |
34 class GrClip; | 36 class GrClip; |
35 class GrCaps; | 37 class GrCaps; |
36 class GrPath; | 38 class GrPath; |
37 class GrDrawBatch; | 39 class GrDrawBatch; |
38 class GrDrawPathBatchBase; | 40 class GrDrawPathBatchBase; |
39 class GrPathRangeDraw; | 41 class GrPathRangeDraw; |
40 | 42 |
41 class GrDrawTarget final : public SkRefCnt { | 43 class GrDrawTarget final : public SkRefCnt { |
42 public: | 44 public: |
43 // The context may not be fully constructed and should not be used during Gr
DrawTarget | 45 // The context may not be fully constructed and should not be used during Gr
DrawTarget |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 GrStencilSettings*); | 225 GrStencilSettings*); |
224 bool setupClip(const GrPipelineBuilder&, | 226 bool setupClip(const GrPipelineBuilder&, |
225 GrPipelineBuilder::AutoRestoreFragmentProcessorState*
, | 227 GrPipelineBuilder::AutoRestoreFragmentProcessorState*
, |
226 GrPipelineBuilder::AutoRestoreStencil*, | 228 GrPipelineBuilder::AutoRestoreStencil*, |
227 GrScissorState*, | 229 GrScissorState*, |
228 const SkRect* devBounds); | 230 const SkRect* devBounds); |
229 | 231 |
230 // Used only by CMM. | 232 // Used only by CMM. |
231 void clearStencilClip(const SkIRect&, bool insideClip, GrRenderTarget*); | 233 void clearStencilClip(const SkIRect&, bool insideClip, GrRenderTarget*); |
232 | 234 |
| 235 // Prepare N batches, starting from fLastPreparedBatch |
| 236 inline void prepareN(int N); |
| 237 |
233 SkSTArray<256, SkAutoTUnref<GrBatch>, true> fBatches; | 238 SkSTArray<256, SkAutoTUnref<GrBatch>, true> fBatches; |
234 SkAutoTDelete<GrClipMaskManager> fClipMaskManager; | 239 SkAutoTDelete<GrClipMaskManager> fClipMaskManager; |
235 // The context is only in service of the clip mask manager, remove once CMM
doesn't need this. | 240 // The context is only in service of the clip mask manager, remove once CMM
doesn't need this. |
236 GrContext* fContext; | 241 GrContext* fContext; |
237 GrGpu* fGpu; | 242 GrGpu* fGpu; |
238 GrResourceProvider* fResourceProvider; | 243 GrResourceProvider* fResourceProvider; |
| 244 GrBatchFlushState fFlushState; |
239 bool fFlushing; | 245 bool fFlushing; |
240 GrBatchToken fLastFlushToken; | 246 int fLastPreparedBatch; |
241 | 247 |
242 typedef SkRefCnt INHERITED; | 248 typedef SkRefCnt INHERITED; |
243 }; | 249 }; |
244 | 250 |
245 #endif | 251 #endif |
OLD | NEW |