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 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 const SkRect& rect) { | 402 const SkRect& rect) { |
403 ASSERT_SINGLE_OWNER_PRIV | 403 ASSERT_SINGLE_OWNER_PRIV |
404 RETURN_IF_ABANDONED_PRIV | 404 RETURN_IF_ABANDONED_PRIV |
405 SkDEBUGCODE(fDrawContext->validate();) | 405 SkDEBUGCODE(fDrawContext->validate();) |
406 GR_AUDIT_TRAIL_AUTO_FRAME(fDrawContext->fAuditTrail, "GrDrawContext::stencil
Rect"); | 406 GR_AUDIT_TRAIL_AUTO_FRAME(fDrawContext->fAuditTrail, "GrDrawContext::stencil
Rect"); |
407 | 407 |
408 AutoCheckFlush acf(fDrawContext->fDrawingManager); | 408 AutoCheckFlush acf(fDrawContext->fDrawingManager); |
409 | 409 |
410 GrPaint paint; | 410 GrPaint paint; |
411 paint.setAntiAlias(doAA); | 411 paint.setAntiAlias(doAA); |
412 paint.setXPFactory(GrDisableColorXPFactory::Create()); | 412 SkSafeUnref(paint.setXPFactory(GrDisableColorXPFactory::Create())); |
413 | 413 |
414 SkAutoTUnref<GrDrawBatch> batch(fDrawContext->getFillRectBatch(paint, viewMa
trix, rect)); | 414 SkAutoTUnref<GrDrawBatch> batch(fDrawContext->getFillRectBatch(paint, viewMa
trix, rect)); |
415 SkASSERT(batch); | 415 SkASSERT(batch); |
416 | 416 |
417 GrPipelineBuilder pipelineBuilder(paint, fDrawContext->isUnifiedMultisampled
()); | 417 GrPipelineBuilder pipelineBuilder(paint, fDrawContext->isUnifiedMultisampled
()); |
418 pipelineBuilder.setRenderTarget(fDrawContext->accessRenderTarget()); | 418 pipelineBuilder.setRenderTarget(fDrawContext->accessRenderTarget()); |
419 pipelineBuilder.setUserStencil(ss); | 419 pipelineBuilder.setUserStencil(ss); |
420 | 420 |
421 fDrawContext->getDrawTarget()->drawBatch(pipelineBuilder, fDrawContext, clip
, batch); | 421 fDrawContext->getDrawTarget()->drawBatch(pipelineBuilder, fDrawContext, clip
, batch); |
422 } | 422 } |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1069 | 1069 |
1070 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr
Clip& clip, | 1070 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr
Clip& clip, |
1071 GrDrawBatch* batch) { | 1071 GrDrawBatch* batch) { |
1072 ASSERT_SINGLE_OWNER | 1072 ASSERT_SINGLE_OWNER |
1073 RETURN_IF_ABANDONED | 1073 RETURN_IF_ABANDONED |
1074 SkDEBUGCODE(this->validate();) | 1074 SkDEBUGCODE(this->validate();) |
1075 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); | 1075 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); |
1076 | 1076 |
1077 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); | 1077 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); |
1078 } | 1078 } |
OLD | NEW |