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 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 } | 226 } |
227 | 227 |
228 GrPaint paint; | 228 GrPaint paint; |
229 paint.setColor4f(GrColor4f::FromGrColor(color)); | 229 paint.setColor4f(GrColor4f::FromGrColor(color)); |
230 paint.setXPFactory(GrPorterDuffXPFactory::Make(SkXfermode::kSrc_Mode)); | 230 paint.setXPFactory(GrPorterDuffXPFactory::Make(SkXfermode::kSrc_Mode)); |
231 | 231 |
232 this->drawRect(GrNoClip(), paint, SkMatrix::I(), SkRect::Make(*rect)); | 232 this->drawRect(GrNoClip(), paint, SkMatrix::I(), SkRect::Make(*rect)); |
233 } else if (isFull) { | 233 } else if (isFull) { |
234 this->getDrawTarget()->fullClear(this->accessRenderTarget(), color); | 234 this->getDrawTarget()->fullClear(this->accessRenderTarget(), color); |
235 } else { | 235 } else { |
236 sk_sp<GrBatch> batch = GrClearBatch::Make(*rect, color, this->accessRend
erTarget()); | 236 sk_sp<GrBatch> batch(GrClearBatch::Make(*rect, color, this->accessRender
Target())); |
237 this->getDrawTarget()->addBatch(std::move(batch)); | 237 this->getDrawTarget()->addBatch(std::move(batch)); |
238 } | 238 } |
239 } | 239 } |
240 | 240 |
241 | 241 |
242 void GrDrawContext::drawPaint(const GrClip& clip, | 242 void GrDrawContext::drawPaint(const GrClip& clip, |
243 const GrPaint& origPaint, | 243 const GrPaint& origPaint, |
244 const SkMatrix& viewMatrix) { | 244 const SkMatrix& viewMatrix) { |
245 ASSERT_SINGLE_OWNER | 245 ASSERT_SINGLE_OWNER |
246 RETURN_IF_ABANDONED | 246 RETURN_IF_ABANDONED |
(...skipping 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1307 | 1307 |
1308 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr
Clip& clip, | 1308 void GrDrawContext::drawBatch(const GrPipelineBuilder& pipelineBuilder, const Gr
Clip& clip, |
1309 GrDrawBatch* batch) { | 1309 GrDrawBatch* batch) { |
1310 ASSERT_SINGLE_OWNER | 1310 ASSERT_SINGLE_OWNER |
1311 RETURN_IF_ABANDONED | 1311 RETURN_IF_ABANDONED |
1312 SkDEBUGCODE(this->validate();) | 1312 SkDEBUGCODE(this->validate();) |
1313 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); | 1313 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::drawBatch"); |
1314 | 1314 |
1315 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); | 1315 this->getDrawTarget()->drawBatch(pipelineBuilder, this, clip, batch); |
1316 } | 1316 } |
OLD | NEW |