OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2015 Google Inc. | 3 * Copyright 2015 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 "GrBatchTest.h" | 9 #include "GrBatchTest.h" |
10 #include "GrColor.h" | 10 #include "GrColor.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 ~AutoCheckFlush() { fDrawingManager->getContext()->flushIfNecessary(); } | 43 ~AutoCheckFlush() { fDrawingManager->getContext()->flushIfNecessary(); } |
44 | 44 |
45 private: | 45 private: |
46 GrDrawingManager* fDrawingManager; | 46 GrDrawingManager* fDrawingManager; |
47 }; | 47 }; |
48 | 48 |
49 // In MDB mode the reffing of the 'getLastDrawTarget' call's result allows in-pr
ogress | 49 // In MDB mode the reffing of the 'getLastDrawTarget' call's result allows in-pr
ogress |
50 // drawTargets to be picked up and added to by drawContexts lower in the call | 50 // drawTargets to be picked up and added to by drawContexts lower in the call |
51 // stack. When this occurs with a closed drawTarget, a new one will be allocated | 51 // stack. When this occurs with a closed drawTarget, a new one will be allocated |
52 // when the drawContext attempts to use it (via getDrawTarget). | 52 // when the drawContext attempts to use it (via getDrawTarget). |
53 GrDrawContext::GrDrawContext(GrDrawingManager* drawingMgr, | 53 GrDrawContext::GrDrawContext(GrContext* context, |
| 54 GrDrawingManager* drawingMgr, |
54 GrRenderTarget* rt, | 55 GrRenderTarget* rt, |
55 const SkSurfaceProps* surfaceProps, | 56 const SkSurfaceProps* surfaceProps, |
56 GrAuditTrail* auditTrail, | 57 GrAuditTrail* auditTrail, |
57 GrSingleOwner* singleOwner) | 58 GrSingleOwner* singleOwner) |
58 : fDrawingManager(drawingMgr) | 59 : fDrawingManager(drawingMgr) |
59 , fRenderTarget(rt) | 60 , fRenderTarget(rt) |
60 , fDrawTarget(SkSafeRef(rt->getLastDrawTarget())) | 61 , fDrawTarget(SkSafeRef(rt->getLastDrawTarget())) |
61 , fTextContext(nullptr) | 62 , fTextContext(nullptr) |
| 63 , fContext(context) |
62 , fSurfaceProps(SkSurfacePropsCopyOrDefault(surfaceProps)) | 64 , fSurfaceProps(SkSurfacePropsCopyOrDefault(surfaceProps)) |
63 , fAuditTrail(auditTrail) | 65 , fAuditTrail(auditTrail) |
64 #ifdef SK_DEBUG | 66 #ifdef SK_DEBUG |
65 , fSingleOwner(singleOwner) | 67 , fSingleOwner(singleOwner) |
66 #endif | 68 #endif |
67 { | 69 { |
68 SkDEBUGCODE(this->validate();) | 70 SkDEBUGCODE(this->validate();) |
69 } | 71 } |
70 | 72 |
71 #ifdef SK_DEBUG | 73 #ifdef SK_DEBUG |
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
845 } | 847 } |
846 | 848 |
847 void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* b
atch) { | 849 void GrDrawContext::drawBatch(GrPipelineBuilder* pipelineBuilder, GrDrawBatch* b
atch) { |
848 ASSERT_SINGLE_OWNER | 850 ASSERT_SINGLE_OWNER |
849 RETURN_IF_ABANDONED | 851 RETURN_IF_ABANDONED |
850 SkDEBUGCODE(this->validate();) | 852 SkDEBUGCODE(this->validate();) |
851 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); | 853 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); |
852 | 854 |
853 this->getDrawTarget()->drawBatch(*pipelineBuilder, batch); | 855 this->getDrawTarget()->drawBatch(*pipelineBuilder, batch); |
854 } | 856 } |
OLD | NEW |