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->getContext()->flushIfNecessary(); } | 62 ~AutoCheckFlush() { fDrawingManager->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 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1428 | 1428 |
1429 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr
Clip& clip, | 1429 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr
Clip& clip, |
1430 GrDrawBatch* batch) { | 1430 GrDrawBatch* batch) { |
1431 ASSERT_SINGLE_OWNER | 1431 ASSERT_SINGLE_OWNER |
1432 RETURN_IF_ABANDONED | 1432 RETURN_IF_ABANDONED |
1433 SkDEBUGCODE(this->validate();) | 1433 SkDEBUGCODE(this->validate();) |
1434 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); | 1434 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); |
1435 | 1435 |
1436 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); | 1436 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); |
1437 } | 1437 } |
OLD | NEW |