| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 return fDrawingManager->wasAbandoned(); | 61 return fDrawingManager->wasAbandoned(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 // In MDB mode the reffing of the 'getLastDrawTarget' call's result allows in-pr
ogress | 64 // In MDB mode the reffing of the 'getLastDrawTarget' call's result allows in-pr
ogress |
| 65 // drawTargets to be picked up and added to by drawContexts lower in the call | 65 // drawTargets to be picked up and added to by drawContexts lower in the call |
| 66 // stack. When this occurs with a closed drawTarget, a new one will be allocated | 66 // stack. When this occurs with a closed drawTarget, a new one will be allocated |
| 67 // when the drawContext attempts to use it (via getDrawTarget). | 67 // when the drawContext attempts to use it (via getDrawTarget). |
| 68 GrDrawContext::GrDrawContext(GrContext* context, | 68 GrDrawContext::GrDrawContext(GrContext* context, |
| 69 GrDrawingManager* drawingMgr, | 69 GrDrawingManager* drawingMgr, |
| 70 sk_sp<GrRenderTarget> rt, | 70 sk_sp<GrRenderTarget> rt, |
| 71 sk_sp<SkColorSpace> colorSpace, |
| 71 const SkSurfaceProps* surfaceProps, | 72 const SkSurfaceProps* surfaceProps, |
| 72 GrAuditTrail* auditTrail, | 73 GrAuditTrail* auditTrail, |
| 73 GrSingleOwner* singleOwner) | 74 GrSingleOwner* singleOwner) |
| 74 : fDrawingManager(drawingMgr) | 75 : fDrawingManager(drawingMgr) |
| 75 , fRenderTarget(std::move(rt)) | 76 , fRenderTarget(std::move(rt)) |
| 76 , fDrawTarget(SkSafeRef(fRenderTarget->getLastDrawTarget())) | 77 , fDrawTarget(SkSafeRef(fRenderTarget->getLastDrawTarget())) |
| 77 , fContext(context) | 78 , fContext(context) |
| 78 , fInstancedPipelineInfo(fRenderTarget.get()) | 79 , fInstancedPipelineInfo(fRenderTarget.get()) |
| 80 , fColorSpace(std::move(colorSpace)) |
| 79 , fSurfaceProps(SkSurfacePropsCopyOrDefault(surfaceProps)) | 81 , fSurfaceProps(SkSurfacePropsCopyOrDefault(surfaceProps)) |
| 80 , fAuditTrail(auditTrail) | 82 , fAuditTrail(auditTrail) |
| 81 #ifdef SK_DEBUG | 83 #ifdef SK_DEBUG |
| 82 , fSingleOwner(singleOwner) | 84 , fSingleOwner(singleOwner) |
| 83 #endif | 85 #endif |
| 84 { | 86 { |
| 85 SkDEBUGCODE(this->validate();) | 87 SkDEBUGCODE(this->validate();) |
| 86 } | 88 } |
| 87 | 89 |
| 88 #ifdef SK_DEBUG | 90 #ifdef SK_DEBUG |
| (...skipping 1152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1241 | 1243 |
| 1242 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr
Clip& clip, | 1244 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr
Clip& clip, |
| 1243 GrDrawBatch* batch) { | 1245 GrDrawBatch* batch) { |
| 1244 ASSERT_SINGLE_OWNER | 1246 ASSERT_SINGLE_OWNER |
| 1245 RETURN_IF_ABANDONED | 1247 RETURN_IF_ABANDONED |
| 1246 SkDEBUGCODE(this->validate();) | 1248 SkDEBUGCODE(this->validate();) |
| 1247 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); | 1249 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); |
| 1248 | 1250 |
| 1249 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); | 1251 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); |
| 1250 } | 1252 } |
| OLD | NEW |