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 #include "GrDrawTarget.h" | 9 #include "GrDrawTarget.h" |
10 | 10 |
(...skipping 19 matching lines...) Expand all Loading... |
30 fPrimitiveType = di.fPrimitiveType; | 30 fPrimitiveType = di.fPrimitiveType; |
31 fStartVertex = di.fStartVertex; | 31 fStartVertex = di.fStartVertex; |
32 fStartIndex = di.fStartIndex; | 32 fStartIndex = di.fStartIndex; |
33 fVertexCount = di.fVertexCount; | 33 fVertexCount = di.fVertexCount; |
34 fIndexCount = di.fIndexCount; | 34 fIndexCount = di.fIndexCount; |
35 | 35 |
36 fInstanceCount = di.fInstanceCount; | 36 fInstanceCount = di.fInstanceCount; |
37 fVerticesPerInstance = di.fVerticesPerInstance; | 37 fVerticesPerInstance = di.fVerticesPerInstance; |
38 fIndicesPerInstance = di.fIndicesPerInstance; | 38 fIndicesPerInstance = di.fIndicesPerInstance; |
39 | 39 |
40 fVertexBuffer.reset(di.vertexBuffer()); | 40 if (di.fDevBounds) { |
41 fIndexBuffer.reset(di.indexBuffer()); | 41 SkASSERT(di.fDevBounds == &di.fDevBoundsStorage); |
| 42 fDevBoundsStorage = di.fDevBoundsStorage; |
| 43 fDevBounds = &fDevBoundsStorage; |
| 44 } else { |
| 45 fDevBounds = NULL; |
| 46 } |
| 47 |
| 48 this->setVertexBuffer(di.vertexBuffer()); |
| 49 this->setIndexBuffer(di.indexBuffer()); |
42 | 50 |
43 return *this; | 51 return *this; |
44 } | 52 } |
45 | 53 |
46 //////////////////////////////////////////////////////////////////////////////// | 54 //////////////////////////////////////////////////////////////////////////////// |
47 | 55 |
48 #define DEBUG_INVAL_BUFFER 0xdeadcafe | 56 #define DEBUG_INVAL_BUFFER 0xdeadcafe |
49 #define DEBUG_INVAL_START_IDX -1 | 57 #define DEBUG_INVAL_START_IDX -1 |
50 | 58 |
51 GrDrawTarget::GrDrawTarget(GrContext* context, | 59 GrDrawTarget::GrDrawTarget(GrContext* context, |
(...skipping 730 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 GrPipelineBuilder::AutoRestoreFragmentProcessors* a
rfp, | 790 GrPipelineBuilder::AutoRestoreFragmentProcessors* a
rfp, |
783 GrPipelineBuilder::AutoRestoreStencil* ars, | 791 GrPipelineBuilder::AutoRestoreStencil* ars, |
784 GrScissorState* scissorState, | 792 GrScissorState* scissorState, |
785 const SkRect* devBounds) { | 793 const SkRect* devBounds) { |
786 return fClipMaskManager.setupClipping(pipelineBuilder, | 794 return fClipMaskManager.setupClipping(pipelineBuilder, |
787 arfp, | 795 arfp, |
788 ars, | 796 ars, |
789 scissorState, | 797 scissorState, |
790 devBounds); | 798 devBounds); |
791 } | 799 } |
OLD | NEW |