| 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" |
| 11 #include "GrDrawContextPriv.h" | 11 #include "GrDrawContextPriv.h" |
| 12 #include "GrDrawingManager.h" | 12 #include "GrDrawingManager.h" |
| 13 #include "GrGpuResourcePriv.h" |
| 13 #include "GrOvalRenderer.h" | 14 #include "GrOvalRenderer.h" |
| 14 #include "GrPathRenderer.h" | 15 #include "GrPathRenderer.h" |
| 15 #include "GrPipelineBuilder.h" | 16 #include "GrPipelineBuilder.h" |
| 16 #include "GrRenderTarget.h" | 17 #include "GrRenderTarget.h" |
| 17 #include "GrRenderTargetPriv.h" | 18 #include "GrRenderTargetPriv.h" |
| 18 #include "GrResourceProvider.h" | 19 #include "GrResourceProvider.h" |
| 19 #include "SkSurfacePriv.h" | 20 #include "SkSurfacePriv.h" |
| 20 | 21 |
| 21 #include "batches/GrBatch.h" | 22 #include "batches/GrBatch.h" |
| 22 #include "batches/GrClearBatch.h" | 23 #include "batches/GrClearBatch.h" |
| (...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1209 args.fDrawContext = fDrawContext; | 1210 args.fDrawContext = fDrawContext; |
| 1210 args.fClip = &clip; | 1211 args.fClip = &clip; |
| 1211 args.fViewMatrix = &viewMatrix; | 1212 args.fViewMatrix = &viewMatrix; |
| 1212 args.fShape = &shape; | 1213 args.fShape = &shape; |
| 1213 args.fAntiAlias = useCoverageAA; | 1214 args.fAntiAlias = useCoverageAA; |
| 1214 args.fGammaCorrect = fDrawContext->isGammaCorrect(); | 1215 args.fGammaCorrect = fDrawContext->isGammaCorrect(); |
| 1215 pr->drawPath(args); | 1216 pr->drawPath(args); |
| 1216 return true; | 1217 return true; |
| 1217 } | 1218 } |
| 1218 | 1219 |
| 1220 SkBudgeted GrDrawContextPriv::isBudgeted() const { |
| 1221 ASSERT_SINGLE_OWNER_PRIV |
| 1222 |
| 1223 if (fDrawContext->wasAbandoned()) { |
| 1224 return SkBudgeted::kNo; |
| 1225 } |
| 1226 |
| 1227 SkDEBUGCODE(fDrawContext->validate();) |
| 1228 |
| 1229 return fDrawContext->fRenderTarget->resourcePriv().isBudgeted(); |
| 1230 } |
| 1231 |
| 1219 void GrDrawContext::internalDrawPath(const GrClip& clip, | 1232 void GrDrawContext::internalDrawPath(const GrClip& clip, |
| 1220 const GrPaint& paint, | 1233 const GrPaint& paint, |
| 1221 const SkMatrix& viewMatrix, | 1234 const SkMatrix& viewMatrix, |
| 1222 const SkPath& path, | 1235 const SkPath& path, |
| 1223 const GrStyle& style) { | 1236 const GrStyle& style) { |
| 1224 ASSERT_SINGLE_OWNER | 1237 ASSERT_SINGLE_OWNER |
| 1225 RETURN_IF_ABANDONED | 1238 RETURN_IF_ABANDONED |
| 1226 SkASSERT(!path.isEmpty()); | 1239 SkASSERT(!path.isEmpty()); |
| 1227 | 1240 |
| 1228 bool useCoverageAA = should_apply_coverage_aa(paint, fRenderTarget.get()); | 1241 bool useCoverageAA = should_apply_coverage_aa(paint, fRenderTarget.get()); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1290 | 1303 |
| 1291 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr
Clip& clip, | 1304 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr
Clip& clip, |
| 1292 GrDrawBatch* batch) { | 1305 GrDrawBatch* batch) { |
| 1293 ASSERT_SINGLE_OWNER | 1306 ASSERT_SINGLE_OWNER |
| 1294 RETURN_IF_ABANDONED | 1307 RETURN_IF_ABANDONED |
| 1295 SkDEBUGCODE(this->validate();) | 1308 SkDEBUGCODE(this->validate();) |
| 1296 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); | 1309 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); |
| 1297 | 1310 |
| 1298 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); | 1311 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); |
| 1299 } | 1312 } |
| OLD | NEW |