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 |
(...skipping 10 matching lines...) Expand all Loading... |
21 | 21 |
22 #include "SkClipStack.h" | 22 #include "SkClipStack.h" |
23 #include "SkMatrix.h" | 23 #include "SkMatrix.h" |
24 #include "SkPath.h" | 24 #include "SkPath.h" |
25 #include "SkStrokeRec.h" | 25 #include "SkStrokeRec.h" |
26 #include "SkTArray.h" | 26 #include "SkTArray.h" |
27 #include "SkTLazy.h" | 27 #include "SkTLazy.h" |
28 #include "SkTypes.h" | 28 #include "SkTypes.h" |
29 #include "SkXfermode.h" | 29 #include "SkXfermode.h" |
30 | 30 |
31 class GrBatch; | |
32 class GrClip; | 31 class GrClip; |
33 class GrDrawTargetCaps; | 32 class GrDrawTargetCaps; |
34 class GrIndexBufferAllocPool; | 33 class GrIndexBufferAllocPool; |
35 class GrPath; | 34 class GrPath; |
36 class GrPathRange; | 35 class GrPathRange; |
37 class GrPipeline; | 36 class GrPipeline; |
38 class GrVertexBufferAllocPool; | 37 class GrVertexBufferAllocPool; |
39 | 38 |
40 class GrDrawTarget : public SkRefCnt { | 39 class GrDrawTarget : public SkRefCnt { |
41 public: | 40 public: |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 * @param localMatrix Optional local matrix. The local coordinates are speci
fied by localRect, | 117 * @param localMatrix Optional local matrix. The local coordinates are speci
fied by localRect, |
119 * or if it is NULL by rect. This matrix applies to the c
oordinate implied by | 118 * or if it is NULL by rect. This matrix applies to the c
oordinate implied by |
120 * that rectangle before it is input to GrCoordTransforms
that read local | 119 * that rectangle before it is input to GrCoordTransforms
that read local |
121 * coordinates | 120 * coordinates |
122 */ | 121 */ |
123 void drawRect(GrPipelineBuilder* pipelineBuilder, | 122 void drawRect(GrPipelineBuilder* pipelineBuilder, |
124 GrColor color, | 123 GrColor color, |
125 const SkMatrix& viewMatrix, | 124 const SkMatrix& viewMatrix, |
126 const SkRect& rect, | 125 const SkRect& rect, |
127 const SkRect* localRect, | 126 const SkRect* localRect, |
128 const SkMatrix* localMatrix) { | 127 const SkMatrix* localMatrix); |
129 this->onDrawRect(pipelineBuilder, color, viewMatrix, rect, localRect, lo
calMatrix); | |
130 } | |
131 | 128 |
132 /** | 129 /** |
133 * Helper for drawRect when the caller doesn't need separate local rects or
matrices. | 130 * Helper for drawRect when the caller doesn't need separate local rects or
matrices. |
134 */ | 131 */ |
135 void drawSimpleRect(GrPipelineBuilder* ds, GrColor color, const SkMatrix& vi
ewM, | 132 void drawSimpleRect(GrPipelineBuilder* ds, GrColor color, const SkMatrix& vi
ewM, |
136 const SkRect& rect) { | 133 const SkRect& rect) { |
137 this->drawRect(ds, color, viewM, rect, NULL, NULL); | 134 this->drawRect(ds, color, viewM, rect, NULL, NULL); |
138 } | 135 } |
139 void drawSimpleRect(GrPipelineBuilder* ds, GrColor color, const SkMatrix& vi
ewM, | 136 void drawSimpleRect(GrPipelineBuilder* ds, GrColor color, const SkMatrix& vi
ewM, |
140 const SkIRect& irect) { | 137 const SkIRect& irect) { |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 }; | 278 }; |
282 | 279 |
283 void setupPipeline(const PipelineInfo& pipelineInfo, GrPipeline* pipeline); | 280 void setupPipeline(const PipelineInfo& pipelineInfo, GrPipeline* pipeline); |
284 | 281 |
285 private: | 282 private: |
286 virtual void onReset() = 0; | 283 virtual void onReset() = 0; |
287 | 284 |
288 virtual void onFlush() = 0; | 285 virtual void onFlush() = 0; |
289 | 286 |
290 virtual void onDrawBatch(GrBatch*, const PipelineInfo&) = 0; | 287 virtual void onDrawBatch(GrBatch*, const PipelineInfo&) = 0; |
291 // TODO copy in order drawbuffer onDrawRect to here | |
292 virtual void onDrawRect(GrPipelineBuilder*, | |
293 GrColor color, | |
294 const SkMatrix& viewMatrix, | |
295 const SkRect& rect, | |
296 const SkRect* localRect, | |
297 const SkMatrix* localMatrix) = 0; | |
298 | |
299 virtual void onStencilPath(const GrPipelineBuilder&, | 288 virtual void onStencilPath(const GrPipelineBuilder&, |
300 const GrPathProcessor*, | 289 const GrPathProcessor*, |
301 const GrPath*, | 290 const GrPath*, |
302 const GrScissorState&, | 291 const GrScissorState&, |
303 const GrStencilSettings&) = 0; | 292 const GrStencilSettings&) = 0; |
304 virtual void onDrawPath(const GrPathProcessor*, | 293 virtual void onDrawPath(const GrPathProcessor*, |
305 const GrPath*, | 294 const GrPath*, |
306 const GrStencilSettings&, | 295 const GrStencilSettings&, |
307 const PipelineInfo&) = 0; | 296 const PipelineInfo&) = 0; |
308 virtual void onDrawPaths(const GrPathProcessor*, | 297 virtual void onDrawPaths(const GrPathProcessor*, |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 virtual bool setupClip(GrPipelineBuilder*, | 385 virtual bool setupClip(GrPipelineBuilder*, |
397 GrPipelineBuilder::AutoRestoreFragmentProcessors*, | 386 GrPipelineBuilder::AutoRestoreFragmentProcessors*, |
398 GrPipelineBuilder::AutoRestoreStencil*, | 387 GrPipelineBuilder::AutoRestoreStencil*, |
399 GrScissorState* scissorState, | 388 GrScissorState* scissorState, |
400 const SkRect* devBounds) override; | 389 const SkRect* devBounds) override; |
401 | 390 |
402 typedef GrDrawTarget INHERITED; | 391 typedef GrDrawTarget INHERITED; |
403 }; | 392 }; |
404 | 393 |
405 #endif | 394 #endif |
OLD | NEW |