OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 #include "GrBatchTest.h" | 8 #include "GrBatchTest.h" |
9 #include "GrColor.h" | 9 #include "GrColor.h" |
10 #include "GrDrawContext.h" | 10 #include "GrDrawContext.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 #define RETURN_FALSE_IF_ABANDONED_PRIV if (fDrawContext->fDrawingManager->wasAb
andoned()) { return false; } | 52 #define RETURN_FALSE_IF_ABANDONED_PRIV if (fDrawContext->fDrawingManager->wasAb
andoned()) { return false; } |
53 #define RETURN_NULL_IF_ABANDONED if (fDrawingManager->wasAbandoned()) { return
nullptr; } | 53 #define RETURN_NULL_IF_ABANDONED if (fDrawingManager->wasAbandoned()) { return
nullptr; } |
54 | 54 |
55 using gr_instanced::InstancedRendering; | 55 using gr_instanced::InstancedRendering; |
56 | 56 |
57 class AutoCheckFlush { | 57 class AutoCheckFlush { |
58 public: | 58 public: |
59 AutoCheckFlush(GrDrawingManager* drawingManager) : fDrawingManager(drawingMa
nager) { | 59 AutoCheckFlush(GrDrawingManager* drawingManager) : fDrawingManager(drawingMa
nager) { |
60 SkASSERT(fDrawingManager); | 60 SkASSERT(fDrawingManager); |
61 } | 61 } |
62 ~AutoCheckFlush() { fDrawingManager->flushIfNecessary(); } | 62 ~AutoCheckFlush() { fDrawingManager->getContext()->flushIfNecessary(); } |
63 | 63 |
64 private: | 64 private: |
65 GrDrawingManager* fDrawingManager; | 65 GrDrawingManager* fDrawingManager; |
66 }; | 66 }; |
67 | 67 |
68 bool GrDrawContext::wasAbandoned() const { | 68 bool GrDrawContext::wasAbandoned() const { |
69 return fDrawingManager->wasAbandoned(); | 69 return fDrawingManager->wasAbandoned(); |
70 } | 70 } |
71 | 71 |
72 // In MDB mode the reffing of the 'getLastDrawTarget' call's result allows in-pr
ogress | 72 // In MDB mode the reffing of the 'getLastDrawTarget' call's result allows in-pr
ogress |
(...skipping 1352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1425 | 1425 |
1426 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr
Clip& clip, | 1426 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr
Clip& clip, |
1427 GrDrawBatch* batch) { | 1427 GrDrawBatch* batch) { |
1428 ASSERT_SINGLE_OWNER | 1428 ASSERT_SINGLE_OWNER |
1429 RETURN_IF_ABANDONED | 1429 RETURN_IF_ABANDONED |
1430 SkDEBUGCODE(this->validate();) | 1430 SkDEBUGCODE(this->validate();) |
1431 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); | 1431 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); |
1432 | 1432 |
1433 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); | 1433 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); |
1434 } | 1434 } |
OLD | NEW |