OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
| 9 |
| 10 |
9 #include "GrDrawTarget.h" | 11 #include "GrDrawTarget.h" |
10 | |
11 #include "GrBatch.h" | |
12 #include "GrContext.h" | 12 #include "GrContext.h" |
13 #include "GrDrawTargetCaps.h" | 13 #include "GrDrawTargetCaps.h" |
14 #include "GrPath.h" | 14 #include "GrPath.h" |
15 #include "GrRenderTarget.h" | 15 #include "GrRenderTarget.h" |
16 #include "GrSurfacePriv.h" | 16 #include "GrSurfacePriv.h" |
17 #include "GrTemplates.h" | 17 #include "GrTemplates.h" |
18 #include "GrTexture.h" | 18 #include "GrTexture.h" |
19 #include "GrVertexBuffer.h" | 19 #include "GrVertexBuffer.h" |
20 | 20 |
21 #include "SkStrokeRec.h" | 21 #include "SkStrokeRec.h" |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 if (!this->setupDstReadIfNecessary(pipelineBuilder, &dstCopy, devBounds)
) { | 519 if (!this->setupDstReadIfNecessary(pipelineBuilder, &dstCopy, devBounds)
) { |
520 return; | 520 return; |
521 } | 521 } |
522 | 522 |
523 this->setDrawBuffers(&info, gp->getVertexStride()); | 523 this->setDrawBuffers(&info, gp->getVertexStride()); |
524 | 524 |
525 this->onDraw(*pipelineBuilder, gp, info, scissorState, dstCopy.texture()
? &dstCopy : NULL); | 525 this->onDraw(*pipelineBuilder, gp, info, scissorState, dstCopy.texture()
? &dstCopy : NULL); |
526 } | 526 } |
527 } | 527 } |
528 | 528 |
529 | |
530 void GrDrawTarget::drawBatch(GrPipelineBuilder* pipelineBuilder, | |
531 GrBatch* batch, | |
532 const SkRect* devBounds) { | |
533 SkASSERT(pipelineBuilder); | |
534 // TODO some kind of checkdraw, but not at this level | |
535 | |
536 // Setup clip | |
537 GrScissorState scissorState; | |
538 GrPipelineBuilder::AutoRestoreEffects are; | |
539 GrPipelineBuilder::AutoRestoreStencil ars; | |
540 if (!this->setupClip(pipelineBuilder, &are, &ars, &scissorState, devBounds))
{ | |
541 return; | |
542 } | |
543 | |
544 GrDeviceCoordTexture dstCopy; | |
545 if (!this->setupDstReadIfNecessary(pipelineBuilder, &dstCopy, devBounds)) { | |
546 return; | |
547 } | |
548 | |
549 this->onDrawBatch(batch, *pipelineBuilder, scissorState, dstCopy.texture() ?
&dstCopy : NULL); | |
550 } | |
551 | |
552 static const GrStencilSettings& winding_path_stencil_settings() { | 529 static const GrStencilSettings& winding_path_stencil_settings() { |
553 GR_STATIC_CONST_SAME_STENCIL_STRUCT(gSettings, | 530 GR_STATIC_CONST_SAME_STENCIL_STRUCT(gSettings, |
554 kIncClamp_StencilOp, | 531 kIncClamp_StencilOp, |
555 kIncClamp_StencilOp, | 532 kIncClamp_StencilOp, |
556 kAlwaysIfInClip_StencilFunc, | 533 kAlwaysIfInClip_StencilFunc, |
557 0xFFFF, 0xFFFF, 0xFFFF); | 534 0xFFFF, 0xFFFF, 0xFFFF); |
558 return *GR_CONST_STENCIL_SETTINGS_PTR_FROM_STRUCT_PTR(&gSettings); | 535 return *GR_CONST_STENCIL_SETTINGS_PTR_FROM_STRUCT_PTR(&gSettings); |
559 } | 536 } |
560 | 537 |
561 static const GrStencilSettings& even_odd_path_stencil_settings() { | 538 static const GrStencilSettings& even_odd_path_stencil_settings() { |
(...skipping 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1244 GrPipelineBuilder::AutoRestoreStencil* ars, | 1221 GrPipelineBuilder::AutoRestoreStencil* ars, |
1245 GrScissorState* scissorState, | 1222 GrScissorState* scissorState, |
1246 const SkRect* devBounds) { | 1223 const SkRect* devBounds) { |
1247 return fClipMaskManager.setupClipping(pipelineBuilder, | 1224 return fClipMaskManager.setupClipping(pipelineBuilder, |
1248 are, | 1225 are, |
1249 ars, | 1226 ars, |
1250 scissorState, | 1227 scissorState, |
1251 this->getClip(), | 1228 this->getClip(), |
1252 devBounds); | 1229 devBounds); |
1253 } | 1230 } |
OLD | NEW |